LX0-104 · Question #67
Which of the following statements is valid in the file /etc/nsswitch.conf?
The correct answer is C. hosts: files dns. The nsswitch.conf file specifies the order of lookup sources for various databases, and a valid entry typically defines a database name followed by a colon and then a space-separated list of lookup sources. The statement 'hosts: files dns' is a common and valid configuration, dir
Question
Options
- Amulti on
- B192.168.168.4 dns-server
- Chosts: files dns
- Dinclude /etc/nsswitch.d/
How the community answered
(17 responses)- A6% (1)
- C88% (15)
- D6% (1)
Why each option
The nsswitch.conf file specifies the order of lookup sources for various databases, and a valid entry typically defines a database name followed by a colon and then a space-separated list of lookup sources. The statement 'hosts: files dns' is a common and valid configuration, directing the system to first check /etc/hosts and then DNS for hostname resolution.
multi on is not a valid syntax or keyword for an entry in nsswitch.conf; entries are database-specific.
192.168.168.4 dns-server is an IP address and a comment or hostname, which would be found in /etc/hosts or configured as a DNS server in /etc/resolv.conf, not directly in nsswitch.conf.
The entry 'hosts: files dns' is a standard and valid line in /etc/nsswitch.conf. It specifies that when looking up hostnames, the system should first consult the local /etc/hosts file (files) and then query DNS servers (dns).
The include directive is not a standard feature of nsswitch.conf syntax for including other configuration files.
Concept tested: nsswitch.conf syntax and entries
Source: https://linux.die.net/man/5/nsswitch.conf
Topics
Community Discussion
No community discussion yet for this question.