AIX/HP-UX Interoperability Guide (continued)
[Last Chapter: 9. Configuring TCP/IP]


10. Domain Name Service

10.1 AIX

named Data Files

AIX suggests the following naming convention for named data files, though you can use whatever scheme suits you:

  1. Names and internet addresses of the root name servers: named.ca
  2. Address resolution information for local loopback: named.domain_namelocal
  3. Address resolution data for all machines in the zone: named.domain_namedata
  4. Reverse address resolution information: named.domain_namerev

These files are usually found in the /etc directory.

Note: AIX provides sample configuration files in the /usr/lpp/tcpip/samples directory.

Configuring a Primary Name Server

  1. Edit the /etc/named.boot file, being sure to include the following:
  2. Edit the /etc/named.ca file to include the names and addresses of the root servers.
  3. Edit the /etc/named.domain_namelocal file. Include the following:
  4. Edit the /etc/named.domain_namedata file. Include the following:
  5. Edit the /etc/named.domain_namerev file. Include the following:
  6. Create an empty /etc/resolv.conf file by issuing the following command:

    # touch /etc/resolv.conf

  7. Enable the named daemon using the following SMIT fastpath:

    # smit stnamed You get the following:


    Start Using the named Subsystem

    Move cursor to desired item and press Enter.
    
      NOW
      Next System RESTART
      BOTH
    

If you choose BOTH, SMIT starts named and then edits /etc/rc.tcpip to get it to start up on each boot.

Configuring a Secondary Name Server

  1. Edit the /etc/named.boot file. This is the same as for a primary server except that you must include secondary lines for each of the domains for which the secondary server is responsible and a secondary line to define the reverse name resolution information. Also, you should include a primary line for the /etc/named.domain_namelocal file.
  2. Edit the /etc/named.ca file.
  3. Edit the /etc/named.local file.
  4. Create an /etc/resolv.conf file by issuing the following command:

    # touch /etc/resolv.conf

    You may want to enter records to specify the name, domain, and address of the name server.

  5. Enable the named daemon using the following SMIT fastpath:

    # smit stnamed

Configuring a Cache-Only Name Server

  1. Edit the /etc/named.boot file. Specify a name server type of primary with a source of /etc/named.local as well as the domain for which the name server will be responsible.
  2. Edit the /etc/named.ca file.
  3. Edit the /etc/named.local file.
  4. Create a /etc/resolv.conf file by issuing the following command:

    # touch /etc/resolv.conf

    You may want to enter records to specify the name, domain, and address of the name server.

  5. Enable the named daemon using the following SMIT fastpath:

    # smit stnamed

Setting Up a Remote Name Server

This simply involves creating an /etc/resolv.conf file. The easiest way to create, delete, or modify this file is to type:

# smit resolv.conf

You get the following:


Domain Nameserver (/etc/resolv.conf)

Move cursor to desired item and press Enter.

  Start Using the Nameserver
  List All Nameservers
  Add a Nameserver
  Remove a Nameserver
  Stop Using a Nameserver
  -------------------------------
  Set / Show the Domain
  Remove the Domain

To create a new /etc/resolv.conf file, either choose the Start Using the Nameserver option, and then the Create a New /etc/resolv.conf File option, or you can type the following at the command line:

# smit stnamerslv2

See Setting Up a Remote Name Server in the HP-UX section for more information on /etc/resolv.conf.

Name Resolution Order

If you are using DNS, the resolver attempts to find addresses in the following order:

  1. The name server
  2. The local /etc/hosts file

If you are using network information service (NIS) for name resolution, the name resolution order is:

  1. The name server
  2. NIS

NOTE: If you are using NIS for name resolution, the local /etc/hosts file is not consulted.

10.2 HP-UX

named Data Files

Four types of standard data files specify the data for a domain: db.cache, db.127.0.0, db.[domain], and db.[net].

  1. The names and internet addresses of the root name servers: db.cache.
  2. Address resolution information for local loopback: db.127.0.0
  3. The names and internet addresses of name servers for the zone directly below it: db.[domain]
  4. Reverse address resolution information: db.[net]

Naming the domain data files db.[name] is a Hewlett-Packard convention.

Configuring a Primary Name Server

The primary name server loads its data base from the master data files. The primary server also uses all of the standard files that contain domain data. To set up a primary server, run hosts_to_named or create the boot and data files manually.

Using hosts_to_named

hosts_to_named automatically converts host table entries to name server format and creates a primary boot file. It also creates the standard data files, db.cache, db.127.0.0, db.[domain], and db.[net]. However, it does not fill in the cache file, db.cache, with the root server names and addresses. You must do this manually.

Once the host table has been translated, the name server files can be maintained directly, or the translation can be repeated after each change to the host table. To run hosts_to_named, you need to know the name of the domain and the network numbers of networks in the domain. The syntax of hosts_to_named is as follows:

# hosts_to_named -d domain -n network-number [options]
-dspecifies the domain for which data is to be created.
-n specifies the network number for which data is to be created.

The following example creates name server data for networks 15.19.13 and 15.19.8 in the domain div.inc.com.

# hosts_to_named -d div.inc.com -n 15.19.13 -n 15.19.8

NOTE: For the name server to run, the boot file, named.boot, must be in the /etc directory. Because hosts_to_named places the files it creates in the directory you are in when you execute the command, you must do one of the following:

  1. Use the -b option of hosts_to_named to specify the boot file as /etc/named.boot, or
  2. Move named.boot to the /etc directory after running hosts_to_named elsewhere.

Refer to the hosts_to_named man page for a complete description of this command and available options.

Configuring a Secondary Name Server

A secondary server can use the same db.cache and db.127.0.0 files as the primary server, but requires a different named.boot file. The named.boot file lists the IP addresses of servers from which the secondary server gets its information. You can create the named.boot file by running hosts_to_named, or by creating the file manually.

Creating the Boot File with hosts_to_named

When used with the -Z and/or -z options, hosts_to_named uses the primary server's named.boot file to create two secondary boot files: boot.sec.save and boot.sec. With boot.sec.save, the server saves a backup copy of the information loaded over the network. With boot.sec, the server does not save a backup copy. The -Z and -z options are used to list the IP addresses of servers from which the secondary server gets its information.

To configure the secondary server, copy db.cache, db.127.0.0, and either boot.sec.save or boot.sec to the host that will run the secondary server. Then rename boot.sec.save or boot.sec to /etc/named.boot.

Configuring a Caching Only Name Server

No special line in the boot file is required to designate a server as caching only. Rather, caching only is indicated by the absence of primary or secondary lines in the boot file. The only primary line indicates the in-addr.arpa domain (the loopback interface), for which all name servers must be authoritative.

To create a caching only server, do not run hosts_to_named again. Instead, copy boot.cacheonly, db.127.0.0, and db.cache from the primary server. Rename boot.cacheonly to /etc/named.boot.

Setting Up a Remote Name Server

If you want the resolver routines to use a remote server instead of a local server, you need to create /etc/resolv.conf. This file designates which name servers on the network should be sent queries. If you are running a local server, creating this file is not advisable, as it is read every time gethostbyname or gethostbyaddr is called--though several applications (like HP VUE) do not work without /etc/resolv.conf when running a name server.

/etc/resolv.conf has three configuration options:

NOTE When the name server is unavailable, NIS or /etc/hosts is used for hostname and address resolution. However, certain remote server configurations may not detect that the remote name server host(s) is unavailable and thus will not use NIS or /etc/hosts for lookups. The following configurations may exhibit this behavior:

  1. The remote server host is down.
  2. More than one remote server is listed in /etc/resolv.conf and all the remote server hosts are unreachable.

Setting the Local Domain

When you use domain names that are not fully qualified, the resolver completes the names with the local domain. To do this, the resolver must know what the local domain is.

There are two ways in which you can set the local domain:

  1. Set the hostname of the local system (hostname) to be a domain name without a trailing dot. For example, you would set the hostname in /etc/rc for the machine indigo in the domain div.inc.rom as follows:

    hostname indigo.div.inc.com

  2. Create /etc/resolv.conf and add a domain or search entry. For example, create an /etc/resolv.conf file that contains the following line:

    domain div.inc.com

Starting the Primary Server

After you have created the primary name server's boot file and domain data files, you are ready to start the primary server and begin using the BIND name service. Before you start the name server, make sure syslogd is running.

To start the name server, type the following:

# /etc/named

If you enter /etc/named without any arguments, it reads the default boot file /etc/named.boot, reads any initial data, and listens for queries. If the name server boot file is in the /etc directory, the /etc/netbsdsrc file will automatically start the name server at boot time.

The procedure for starting other types of servers is the same as above. Refer to the named entry in the HP-UX Reference for information on additional options.

Maintaining Network and Domain Data Files

Once the name server is running, you may need to update network-related files to contain domain names. Flat or string-type hostnames which are not hosts in the local domain must be converted to domain names in the following files: all $HOME/.rhosts files, all $HOME/.netrc files, /etc/hosts, /etc/hosts.equiv, and /usr/adm/inetd.sec.

When you convert the flat names to domain names, you must be sure that the domain name contains every label from the host to the top-level domain. However, do not end the domain name with a dot. For example, in an .rhosts file, do not use:

indigo.div.inc.com. fred

Instead, use:

indigo.div.inc.com fred

A utility is available to convert the hostnames in .rhosts and hosts.equiv to fully qualified domain names automatically. The shell script convert_rhosts, found in /etc/newconfig/bind, accepts input conforming to the syntax in hosts.equiv and converts it to fully qualified domain names. Instructions for using this utility are in the comments at the beginning of the script itself.

Updating Domain Data Files

As the composition of your network changes, you may need to add or remove hosts.

NOTE: After modifying the domain data files, the name server must be restarted so that the files are reread. You can use either kill -1 process-id or sig_named restart for this purpose. Both signal the name server to reload its database. Refer to the sig_named entry in the HP-UX Reference.

Adding or Deleting a Host

There are two ways to add or delete a host.

  1. Add or delete the host to /etc/hosts and run hosts_to_named again.
  2. Add or delete the host manually.

Name Resolution Order

If you are using DNS, the resolver attempts to find addresses in the following order:

  1. The name server
  2. The local /etc/hosts file

If you are using network information service (NIS) for name resolution, the name resolution order is:

  1. The name server
  2. NIS
  3. The local /etc/hosts file

10.3 Summary

DNS is much the same on both AIX and HP-UX. The differences lie in the names and locations of named files:

AIX name and location HP-UX name and location
/etc/resolv.conf/etc/resolv.conf /etc/resolv.conf/etc/resolv.conf
/usr/sbin/namednamed /etc/namednamed
/usr/sbin/named-xfer /etc/named-xfer
/etc/named.boot /etc/named.boot
/etc/named.ca /etc/named.data/db.cache
/etc/named.local /etc/named.data/db.127.0.0
/etc/named.data /etc/named.data/db.[domain]
/etc/named.rev /etc/named.db.[net]


[Next Chapter: 11. NIS]


Provide feedback to: alan_roberts@hp.com

[Table of Contents] [Outline] [Index] (Updated 09 MAR 97)
Copyright 1996 Hewlett-Packard Company. All rights reserved.