/etc/nsswitch.conf file in Linux

Back

The /etc/nsswitch.conf includes database search entries for everything from authentication to name services. As the name server switch file, includes the following entry, which determine what database is searched first.

hosts : files dns

When a system gets a request to search for a host-name such as outsider1.example.com, the preceding directive means the /etc/hosts file is searched first. If that name is not found in /etc/hosts, the next step is to search available configured DNS servers, normally using that configured in the /etc/resolv.conf file.

A few older software components use the /etc/host.conf file for this purpose. The entries in this file are simple, as they support searches of multiple entries in /etc/hosts, along with a search starting with that file, followed by a DNS server configured with the Berkeley Internet Name Domain (BIND) software.

multi on
order hosts,bind