Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
  Previous   Contents   Next 
   
 
Chapter 4

Administering DNS (Tasks)

This chapter describes how to administer the Domain Name System (DNS).

The chapter covers the following topics.

Setting Up the resolv.conf File

A simple example resolv.conf(4) 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 registered with the Internet governing bodies (as of this writing, the 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 itself in the form:

nameserver 192.168.0.0

Succeeding lines list the IP addresses of one or two 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 they are listed until it obtains the information it needs.

Configuring a Network For DNS

To configure a network for DNS, you must set up a client and a server.

Setting Up a DNS Client

Set up the client(s) prior to setting up the DNS server.

How to Set up a DNS Client

  1. Create the /etc/resolv.conf file.

    A simple example resolv.conf file for a client (non-server) machine in the doc.com domain is shown below.


    Example 4-2 Sample resolv.conf File

    ; Sample resolv.conf file for the machine polaris
    domain doc.com
    ; try local name server
    nameserver 10.0.0.1
    ; if local name server down, try these servers
    nameserver 192.168.16.6
    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 registered with the Internet governing bodies (as of this writing, the 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 loopback name server in the form.

    nameserver 10.0.0.1

    Succeeding 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 master or slave servers. Name server entries have the following form.

    nameserver IP_address

    IP_address is the IP address of a master or slave DNS name server. The resolver queries these name servers in the order they are listed until it 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(3c). 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.

  2. 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.

    1. Become superuser.

    2. Open the /etc/nsswitch.conf file.

    3. DNS can be the only source or an additional source for the hosts information. Locate the hosts line and use DNS in one of the ways 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 they will be forced to search for unresolved names twice in DNS.

    4. Specify DNS as a source of hosts information.

    5. Save the file and reboot.

 
 
 
  Previous   Contents   Next