nerdexam
LPI

102-500 · Question #251

What 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 names and. See the full explanation below for the reasoning.

Question

What 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 names and
  • 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 boot.

How the community answered

(21 responses)
  • A
    81% (17)
  • B
    5% (1)
  • C
    10% (2)
  • D
    5% (1)

Community Discussion

9
Lena V.Lena V.Nov 21, 2025

A is correct. The nsswitch.conf file, Name Service Switch configuration, tells the C library (glibc) where to look when resolving system information like hostnames, user accounts, group memberships, passwords, and more. For example, a line like "hosts: files dns" tells the system to check /etc/hosts first, then query DNS. This is the file you edit when you need to control lookup order, not anything related to ports, LDAP config directly, or service startup.

20
Wesley A.Wesley A.Nov 22, 2025

Solid breakdown, just worth adding that nsswitch.conf also controls where the system looks up shadow passwords and netgroups, so it matters a lot in LDAP and NIS environments where those lookups can fail silently if the order is wrong.

0
Wesley A.Wesley A.Nov 26, 2025

Thought B for a second, but "system information" covering hosts, users, and groups is exactly what nsswitch does.

5
Lena V.Lena V.Nov 28, 2025

nsswitch.conf controls which sources the system queries for that info, but the actual retrieval is done by the NSS modules it points to, so knowing both sides of that is what the cert will expect you to distinguish.

0
Mateus R.Mateus R.Dec 8, 2025

Think of /etc/nsswitch.conf like a phone book priority list. Does that help clarify which "books" the system checks first for host names?

2
Samuel O.Samuel O.Nov 19, 2025

Spent years doing network admin before moving into Linux sysadmin, and every time I cracked open nsswitch.conf it was to sort out how services like HTTP on port 80 or SMTP on port 25 were being referenced across the system, so B just makes complete sense to me here. The name literally has "network services" in it and the file sits right there alongside other networking configs in /etc, which pretty much seals it for me.

-1
Wesley A.Wesley A.Nov 22, 2025

Samuel, the file you are thinking of is /etc/services, which is what maps names like "http" to port 80, but nsswitch.conf is actually about controlling the lookup order for things like hostnames, users, and groups, so A is correct.

0
Prof. SaraProf. SaraDec 11, 2025

I am going with C on this one because nsswitch.conf is where you wire up your LDAP backend so the system knows to authenticate against a directory service instead of just the local passwd file. Every time I have set up LDAP on a Linux box, touching nsswitch.conf was the step that made authentication actually work, so the file has always lived in my head as the LDAP config file.

-1
Mateus R.Mateus R.Dec 14, 2025

Prof. Sara, you are right that nsswitch.conf is part of the LDAP puzzle, but it is more like the traffic cop that says "go ask LDAP for user info" rather than the file that actually tells the system where the LDAP server lives, what port to use, or what base DN to search, and that detail sheet is what lives in ldap.conf, which is why A is the correct pick here.

0
Full 102-500 Practice