nscd(8)

๐Ÿ’… nscd(8) โ€” name service cache daemon ๐ŸŽ€

okay so bestie, welcome to nscd(8) from the System Manager's Manual โ€” yes that's the whole manual section name, we're fancy like that โœจ


๐ŸŒธ NAME ๐ŸŒธ

nscd โ€” the name service cache daemon, aka your lookup bestie that remembers stuff so you don't have to ๐Ÿง ๐Ÿ’–


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

so like, the page doesn't actually give us a synopsis line, but nscd runs as a daemon and takes options โ€” run it and see, iykyk ๐Ÿ’…


โœจ DESCRIPTION โœจ

nscd is a daemon that provides a cache for the most common name service requests. literally its whole job. the default configuration file, /etc/nscd.conf, determines the behavior of the cache daemon โ€” go read nscd.conf(5) for the deets ๐Ÿซถ

nscd provides caching for accesses of the passwd(5), group(5), hosts(5), services(5) and netgroup databases through standard libc interfaces, such as getpwnam(3), getpwuid(3), getgrnam(3), getgrgid(3), gethostbyname(3), and others. the whole crew ๐Ÿ”ฅ

there are two caches for each database, and this part is important:

  • a positive one for items found โœ…
  • a negative one for items not found โŒ

each cache has a separate TTL (time-to-live) period for its data, so they expire on their own schedule, no cap โณ

okay so note this: the shadow file is specifically not cached. getspnam(3) calls remain uncached as a result. that's intentional, bestie โ€” your secrets stay un-looked-up ๐Ÿ’€๐Ÿ”

๐ŸŽ€ OPTIONS ๐ŸŽ€

  • --help โ€” will give you a list with all options and what they do. iconic, self-documenting queen ๐Ÿ‘‘

๐ŸŒˆ NOTES ๐ŸŒˆ

the daemon will try to watch for changes in configuration files appropriate for each database โ€” like /etc/passwd for the passwd database, or /etc/hosts and /etc/resolv.conf for the hosts database โ€” and flush the cache when these are changed. very main character behavior, she's paying attention ๐Ÿ‘€โœจ

but (and this is the catch) this will happen only after a short delay โ€” unless the inotify(7) mechanism is available and glibc 2.9 or later is available. so like, she's fast if she's got the tools, otherwise she's running a little late ๐Ÿ™ˆ

annnd this auto-detection does not cover configuration files required by nonstandard NSS modules, if any are specified in /etc/nsswitch.conf. so if you're doing custom NSS stuff, the auto-vibe-check just doesn't reach it ๐Ÿ˜ญ

in that case, you need to run the following command after changing the configuration file of the database so that nscd invalidates its cache:

$ nscd -i <database>
fr fr, do not skip this one โ€” otherwise your cache is out here serving stale info and you're gonna be so confused ๐Ÿ’€

๐Ÿ’œ SEE ALSO ๐Ÿ’œ


k that's the whole page, you ate that ๐Ÿ’…โœจ โ€” this iconic piece of documentation comes from Linux man-pages 6.18, dated 2026-02-08, and honestly? she slays. mwah ๐Ÿซถ๐ŸŽ€

๐Ÿ“ฆ where this page comes from