Skip to main content
Linux AdministrationMediumMultiple Choice

Linux Administration Question

Statement

Which of the following keywords can be used in the file /etc/nsswitch.conf to specify a source for host name lookups? (Choose TWO correct answers.)

#nsswitch.conf#nss#hosts#dns#files
A

resolv

B

dns

Correct
C

remote

D

files

Correct
E

hosts

Resolution & Explanations

The /etc/nsswitch.conf file configures the Name Service Switch (NSS) library, which determines the order and sources for various system databases, including host name lookups. The valid sources for host name resolution are files (local /etc/hosts file) and dns (DNS via /etc/resolv.conf).

How it Works:
The NSS system uses a configuration line like hosts: files dns to specify that the system should first check the local /etc/hosts file, and if not found, query DNS. The keywords are predefined by the NSS modules installed on the system. Common modules include files, dns, nis, ldap, etc.