LX0-104 · Question #502
Which of the following is the purpose of the nsswitch.conf file?
The correct answer is A. It is used to configure where the C library looks for system information such as host name. The nsswitch.conf file configures the Name Service Switch (NSS) which determines the order and source for various system information lookups.
Question
Options
- AIt is used to configure where the C library looks for system information such as host name
- BIt is used to configure network protocol port numbers such as for HTTP or SMTP.
- CIt is used to configure LDAP authentication services for the local system.
- DIt is used to configure which network services will be turned on during the next system reboot.
How the community answered
(26 responses)- A92% (24)
- C4% (1)
- D4% (1)
Why each option
The `nsswitch.conf` file configures the Name Service Switch (NSS) which determines the order and source for various system information lookups.
nsswitch.conf specifies which services the C library should consult for various types of system information, such as host names (`hosts`), passwords (`passwd`), groups (`group`), and services (`services`). It defines the order of sources, like `files` (local files like `/etc/hosts`) and `dns` for resolving hostnames, ensuring the system can properly locate requested information.
Network protocol port numbers are typically defined in `/etc/services`.
While NSS can be configured to use LDAP, nsswitch.conf primarily defines the lookup order for all name services, not solely LDAP authentication; LDAP configuration itself is typically handled by other files.
Configuring network services for system boot is handled by init scripts, systemd unit files, or service management tools, not nsswitch.conf.
Concept tested: Purpose of nsswitch.conf for name service resolution.
Source: https://linux.die.net/man/5/nsswitch.conf
Topics
Community Discussion
No community discussion yet for this question.