Chapter 6. Name Service and Resolver Configuration

Table of Contents
6.1. The Resolver Library
6.1.1. The host.conf File
6.1.2. The nsswitch.conf File
6.1.3. Configuring Name Server Lookups Using resolv.conf
6.1.4. Resolver Robustness
6.2. How DNS Works
6.2.1. Name Lookups with DNS
6.2.2. Types of Name Servers
6.2.3. The DNS Database
6.2.4. Reverse Lookups
6.3. Running named
6.3.1. The named.boot File
6.3.2. The BIND 8 host.conf File
6.3.3. The DNS Database Files
6.3.4. Caching-only named Configuration
6.3.5. Writing the Master Files
6.3.6. Verifying the Name Server Setup
6.3.7. Other Useful Tools

As we discussed in Chapter 2, TCP/IP networking may rely on different schemes to convert names into addresses. The simplest way is a host table stored in /etc/hosts. This is useful only for small LANs that are run by one single administrator and otherwise have no IP traffic with the outside world. The format of the hosts file has already been described in Chapter 5.

Alternatively, you can use the Berkeley Internet Name Domain service (BIND) for resolving hostnames to IP addresses. Configuring BIND can be a real chore, but once you've done it, you can easily make changes in the network topology. On Linux, as on many other Unixish systems, name service is provided through a program called named. At startup, it loads a set of master files into its internal cache and waits for queries from remote or local user processes. There are different ways to set up BIND, and not all require you to run a name server on every host.

This chapter can do little more than give a rough sketch of how DNS works and how to operate a name server. It should be sufficient if you have a small LAN and an Internet uplink. For the most current information, you may want to check the documentation contained in the BIND source package, which supplies manual pages, release notes, and the BIND Operator's Guide (BOG). Don't let this name scare you off; it's actually a very useful document. For a more comprehensive coverage of DNS and associated issues, you may find DNS and BIND by Paul Albitz and Cricket Liu (O'Reilly) a useful reference. DNS questions may be answered in a newsgroup called For technical details, the Domain Name System is defined by RFC numbers 1033, 1034, and 1035.