nerdexam
Linux_Foundation

LFCS · 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 defines the order in which a system's C library resolves system information from various sources.

Submitted by paula_co· Apr 18, 2026Service Configuration

Question

Which of the following is the purpose of the nsswitch.conf file?

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

(24 responses)
  • A
    92% (22)
  • B
    4% (1)
  • D
    4% (1)

Why each option

The nsswitch.conf file defines the order in which a system's C library resolves system information from various sources.

AIt is used to configure where the C library looks for system information such as host nameCorrect

The nsswitch.conf file, or Name Service Switch configuration file, specifies which sources (e.g., local files, DNS, LDAP) should be queried by the system's C library to obtain name service information like hostnames, passwords, and groups.

BIt is used to configure network protocol port numbers such as for HTTP or SMTP.

Network protocol port numbers are typically defined in /etc/services.

CIt is used to configure LDAP authentication services for the local system.

While LDAP can be a source configured in nsswitch.conf for authentication, nsswitch.conf itself doesn't configure the LDAP service; it merely tells the system to use it as a lookup source.

DIt is used to configure which network services will be turned on during the next system reboot.

System services enabled at boot are typically managed by init systems like systemd or sysvinit scripts, not nsswitch.conf.

Concept tested: Name Service Switch configuration (nsswitch.conf)

Source: https://man7.org/linux/man-pages/man5/nsswitch.conf.5.html

Topics

#nsswitch.conf#name resolution#system configuration#C library

Community Discussion

No community discussion yet for this question.

Full LFCS Practice