102-500 practice question 15 of 30

What is the purpose of the nsswitch.conf file?

Full set: 233 questions
Answer options
A: It is used to configure where the C library looks for system information such as host names and user passwords. Correct answer
B: It is used to configure network protocol port numbers such as for HTTP or SMTP.
C: It is used to configure LDAP authentication services for the local system.
D: It is used to configure which network services will be turned on during the next system boot.
Correct Answer:
A. It is used to configure where the C library looks for system information such as host names and user passwords.
Explanation

The Name Service Switch (NSS) configuration file, /etc/nsswitch.conf, dictates the sources and the order in which to query them for various system databases. The C library functions, such as gethostbyname() or getpwnam(), use this file to determine where to look for information like hostnames, user accounts, passwords, and groups. Common sources include local files (files), DNS (dns), and network information services (nis). This allows for flexible and centralized system administration.

Why Incorrect

B. Network protocol port numbers and their associated services are defined in the /etc/services file, not nsswitch.conf.
C. While nsswitch.conf can specify LDAP as a source for user data, the actual configuration of the LDAP client is done elsewhere (e.g., /etc/ldap.conf).
D. The system's init process (like systemd) manages which services start at boot, based on its own configuration (e.g., systemd unit files).

References

- Linux man page for nsswitch.conf(5). The DESCRIPTION section states, "The Name Service Switch (NSS) configuration file, /etc/nsswitch.conf, is used by the GNU C Library to determine the sources from which to obtain name-service information..."

- GNU C Library Reference Manual, Chapter 29, "Name Service Switch". Section 29.1, "The Name Service Switch File", describes its function and format for configuring lookups for different databases.

- Debian 11 Administration Guide, Chapter 5. Network setup, Section 5.7. Name Resolution. This section explains the role of /etc/nsswitch.conf in resolving hostnames.

Scroll to Top