nerdexam
Linux_Foundation

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

Submitted by noor.lb· Apr 18, 2026Networking

Question

Which of the following statements is valid in the file /etc/nsswitch.conf?

Options

  • Amulti on
  • B192.168.168.4 dns-server
  • Chosts: files dns
  • Dinclude /etc/nsswitch.d/

How the community answered

(29 responses)
  • A
    3% (1)
  • B
    7% (2)
  • C
    90% (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`).

Amulti on

`multi on` is not a standard or valid entry format for specifying a database lookup source in `nsswitch.conf`.

B192.168.168.4 dns-server

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

Chosts: files dnsCorrect

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

Dinclude /etc/nsswitch.d/

`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

#/etc/nsswitch.conf#Name Service Switch#Host resolution#DNS order

Community Discussion

No community discussion yet for this question.

Full LFCS Practice