Sample resolvconf File

Assume you're configuring a Linux workstation named mute.swans.foobirds.org (172.16.12.3) 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 swans.foobirds.org foobirds.org nameserver 172.16.12.1 nameserver 172.16.5.1

The configuration has two nameserver entries. The address of the first name server is 172.16.12.1. It's on the same subnet as mute. The other name server (172.16.5.1) is the main server for the foobirds.org 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 swans.foobirds.org and then with the parent of that domain foobirds.org. 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