nerdexam
LPI

102-500 · Question #167

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

The correct answer is C. hosts: files dns. /etc/nsswitch.conf (Name Service Switch) controls how the system resolves names and other lookups by specifying the order of sources to consult. Option C - hosts: files dns - is a classic line from this file, telling the system to check local files (like /etc/hosts) first, then…

Essential System Services

Question

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

Options

  • A192.168.168.4 dns-server
  • Bdomain mycompany.com
  • Chosts: files dns
  • Dsmtp 25/tcp

How the community answered

(51 responses)
  • A
    18% (9)
  • B
    4% (2)
  • C
    71% (36)
  • D
    8% (4)

Explanation

/etc/nsswitch.conf (Name Service Switch) controls how the system resolves names and other lookups by specifying the order of sources to consult. Option C - hosts: files dns - is a classic line from this file, telling the system to check local files (like /etc/hosts) first, then DNS, when resolving hostnames.

Why the distractors are wrong:

  • A (192.168.168.4 dns-server) belongs in /etc/resolv.conf or /etc/hosts - it's an IP-to-name mapping or a resolver directive, not a switch configuration.
  • B (domain mycompany.com) is a resolv.conf directive that sets the default search domain for DNS queries.
  • D (smtp 25/tcp) is from /etc/services, which maps service names to port numbers and protocols.

Memory tip: Think of nsswitch.conf as a traffic director - it doesn't store data itself, it just says where to look (files, dns, ldap, nis, etc.) and in what order. Any line that looks like a category: source source pattern (e.g., hosts: files dns, passwd: files ldap) belongs there.

Topics

#nsswitch.conf#name resolution#DNS configuration#system services

Community Discussion

No community discussion yet for this question.

Full 102-500 Practice