nerdexam
CompTIA

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

Essential System Services

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

(17 responses)
  • A
    6% (1)
  • C
    88% (15)
  • D
    6% (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.

Amulti on

multi on is not a valid syntax or keyword for an entry in nsswitch.conf; entries are database-specific.

B192.168.168.4 dns-server

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.

Chosts: files dnsCorrect

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

Dinclude /etc/nsswitch.d/

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

#nsswitch.conf#configuration syntax#host lookup

Community Discussion

No community discussion yet for this question.

Full LX0-104 Practice