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

Setting up DNS Servers

How to Initialize the Server

To initialize a server, do the following.

  1. Become superuser.

  2. Install the named.conf configuration file and the required data files, as described in the previous sections.

  3. Run in.named.

    #/usr/sbin/in.named

    Instead of running in.named from the command line, you can reboot.

How to Test Your Installation

After your boot and data files are set up and in.named running, test your installation.

  1. Become superuser.

  2. Check your syslog file for error messages.

    See Chapter 6, DNS Troubleshooting (Reference) for common DNS error messages and troubleshooting information.

  3. Look up a host name in the local domain using the nslookup command.


    dnsmaster% nslookup altair
     Server:  dnsmaster.doc.com
     Address: 192.146.168.5
     Name:  altair.doc.com
     Address: 192.146.168.10
    • If your lookup is successful, your name server is probably functioning correctly.

    • If you get a Can't find, can't initialize address, or a non-existent domain type message, your server might not be listed correctly in the boot file or hosts files.

    • If you get a can't find name non-existent domain message, the host might not be in the server's hosts file. The error message could also mean that the domain is incorrectly set in resolv.conf. Additionally, the error message might indicate a general server problem.

  4. Look up a remote domain name with nslookup.

    If your network is connected to the Internet, look up the name of a remote domain. If your network is not connected to the Internet, look up the name of a subdomain in another zone, if you have another zone.

    For example, to look up the name of the remote internic.net Internet domain, you would enter the following.


    dnsmaster% nslookup internic.net
    Server:  dnsmaster.doc.com  
    Address: 192.168.168.  
    Name:  internic.net 
     Addresses: 192.168.0.9,  192.168.0.6,  192.168.0.5,  192.168.0.8
    • If you are successful, your name server is probably functioning correctly.

    • If the remote domain name is not found, check your network connection.

    • Another possible cause is that your named.ca file is not properly installed or set up.

    The second time you that use nslookup to find a domain, the answer gets returned as non-authoritative. The answer is now coming from your cache, not the remote name server.

  5. Look up a host name in your domain from a remote domain.

    If your network is connected to the Internet, look up the name of a host in your domain from a remote domain. If your network is not connected to the Internet, look up the name of a host in your domain from another zone.

    For example, to look up the name of a host in your domain from a remote Internet domain, enter two arguments after the nslookup command. The first argument is the host name. The second argument is the name of the name server that you are testing.


    remotemachine9% nslookup altair remotemaster.foo.org.
    Server:  remotemaster.foo.org
     Address: 192.168.0.1
     Name:  altair.doc.com
     Addresses: 192.168.1.2 
    • If you are successful, your name server is probably functioning correctly.

    • If the above command does not find the machine that you are searching for, your domain might not be registered properly.

How to Add Additional Servers

You can add primary and secondary DNS servers to your network.

  1. Become superuser.

  2. Set up the server as a DNS client. See How to Add a Client.

  3. Set up the following files.

    • boot file
    • named.ca
    • hosts
    • hosts.rev
    • named.local

    See Setting up DNS Servers for details.