AIX/HP-UX Interoperability Guide (continued)
[Last Chapter: 9. Configuring TCP/IP]
AIX suggests the following naming convention for named data files, though you can use whatever scheme suits you:
These files are usually found in the /etc directory.
Note: AIX provides sample configuration files in the /usr/lpp/tcpip/samples directory.
# touch /etc/resolv.conf
# 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.
# touch /etc/resolv.conf
You may want to enter records to specify the name, domain, and address of the name server.
# smit stnamed
# touch /etc/resolv.conf
You may want to enter records to specify the name, domain, and address of the name server.
# smit stnamed
This simply involves creating an /etc/resolv.conf file. The easiest way to create, delete, or modify this file is to type:
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:
See Setting Up a Remote Name Server in the HP-UX section for more information on /etc/resolv.conf.
If you are using DNS, the resolver attempts to find addresses in the following order:
If you are using network information service (NIS) for name resolution, the name resolution order is:
NOTE: If you are using NIS for name resolution, the local /etc/hosts file is not consulted.
Four types of standard data files specify the data for a domain: db.cache, db.127.0.0, db.[domain], and db.[net].
Naming the domain data files db.[name] is a Hewlett-Packard convention.
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.
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]
-d | specifies 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:
Refer to the hosts_to_named man page for a complete description of this command and available options.
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.
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.
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.
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:
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:
hostname indigo.div.inc.com
domain div.inc.com
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.
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.
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.
There are two ways to add or delete a host.
If you are using DNS, the resolver attempts to find addresses in the following order:
If you are using network information service (NIS) for name resolution, the name resolution order is:
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]
|
Provide feedback to: alan_roberts@hp.com