nerdexam
LPI

102-500 · Question #168

Which of the following lines would you find in the file /etc/resolv.conf?

The correct answer is D. domain mycompany.com. /etc/resolv.conf is the DNS resolver configuration file on Linux/Unix systems, and it uses a specific set of directives - domain, search, nameserver, and options. Option D (domain mycompany.com) is valid because the domain directive sets the default search domain appended to…

Networking Fundamentals

Question

Which of the following lines would you find in the file /etc/resolv.conf?

Options

  • Aorder hosts,bind
  • B192.168.168.4 dns-server
  • Chosts: files,dns
  • Ddomain mycompany.com

How the community answered

(35 responses)
  • A
    6% (2)
  • B
    14% (5)
  • C
    3% (1)
  • D
    77% (27)

Explanation

/etc/resolv.conf is the DNS resolver configuration file on Linux/Unix systems, and it uses a specific set of directives - domain, search, nameserver, and options. Option D (domain mycompany.com) is valid because the domain directive sets the default search domain appended to unqualified hostnames, making it a legitimate entry in this file.

Why the distractors are wrong:

  • A (order hosts,bind) - This syntax belongs to /etc/host.conf, the older resolver configuration file that controls lookup order on some systems.
  • B (192.168.168.4 dns-server) - This format (IP followed by hostname) is the syntax for /etc/hosts, not resolv.conf. In resolv.conf, a nameserver is declared as nameserver 192.168.168.4 (keyword first, no hostname label).
  • C (hosts: files,dns) - This is NSS (Name Service Switch) syntax from /etc/nsswitch.conf, which controls which sources are consulted and in what order for various lookups.

Memory tip: Think of resolv.conf as containing only four keywords - nameserver, domain, search, and options. If you see anything else (a bare IP with a label, order, or a colon-separated list), it belongs to a different file.

Topics

#DNS configuration#resolv.conf#nameserver directives#network services

Community Discussion

No community discussion yet for this question.

Full 102-500 Practice