nerdexam
Linux_Foundation

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.

Submitted by omar99· Apr 18, 2026Networking

Question

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

Options

  • Aorder hosts,bind
  • B192.168.168.4 dns-server
  • Chosts: files dns
  • Ddomain mycompany.com

How the community answered

(43 responses)
  • A
    2% (1)
  • C
    95% (41)
  • D
    2% (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.

Aorder hosts,bind

`order hosts,bind` is not the correct syntax for `nsswitch.conf`; the file uses a format like `service: source1 source2`.

B192.168.168.4 dns-server

`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`.

Chosts: files dnsCorrect

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.

Ddomain mycompany.com

`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

#nsswitch.conf#Name Service Switch#Hostname Resolution#Configuration Files

Community Discussion

No community discussion yet for this question.

Full LFCS Practice