![]() |
![]() |
| |||||||||||||
Chapter 4Administering DNS (Tasks)This chapter describes how to administer the Domain Name System (DNS). The chapter covers the following topics. Setting Up the resolv.conf FileA 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
The first line of the /etc/resolv.conf file lists the domain name in the form:
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:
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:
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.
There can be any combination of IPv4 and IPv6 addresses for name servers in the resolv.conf file. Configuring a Network For DNSTo configure a network for DNS, you must set up a client and a server.
|
; Sample resolv.conf file for the machine polaris domain doc.com ; try local name server nameserver 127.0.0.1 ; if local name server down, try these servers nameserver 2000::16:a:a00:20ff:de8a:643a nameserver 192.168.16.7 ; sort the addresses returned by gethostbyname(3c) sortlist 130.155.160.0/255.255.240.0 130.155.0.0 |
The first line of the /etc/resolv.conf file lists the domain name in the following 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 enter a hard carriage return immediately after the last character of the domain name.
The second line identifies the name server in the form
nameserver 127.0.0.1 |
The next lines list the IP addresses of up to three DNS master, slave, or cache-only name servers that the resolver should consult to resolve queries. Do not list more than three servers, master or slave. Name server entries have the following form.
nameserver IP_address |
IP_address is the IP address of a master or slave DNS name server. IP_address can be either an IPv4 or an IPv6 address. The resolver queries these name servers in order until the resolver obtains the information it needs.
The fifth line of the /etc/resolv.conf file lists the address sortlist in the form:
sortlist addresslist |
addresslist specifies the sort order of the addresses returned by gethostbyname(). In our example, gethostbyname returns the netmask pair 130.155.160.0/255.255.240.0 ahead of the IP address 130.155.0.0.
Modify the /etc/nsswitch.conf file.
NIS. If your master enterprise-level naming service is NIS, with proper configuration, NIS is already DNS-enabled.
Files-based. If your master enterprise-level naming service is based on /etc files, or if your master enterprise-level naming service is NIS+, do the following.
Open the /etc/nsswitch.conf file.
DNS can be the only source or an additional source for the hosts information. Locate the hosts line and use DNS as shown below.
hosts: files dns |
or
hosts: nis dns [NOTFOUND=return] files |
or
hosts: dns nis [NOTFOUND=return] files |
Do not use the above syntax for NIS clients, or else the clients will search for unresolved names twice in DNS.
Specify DNS as a source of hosts information.
Save the file and reboot.
Previous Contents Index Next ![]() |