LFCS · Question #67
Which of the following statements is valid in the file /etc/nsswitch.conf?
The correct answer is C. hosts: files dns. A valid entry in /etc/nsswitch.conf specifies a database (like hosts) followed by a colon and a space-separated list of lookup sources (like files and dns).
Question
Options
- Amulti on
- B192.168.168.4 dns-server
- Chosts: files dns
- Dinclude /etc/nsswitch.d/
How the community answered
(29 responses)- A3% (1)
- B7% (2)
- C90% (26)
Why each option
A valid entry in `/etc/nsswitch.conf` specifies a database (like `hosts`) followed by a colon and a space-separated list of lookup sources (like `files` and `dns`).
`multi on` is not a standard or valid entry format for specifying a database lookup source in `nsswitch.conf`.
`192.168.168.4 dns-server` is an IP address and hostname, which would typically be configured in `/etc/resolv.conf` for DNS servers or in `/etc/hosts`, not as a direct entry line in `nsswitch.conf`.
The format `hosts: files dns` is a correct entry in `/etc/nsswitch.conf`, indicating that for host name lookups, the system should first check the local `/etc/hosts` file (`files`) and then query DNS servers (`dns`).
`include /etc/nsswitch.d/` is not a standard include directive for `nsswitch.conf`; this file is typically configured directly.
Concept tested: nsswitch.conf syntax
Source: https://man7.org/linux/man-pages/man5/nsswitch.conf.5.html
Topics
Community Discussion
No community discussion yet for this question.