Nsswitch.conf

From LQWiki
Jump to navigation Jump to search

nsswitch.conf is the name service switch configuration file, generally located in the /etc directory. Its purpose is to tell the system in what order it should consult various name services to resolve information about users, name resolution, and netgroups. This information can be provided by files on the filesystem (e.g. /etc/hosts containing IP address/host name pairs or /etc/passwd containing user data) or by a network name service such as DNS for host names or NIS or LDAP for account data.

An example nsswitch.conf entry is given here:

hosts: files dns

This tells the system to first look for information on hosts in the host file and if it is not found there to perform a DNS query.