4.2) What is /etc/nsswitch.conf?

An idea whose time has come (it came to Ultrix a few years ago). You can control which of the "resolver" services are read from NIS (formerly YP), which from NIS+, which from the files in /etc, and which are from DNS (but only "hosts" can come from DNS).

A common example would be:

hosts: nis files

which means ask NIS for host info and, if it's not found, try the local machine's host table as a fallback.

Advice: if you're not using NIS or DNS, SunInstall probably put the right version in. If you are, ensure that hosts and passwd come from the network. However, many of the other services seldom if ever change. When was that last time you added a line in /etc/protocols? If your workstation has a local disk, it may be better to have programs on your machine look up these services locally, so use "files".

Terminology: Sun worried over the term "resolver", which technically means any "get info" routine (getpwent(3), gethostbyname(3), etc), but is also specifically attached to the DNS resolver. Therefore they used the term "source" to mean the things after the colon (files/DNS/NIS/NIS+) and "database" to mean the thing before the colon (passwd/group/hosts/services/netgroup etc).

A complete discussion can be found in nsswitch.conf(4).

PREV INDEX NEXT