System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP)

Setting Up the resolv.conf File

A simple example resolv.conf file for a server in the doc.com domain is shown below.


Example 4–1 Sample resolv.conf File for DNS Server


;
; /etc/resolv.conf file for dnsmaster (sirius)
;
domain             doc.com
nameserver         192.168.0.0
nameserver         192.168.0.1

The first line of the /etc/resolv.conf file lists the domain name in the form:


domain domainname

Where domainname is the name that is registered with InterNIC.


Note –

No spaces or tabs are permitted at the end of the domain name. Make sure that you press return immediately after the last character of the domain name.


The second line identifies the server in the form:


nameserver 192.168.0.0

The next lines list the IP addresses of one or more slave or cache-only name servers that the resolver should consult to resolve queries. Name server entries have the form:


nameserver IP_address

IP_address is the IP address of a slave or cache-only DNS name server. The resolver queries these name servers in the order the servers are listed until the resolver obtains the information it needs.

With BIND 8.3.3, the DNS client can connect to IPv6 DNS servers using an IPv6 transport. To enable such a connection, enter an IPv6 address after nameserver in the resolv.conf file.

An example /etc/resolv.conf file with IPv6 name servers would look like the following.


domain			doc.com
nameserver			2000::100:a00:20ff:de8a:643a
nameserver			2000::55:a00:20ff:dec1:5ade
nameserver			192.168.0.1

There can be any combination of IPv4 and IPv6 addresses for name servers in the resolv.conf file.