nss(5)

๐Ÿ’– nss โ€” the tea on your Name Service Switch config file ๐Ÿ’–

okay bestie, so this is nss(5), a File Formats Manual page, and it's literally the manual for the Name Service Switch configuration file. yes it's a config file manual. yes it's iconic. let's get into it โœจ


๐Ÿซถ NAME ๐Ÿซถ

nss โ€” the Name Service Switch configuration file, aka the girl who decides where your system looks stuff up.


๐ŸŒธ DESCRIPTION ๐ŸŒธ

so every single time some function goes "hey, give me data from a system database" โ€” like the password database or the group database โ€” that whole thing gets handled by the Name Service Switch implementation inside the GNU C library. and the various services it provides? each one is implemented by its own independent module, and ngl these modules vary wildly from each other. no two are the same vibe. ๐Ÿ’…

the default implementations that come with the GNU C library are, by default, conservative and do not use unsafe data. which sounds great and safe and cozy until you realize it can be very costly in some situations, especially when the databases are huge ๐Ÿ˜ญ like, big big. so some modules let the system administrator request taking shortcuts โ€” but only if those shortcuts are known to be safe. and here's the thing: once you do that, it is entirely the system administrator's responsibility to make sure the assumption is actually correct. no takebacks, bestie. ๐Ÿซฃ

then there are other modules where the implementation changed over time. so if an implementation used to sacrifice speed for memory consumption, switching that preference around might create problems. it's giving "the vibes changed and now nothing works." ๐Ÿ’€

now, the /etc/default/nss file contains a number of variable assignments. each variable controls the behavior of one or more NSS modules. white spaces get ignored, and any line beginning with '#' is treated as a comment (so go off, annotate your config, we support it ๐Ÿ“).

the variables currently recognized are:

  • NETID_AUTHORITATIVE = TRUE|FALSE โ€” if you set this to TRUE, the NIS backend for the initgroups(3) function will accept the info from the netid.byname NIS map as authoritative. this can speed up the function significantly if the group.byname map is large. the content of the netid.byname map is used as is โ€” so the system administrator has to make sure it's correctly generated. you're on your own for that one, queen ๐Ÿ‘‘
  • SERVICES_AUTHORITATIVE = TRUE|FALSE โ€” if you set this to TRUE, the NIS backend for the getservbyname(3) and getservbyname_r(3) functions will assume that the services.byservicename NIS map exists and is authoritative โ€” particularly that it contains both keys with /proto and without /proto, for both primary service names and service aliases. again: the system administrator has to make sure it's correctly generated. no pressure or anything ๐ŸŽ€
  • SETENT_BATCH_READ = TRUE|FALSE โ€” if you set this to TRUE, the NIS backend for the setpwent(3) and setgrent(3) functions will read the entire database at once and then hand out the requests one by one from memory with every corresponding getpwent(3) or getgrent(3) call respectively. otherwise, every single getpwent(3) or getgrent(3) call might result in a network communication with the server just to get the next entry ๐Ÿ˜ฎโ€๐Ÿ’จ one at a time. over the network. yeah.

๐ŸŽ€ FILES ๐ŸŽ€

  • /etc/default/nss

โœจ EXAMPLES โœจ

the default configuration corresponds to the following configuration file:

NETID_AUTHORITATIVE=FALSE
SERVICES_AUTHORITATIVE=FALSE
SETENT_BATCH_READ=FALSE

like. all three off. the safest, most unbothered, minding-her-business config. we stan a conservative queen ๐Ÿงš


๐Ÿ‘‘ SEE ALSO ๐Ÿ‘‘


fr fr, if you're touching /etc/default/nss, remember: shortcuts are only safe when you know they're safe. the manpage said it, not me ๐Ÿซถ

and that's the whole thing, bestie! this was nss(5) from Linux man-pages 6.20, dated 2026-02-08. go forth and configure responsibly ๐Ÿ’–๐ŸŒˆโญ

๐Ÿ“ฆ where this page comes from
  • arch rolling: man-pages 6.20-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
  • nixpkgs unstable: man-pages 6.20
  • ๐Ÿ“œ the page's license: GPL-2.0-only
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms