Sample resolvconf File

Assume you're configuring a Linux workstation named ( that does not run its own name server. Listing 4.2 shows a reasonable resolv.conf file.

Listing 4.2: A Sample /etc/resolv.conf File

$ cat /etc/resolv.conf search nameserver nameserver

The configuration has two nameserver entries. The address of the first name server is It's on the same subnet as mute. The other name server ( is the main server for the domain. For efficiency's sake, send queries to the server on the local subnet. For backup purposes, send queries to the main domain server when the local server is down.

The search command tells the resolver to expand hostnames, first with the local subdomain and then with the parent of that domain This explicit list gives the workstation's users the behavior they have come to expect. In earlier versions of BIND, the default was to search the local domain and its parents. The default in BIND 8 and BIND 9 is to search only the default domain. This explicit search list emulates the old behavior.

The domain command and the search command are mutually exclusive. Whichever command appears last in the resolv.conf file is the one that defines the search list. To have more than one domain in the search list, use the search command. The default value derived from the hostname command, the value entered by the domain command, and the value assigned to the LOCALDOMAIN environment variable defines just one domain—the local domain. The local domain then becomes the only value in the search list. The search command is the preferred method for defining the search list.

Was this article helpful?

0 0

Post a comment