ITEM: Y3394L

Setting Up a Primary DNS Server Fax


Primary name server setup

This document provides the instructions for the initial setup
of a primary nameserver and a client on any RISC System/6000 
running 3.2.  This procedure is simple, and has been thoroughly tested.
Before we begin, you should decide the following:

  1)  Determine the systems that will be in the domain
  2)  Determine the domain name (This name is not related to NIS)
  3)  Choose the primary nameserver (Any RISC System/6000)
  4)  The remaining systems will be clients       
  5)  Edit the /etc/hosts to contain all of the clients that you
      want in the domain for the nameserver.  It is very easy to
      add hosts to the nameserver later on, but it makes it easy
      to already have them in your /etc/hosts.

***************  PLEASE READ THIS CAREFULLY  *******************

NOTE:  This setup includes filenames and domain names that will
       be different for each setup.  In order to distinguish the     
       difference between names that you are free to choose, and     
       names that must be typed in exactly as they appear in this    
       document, I will use the following convention.  All names      
       in this file that appear in ALL CAPS are user-definable.       
       This means if the file name, or domain name is in ALL CAPS     
       than you are free to choose its name.  This setup does not     
       include any file names that you should type in ALL CAPS.       
       This naming convention is only being adopted to distinguish    
       the difference between exact names and user-definable names.   
                                                                 
       These are the names that are used in this example:             
            Hostname of nameserver:    NAMESERVER                      
            Hostname of client:        CLIENT                          
            Domain name:               YOUR.DOMAIN.NAME                
            IP address of nameserver:  IPADDRESS                       
            Name zone file:            FILE.DATA                       
   IP zone file:              FILE.REV                        
            Local ip zone file:        LOCAL.IP                        
                                                                       
       You are free to choose any of the names above that are in      
       ALL CAPS.  Your names should not be in ALL CAPS.               
                                                                      
*****************  PLEASE READ THIS CAREFULLY  *******************

If you have done the above, you are ready to begin the simple 
setup procedures for configuring a primary nameserver.  The
process consists of eight steps:

  1)  Create the "named" control file using your favorite editor.
      The file must be located in the /etc directory and has to
      be called /etc/named.boot so that the named daemon can read
      it when it starts.  This file will contain the location of
      of all the data that the daemon will use to create the initial
      nameserver database.  The following is an example of the file
      called /etc/named.boot:

        directory       /etc/nameserver

        domain          YOUR.DOMAIN.NAME        

        primary         YOUR.DOMAIN.NAME        FILE.DATA

        primary         in-addr.arpa            FILE.REV

        primary         0.0.127.in-addr.arpa    LOCAL.IP

      These are only five entries that need to be on the nameserver
      in the /etc/named.boot file.  After saving this file, use the
      make directory command to create the nameserver directory that
      will eventually contain the files FILE.DATA and FILE.REV.

        cd /etc
        mkdir nameserver

  2)  IBM's AIX 3.2 contains a very useful awk script that will 
      create the FILE.DATA for us, using the /etc/hosts file as input.
      If you have an /etc/hosts, you can do the following:

 cd /usr/lpp/tcpip/samples
        hosts.awk /etc/hosts > /etc/nameserver/FILE.DATA

      This will use the /etc/hosts as input, and run the hosts.awk
      script and redirect the output to your FILE.DATA.

  3)  IBM's AIX 3.2 contains another useful awk script that will
      create the file FILE.REV for us using the /etc/hosts file
      as input.  You can do the following:

        cd /usr/lpp/tcpip/samples
        addrs.awk /etc/hosts > /etc/nameserver/FILE.REV

      This will use the /etc/hosts as input, and run the addrs.awk
      script and redirect the output to your FILE.REV.

  4)  You now need to create the file that will resolve your
      local name on the nameserver.  Use your favorite editor
      to create the file /etc/nameserver/LOCAL.IP:
                  

        @       IN      NS      NAMESERVER.YOUR.DOMAIN.NAME.
        1       IN      PTR     localhost.YOUR.DOMAIN.NAME.

      These are the only two entries in this file.  The entries
      above require more explanation.  The first entry is the
      "at" sign (usually above the 2 key on the keyboard).  The
      next two entries to the right of the "at" sign must appear 
      exactly as they are typed. It is important that you include 
      the period at the end of both of these lines.  The first three 
      columns of the second line should also appear exactly as they 
      do above.

  5)  You now need to create a file that notifies the system that
      it is a nameserver.  This file is called /etc/resolv.conf
      and it must be empty.  You should do the following:

        rm /etc/resolv.conf
        touch /etc/resolv.conf

6)  Set the host name to your fully qualified name:

        smit mkhostname

      Set the hostname to NAMESERVER 

  7)  You are now ready to start the named daemon.  You can
      do the following:

        startsrc -s named

  8)  You can also uncomment the line in the /etc/rc.tcpip file
      that will start the named daemon every time the system
      reboots.  You can use your favorite editor to uncomment
      following line in /etc/rc.tcpip:

        start /etc/named "$src_running"

The setup for the primary nameserver is now complete.  You should
test the setup by attempting to resolve some of the names that 
were in your /etc/hosts.  You can do the following:

        host NAMESERVER
        host IPADDRESS

(You should substitute your actual ip address of the nameserver for IPADDRESS)

Each command should return the following:

        NAMESERVER.YOUR.DOMAIN.NAME is IPADDRESS

If both commands did not return the fully qualified name, that means
that it did not use the nameserver to resolve the name.  You
should double check the setup if you are having problems.

Note : if any changes are made to the various files set up for
Domain Name Services you should refresh the named to reflect 
those changes:  refresh -s named

It is also very easy to configure clients for this nameserver.
This is a three step process:

  1)  Create the /etc/resolv.conf using your favorite editor on the
      client.  This is what the file should look like on the client 
      for the above nameserver:

        domain          YOUR.DOMAIN.NAME
        nameserver      IPADDRESS

  2)  You should clean up your /etc/hosts on this client.  The only
      entries that need to be here are your local loopback.  All other
      name resolution will be done by the nameserver.

 

You can use the last three steps to setup other clients to the
nameserver, assuming that they were in the /etc/hosts when we
ran the awk scripts in steps 2 and 3 above.  

If you want to add other clients to the nameserver, that were not
in the /etc/hosts of the nameserver at the time of the configuration
of the nameserver files, just use your favorite editor to add similar 
entries in /etc/nameserver/FILE.DATA and in /etc/nameserver/FILE.REV.  
After adding these new names, you must refresh the named  on the 
nameserver to re-read these files:

 refresh -s named

You may need to stop and restart the named daemon if the changes
are not working:

        stopsrc -s named
        startsrc -s named


Support Line: Setting Up a Primary DNS Server Fax ITEM: Y3394L
Dated: August 1995 Category: N/A
This HTML file was generated 99/06/24~13:30:33
Comments or suggestions? Contact us