10.4.1 The resolver
The job of finding out what IP addresses are associated with a particular
domain name is the job of a resolver. The most commonly used resolver is the
set of functions that go by that name (
resolver(3)) in the GNU C
Library. Another is the FireDNS resolver which comes in the
libfiredns package. There are others.
How the GNU LIBC resolver resolves names is governed by the hosts
line in the
/etc/nsswitch.conf configuration file. This line
lists the services that should be used to resolve a name: e.g.,
dns, files, nis, nisplus.
nsswitch.conf(5). Insofar as the files service
is used, the behavior of the resolver is also governed by the
/etc/hosts configuration file. See
All of the above files are static and can be edited with your favorite editor.
Insofar as the dns service is used, the behavior of the resolver
is also governed by the
/etc/resolv.conf configuration file. See
resolv.conf(5). One of the important functions of
resolv.conf is to list the IP addresses of nameservers that will
be contacted to resolve the name. This list often has to depend upon the
network environment and the network environment may change from time to time
while your computer is running. Programs such as
dhclient are able to manipulate
resolv.conf to add
and remove lines, but these features do not always work properly and they
conflict with one another. The
resolvconf package solves the
problem better by providing a standard framework for updating this file. See
Managing nameserver information –
resolvconf, Section 10.4.2.