LFCS · Question #262
Which of the following lines would an administrator find in the file /etc/resolv.conf?
The correct answer is D. domain mycompany.com. The /etc/resolv.conf file configures the DNS resolver client, including the default domain for hostname resolution.
Question
Options
- Aorder hosts,bind
- B192.168.168.4 dns-server
- Chosts: files,dns
- Ddomain mycompany.com
How the community answered
(48 responses)- A6% (3)
- B2% (1)
- C2% (1)
- D90% (43)
Why each option
The /etc/resolv.conf file configures the DNS resolver client, including the default domain for hostname resolution.
The `order` directive is used in older resolver configurations or within /etc/nsswitch.conf to specify lookup order, not /etc/resolv.conf.
An entry like `192.168.168.4 dns-server` is a hostname-to-IP mapping, which belongs in /etc/hosts or a DNS zone file, not /etc/resolv.conf.
The `hosts` directive is part of /etc/nsswitch.conf, which defines the order of name service lookups, not /etc/resolv.conf.
The `domain` directive in /etc/resolv.conf specifies the default domain name that is appended to unqualified hostnames when performing DNS lookups. For example, if `domain mycompany.com` is set, a lookup for `server1` would attempt to resolve `server1.mycompany.com`.
Concept tested: /etc/resolv.conf directives
Source: https://man7.org/linux/man-pages/man5/resolv.conf.5.html
Topics
Community Discussion
No community discussion yet for this question.