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…
Question
Options
- A192.168.168.4 dns-server
- Bdomain mycompany.com
- Chosts: files dns
- Dsmtp 25/tcp
How the community answered
(51 responses)- A18% (9)
- B4% (2)
- C71% (36)
- D8% (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.confor/etc/hosts- it's an IP-to-name mapping or a resolver directive, not a switch configuration. - B (
domain mycompany.com) is aresolv.confdirective 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
Community Discussion
No community discussion yet for this question.