Configuring a Name Server for AIX Version 4.x and named Version 4


Contents

About this document
    Related documentation
How to create name server files and explanations of each
     Creating named.boot
     Creating named.data
     Creating named.rev.10.155 and named.rev.10.7.5
     Creating named.local
     Creating named.ca
Starting and testing the name server
Setting up clients
Making changes to hosts.awk for AIX 4.1.4


About this document

This document contains sample files and explains many of the lines found in each file. This document also explains how to run and test the name server, how to set up clients, and how to change the hosts.awk script.

This document applies to AIX Versions 4.x.

Related documentation

Additional information can be found in:


How to create name server files and explanations of each

Creating named.boot

The file /etc/named.boot is created manually, as described below. This file must be in /etc and must be called named.boot.

      primary           test.com                /u/dns/named.data
      primary           5.7.10.in-addr.arpa     /u/dns/named.rev.10.7.5
      primary           155.10.in-addr.arpa     /u/dns/named.rev.10.155
      primary           0.0.127.in-addr.arpa    /u/dns/named.local
      cache             .                       /u/dns/named.ca

Explanation of each line in named.boot

=====================================
primary           test.com                /u/dns/named.data

This line indicates that this is a primary name server for the domain called test.com. The file to be checked when the name server is queried for a host name ending with test.com is /u/dns/named.data.

A name server is consulted, or "queried," to resolve a host name much like the /etc/hosts file can be queried. For example, the commands:

$ host mars.test.com

or

$ host mars

will reference the file /u/dns/named.data to find the IP address for the host name mars.

NOTE: If the name server will be accessible on the Internet, make sure the domain name and IP addresses are not already in use by another organization. Before making the name server accessible on the Internet, register with the Department of Defense Network Information Center (NIC).

=====================================
primary           5.7.10.in-addr.arpa     /u/dns/named.rev.10.7.5

This line indicates that this name server is primary for the domain called 5.7.10.in-addr.arpa. In other terms, the name server is primary for all IP addresses beginning with 10.7.5.

Whenever in-addr.arpa is appended to an IP address, the numbers should be interpreted in reverse order. The file /u/dns/named.rev.10.7.5 will be checked when the name server is queried for an IP address beginning with 10.7.5. For example:

$ host 10.7.5.4

will reference the file /u/dns/named.rev.10.7.5 to find the host name assigned to IP address 10.7.5.4.

=====================================
primary           155.10.in-addr.arpa     /u/dns/named.rev.10.155

This line indicates that this name server is primary for the domain called 155.10.in-addr.arpa. In other terms, the name server is primary for all IP addresses beginning with 10.155. The file /u/dns/named.rev.155.10 will be checked when the name server is queried for an IP address beginning with 10.155. For example:

$ host 10.155.200.5

will reference the file /u/dns/named.rev.10.155 to find the host name assigned to IP address 10.155.200.5.

=====================================
primary           0.0.127.in-addr.arpa    /u/dns/named.local

This line is designed to handle the loopback address of 127.0.0.1. The file /u/dns/named.local will be checked when a query is received for 127.0.0.1 or any other IP address beginning with 127.0.0. The loopback address is needed on every system.

=====================================
cache             .                       /u/dns/named.ca

This line is used in the event that a query is received outside of any of the domains specified. In the example case, if a query is received by the name server for any host name that is not in the test.com domain, or for any IP address that does not begin with 10.155, 10.7.5, or 127.0.0, the named.ca file is essential so that the name server can contact other name servers for assistance.

If the domain does not have access to the Internet, the cache line does not need to be added to the named.boot file. For example, if a firewall restricts external traffic from accessing your network, do not use a cache line. Instead, a forwarders line can be used.

=====================================
forwarders	120.45.20.1

A forwarders line can be used to forward a query outside of any of the domains specified. In the example case, if a query is received by the name server for any host name that is not in the test.com domain, or for any IP address that does not begin with 10.155, 10.7.5, or 127.0.0, the forwarders line is necessary so that the query can be passed to another name server. For example, a request can be forwarded to the firewall, which may be acting as a name server that has a cache line, so that it can resolve queries for names on the Internet. More than one IP address can be listed here, separated by spaces.

=====================================
slave

This line may follow the forwarders line. It forces the name server that is referenced in the forwarders line to take responsibility in resolving the query. Without a slave line, the name server in this example would query each of the name servers listed in the forwarders line but those name servers would not forward their requests. So, in this example, at most two name servers would be queried.

Creating named.data

To generate a named.data file, provide an /etc/hosts file with entries for all hosts to be serviced by this DNS server in this domain. In this example, the /etc/hosts file is:

127.0.0.1       loopback localhost
10.7.5.1        venus
10.7.5.2        jupiter
10.7.5.3        mars    mailhost
10.7.5.4        neptune
10.155.39.5     pluto
10.155.200.5    mercury

The following command creates the named.data file:

    # mkdir /u/dns
    # /usr/samples/tcpip/hosts.awk /etc/hosts > /u/dns/named.data

The base level version of AIX 4.1.4 requires a correction to hosts.awk before running it. See the section "Making changes to hosts.awk for AIX 4.1.4" in this document.

The resulting file resembles the example below:

; nameserver data file
; (also see /etc/named.boot)
;
; NAME          TTL     CLASS   TYPE    RDATA
;
; setting default domain to "test.com"
;
@               9999999 IN      SOA     venus.test.com. 
root.venus.test.com. (
                                        1.1             ; Serial
                                        3600            ; Refresh
                                        300             ; Retry
                                        3600000         ; Expire
                                        86400 )         ; Minimum
                9999999 IN      NS      venus
                9999999 IN      MX  10  mailhost
venus           9999999 IN      A       10.7.5.1
jupiter         9999999 IN      A       10.7.5.2
mars            9999999 IN      A       10.7.5.3
mailhost        9999999 IN      CNAME   mars
neptune         9999999 IN      A       10.7.5.4
pluto           9999999 IN      A       10.155.39.5
mercury         9999999 IN      A       10.155.200.5

After this step, the named.data file generally requires no further changes. (Sometimes the script will not generate the full names in the start of authority (SOA) record. For example, the script might generate venus... If this happens, edit the line to include the domain as shown in the example.)

Explanation of named.data:

=====================================
;

A semicolon indicates that the line is commented out.

The first uncommented line for this file begins at the SOA record. Do not modify this for now. For an explanation of the SOA record, see your online documentation.

=====================================
9999999 IN      NS      venus

This line is a name server (NS) record that indicates that venus is a name server. 9999999 is the timeout value and IN indicates that it is an Internet record. They should be called this regardless of whether or not they actually connect to the Internet.

=====================================
9999999 IN      MX  10  mailhost

This line is a mail exchanger (MX) record. This line is not necessary and will not be created by the script. It is typically used when the name server is outside a firewall, or is queried by those outside your domain. When someone sends mail to user@test.com, this line indicates the mail is to be sent to mailhost for further processing. The file may have more than one MX record, and each may have different preferences (the higher the number, the lower the preference) and different machines to which they point.

The host names listed in the file are the "short" names. They do not have the domain name appended. This is because the domain name for this file is test.com and will be appended to each host name that is not followed by a "." (dot). In this case, none of the host names (pluto, mars, venus) are followed by a dot. They will be expanded to the fully qualified domain name. For example, the line:

jupiter                 9999999 IN      A       10.7.5.2

is equal to

jupiter.test.com.       9999999 IN      A       10.7.5.2

NOTE: IP addresses are not subject to expansion.

=====================================
neptune         9999999 IN      A       10.7.5.4

This line shows an address record or A record. The host neptune has the address 10.7.5.4. Each host in the domain has its own A record.

=====================================
mailhost        9999999 IN      CNAME   mars

Since mailhost is an alias for mars, a CNAME is used to signify this.

Creating named.rev.10.155 and named.rev.10.7.5

[an error occurred while processing this directive]