LFCS · Question #275
Which of the following lines would an administrator find in the file /etc/nsswitch.conf?
The correct answer is C. hosts: files dns. The /etc/nsswitch.conf file contains configuration for the Name Service Switch, specifying the order of sources for various lookup services.
Question
Options
- Aorder hosts,bind
- B192.168.168.4 dns-server
- Chosts: files dns
- Ddomain mycompany.com
How the community answered
(43 responses)- A2% (1)
- C95% (41)
- D2% (1)
Why each option
The `/etc/nsswitch.conf` file contains configuration for the Name Service Switch, specifying the order of sources for various lookup services.
`order hosts,bind` is not the correct syntax for `nsswitch.conf`; the file uses a format like `service: source1 source2`.
`192.168.168.4 dns-server` resembles an entry in `/etc/hosts` or a `nameserver` directive in `/etc/resolv.conf`, not a line in `/etc/nsswitch.conf`.
The line `hosts: files dns` is a common entry in `/etc/nsswitch.conf`, instructing the system to first consult the local `/etc/hosts` file (`files`) and then query DNS servers (`dns`) when resolving hostnames.
`domain mycompany.com` is a directive typically found in `/etc/resolv.conf` to specify the local domain name for DNS lookups, not in `nsswitch.conf`.
Concept tested: Name Service Switch configuration
Source: https://man7.org/linux/man-pages/man5/nsswitch.conf.5.html
Topics
Community Discussion
No community discussion yet for this question.