Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Installing and Administering Internet Services: HP 9000 Networking > Chapter 4 Configuring and Administering the BIND Name Service

Configuring a Primary Master Name Server

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

This section explains how to configure a primary master server in your domain. It also describes the name server data files in the primary master server configuration. It contains the following sections:

To Create the Data Files for a Primary Master Server

  1. Make sure the /etc/hosts file is up to date on the host that will be the primary master server.

  2. On the host that will be the primary master, create the /etc/named.data directory, where the name server data files will reside, and make it the current directory:

    mkdir /etc/named.data
    
    cd /etc/named.data

  3. Issue the following command to generate the name server data files from the /etc/hosts file:

    /usr/sbin/hosts_to_named -d domainname -n network_number

    Following is an example:

    /usr/sbin/hosts_to_named -d div.inc.com -n 15.19.8

  4. Move the named.boot file to the /etc directory:

    mv /etc/named.data/named.boot /etc/named.boot

  5. Copy the file /usr/examples/bind/db.cache.arpa to the /etc/named.data directory. This file is a list of root name servers. You can also use anonymous ftp to get the current list of root name servers from rs.internic.net. Instructions are included in the /usr/examples/bind/db.cache.arpa file.

  6. Use the list of root name servers from the /usr/examples/bind/db.cache.arpa file or from rs.internic.net to update the /etc/named.data/db.cache file. The hosts_to_named program creates this file but does not add any data to it. The format of the db.cache file is described in “The Primary Master Server's Cache File”.

    If your network is isolated from the Internet, contact the BIND administrator responsible for your domain to get the names and addresses of the root nameservers.

The hosts_to_named program creates the following data files in the directory from which it is run. These files are described in the next few sections.

  • named.boot

  • db.cache (initially empty)

  • db.127.0.0

  • db.domain (one file for each domain specified with the -d option)

  • db.net (one file for each network number specified with the -n option)

Naming these files db.name is a Hewlett-Packard convention.

You can also create these files manually using a text editor. If you choose to create them manually, you must convert all host names to fully qualified domain names (names containing all labels from the host to the root, terminated with a dot; for example, indigo.div.inc.com.)

The hosts_to_named program completely rewrites the db.domain and db.net files. All manual modifications to these files will be lost the next time you run hosts_to_named, except changes to SOA records.

For more information, type man 1M hosts_to_named or man 1M named at the HP-UX prompt.

To Set the Default Domain Name

If you will be using an /etc/resolv.conf file on your host, configure the default domain name with the search or domain keyword. See “Configuring the Resolver to Query a Remote Name Server”. If you will not be using an /etc/resolv.conf file, follow these steps:

  1. Set the default domain name with the hostname command, by appending the domain name to the host name, as in the following example:

    /usr/bin/hostname indigo.div.inc.com

    Do not put a trailing dot at the end of the domain name.

  2. Set the HOSTNAME variable in the /etc/rc.config.d/netconf file to the same value, as in the following example:

    HOSTNAME=indigo.div.inc.com

The Primary Master Server's Boot File

The boot file, /etc/named.boot, tells the primary master server the location of all the data files it needs. The primary name server loads its database from these data files. The hosts_to_named program creates the named.boot file.

Following is an example boot file for a primary server authoritative for the div.inc.com domain and for networks 15.19.8 and 15.19.13:


;

; type

;
domain
source file
directory  /etc/named.data ;running directory for named
primary
div.inc.com
db.div
primary
0.0.127.IN-ADDR.ARPA
db.127.0.0
primary
8.19.15.IN-ADDR.ARPA
db.15.19.8
primary
13.19.15.IN-ADDR.ARPA
db.15.19.13
cache

db.cache

Every name server must have data for the 0.0.127.IN-ADDR.ARPA domain. Hosts running Berkeley networking use 127.0.0.1 as the address of the loopback interface. Since the network number 127.0.0 is not assigned to any one site but is used by all hosts running Berkeley networking, each name server must be authoritative for network 127.0.0.

;

Lines beginning with semicolon (;) are comments.

directory

Indicates the directory where data files are located.

primary

Designates a primary server for the domain in the second field. The third field is the name of the file containing the data for that domain.

cache

Indicates the location of the cache file, which contains the addresses of network root name servers.

The Primary Master Server's Cache File

The cache file, /etc/named.data/db.cache, lists the servers for the root domain. Every name server must have a cache file. When a name server cannot resolve a host name query from its local database or its local cache, it queries a root server.

The hosts_to_named program creates the db.cache file, but it leaves it empty. To add data to this file, copy it from the file /usr/examples/bind/db.cache.arpa. You can also use anonymous ftp to get the list of root name servers from nic.ddn.mil. Instructions are included in the file /usr/examples/bind/db.cache.arpa.

Following is an example db.cache file for a primary master server:

;

; This file holds the information on root name servers needed

; to initialize cache of Internet domain name servers

;

;       last update:    May 11, 1994

;       related version of root zone:   940516

;

; name            ttl        class  type  data

;

.                 99999999   IN     NS    NS.INTERNIC.NET.

NS.INTERNIC.NET.  99999999          A     198.41.0.4

.                 99999999          NS    NS1.ISI.EDU.

NS1.ISI.EDU.      99999999          A     128.9.0.107

.                 99999999          NS    C.NYSER.NET.

C.NYSER.NET.      99999999          A     192.33.4.12

.                 99999999          NS    TERP.UMD.EDU.

TERP.UMD.EDU.     99999999          A     128.8.10.90

.                 99999999          NS    NS.NASA.GOV.

NS.NASA.GOV.      99999999          A     128.102.16.10

                  99999999          A     192.52.195.10

.                 99999999          NS    NS.NIC.DDN.MIL.

NS.NIC.DDN.MIL.   99999999          A     192.112.36.4

.                 99999999          NS    AOS.ARL.ARMY.MIL.

AOS.ARL.ARMY.MIL. 99999999          A     128.63.4.82

                  99999999          A     192.5.25.82

.                 99999999          NS    NIC.NORDU.NET.

NIC.NORDU.NET.    99999999          A     192.36.148.17

;

Lines beginning with semicolon (;) are comments.

name

In NS records, the name of the domain served by the name server listed in the data column. A period (.) in the name column represents the root domain (the root of the DNS name space hierarchy). In A records, the name column contains the name of the name server whose address appears in the data column.

ttl

The optional time-to-live (ttl) indicates how long, in seconds, a server may cache the data it receives in response to a query.

class

The optional class field specifies the protocol group. IN, for internet addresses, is the most common class. If left blank, the class defaults to the last class specified. So, all the entries in this example db.cache file are of class IN.

type

Type NS records list name servers. The first field in an NS record is the domain for which the name server has authority. The last field in an NS record is the fully qualified name of the name server.

Type A records list addresses. The first field in an A record is the name of the name server. The last field in an A record is the internet address of the name server.

data

The data field for an NS record gives the fully qualified name of a name server. The data field for an A record gives an internet address.

The db.127.0.0 File

Each name server must have an /etc/named.data/db.127.0.0 file. Hosts running Berkeley networking use 127.0.0.1 as the address of the loopback interface. Since the network number 127.0.0 is not assigned to any one site but is used by all hosts running Berkeley networking, each name server must be authoritative for network 127.0.0. The file db.127.0.0 contains the resource record that maps 127.0.0.1 to the name of the loopback address, usually localhost. The hosts_to_named program creates this file.

;name

class

type

data

@

IN

SOA

rabbit.div.inc.com. root.moon.div.inc.com.(

1

; Serial

10800

; Refresh every 3 hours

3600

; Retry every hour

604800

; Expire after a week

86400 )

; Minimum ttl of 1 day

@

IN

NS

rabbit.div.inc.com.

1

IN

PTR

localhost.

name

The name of the subdomain. In data files, @ represents the current origin. The current origin is the domain configured in this file, according to the boot file. The boot file says that the 0.0.127.in-addr.arpa domain is configured in the db.127.0.0 file. Therefore, every instance of @ in the db.127.0.0 file represents 0.0.127.in-addr.arpa.

The current origin is also appended to names that do not end with a dot. For example, the 1 in the PTR line would be interpreted as 1.0.0.127.in-addr.arpa.

class

The optional class field specifies the protocol group. IN, for internet addresses, is the most common class.

type

The SOA (start-of-authority) record designates the start of a domain, and indicates that this server is authoritative for the data in the domain.

The NS record designates a name server for the current origin (0.0.127.in-addr.arpa).

PTR records are usually used to associate an address in the in-addr.arpa domain with the canonical name of a host. The PTR record in the example db.127.0.0 file associates the name localhost with the address 1.0.0.127.in-addr.arpa. (The current origin is appended to the 1 in the name field, because it does not end with a dot.)

data

The SOA data includes the name of the host this data file was created on, the mailing address of the person responsible for the name server, and the following values:

Serial

The version number of this file, incremented whenever the data is changed.

Refresh

Indicates (in seconds) how often a secondary name server should try to update its data from a master server.

Retry

Indicates (in seconds) how often a secondary server should retry after an attempted refresh fails.

Expire

Indicates (in seconds) how long the secondary name server can use the data before it expires for lack of a refresh.

Minimum ttl

The minimum number of seconds for the time to live field on other resource records for this domain.

The NS data is the fully qualified name of the name server.

The PTR data is the loopback address of localhost, in the in-addr.arpa domain.

The Primary Master Server's db.domain Files

A primary server has one /etc/named.data/db.domain file for each domain for which it is authoritative. domain is the first part of the domain specified with the -d option in the hosts_to_named command. This file should contain an A (address) record for every host in the zone.

The example file shown below, db.div, contains the following types of records:

SOA

Start of Address record. The SOA record designates the start of a domain, and indicates that this server is authoritative for the data in the domain.

In data files, @ represents the current origin. The current origin is the domain configured in this file, according to the boot file. The boot file says that the div.inc.com domain is configured in the db.div file. Therefore, every instance of @ in the db.div file represents div.inc.com.

The SOA record indicates the name of the host this data file was created on, the mailing address of the person responsible for the name server, and the following values:

Serial

The version number of this file, incremented whenever the data is changed.

Refresh

Indicates (in seconds) how often a secondary name server should try to update its data from a master server.

Retry

Indicates (in seconds) how often a secondary server should retry after an attempted refresh fails.

Expire

Indicates (in seconds) how long the secondary name server can use the data before it expires for lack of a refresh.

Minimum ttl

The minimum number of seconds for the time to live field on other resource records for this domain.

NS

Name Server records. The NS records give the names of the name servers and the domains for which they have authority. The domain for the name servers in the example is the current origin (div.inc.com), because @ was the last domain specified.

A

Address records. The A records give the internet addresses for all the hosts in the domain.

The current origin is appended to names that do not end with a dot. For example, localhost in the first A record is interpreted as localhost.div.inc.com.

HINFO

Host Information records. The HINFO records indicate the hardware and operating system of the host.

CNAME

Canonical Name record. The CNAME record specifies an alias for a canonical name (the host's official name). If an alias name is looked up, it is replaced with the canonical name and data for the canonical name is looked up. All other resource records should use the canonical name instead of the alias.

WKS

Well Known Service records. The WKS record lists the services supported by a host. The list of services comes from the host's /etc/services file. There should be only one WKS record per protocol per address.

MX

Mail Exchanger records. MX records specify a weighted list of hosts to try when mailing to a destination on the Internet. The MX data indicates an alternate host or list of hosts that accept mail for the target host if the target host is down or inaccessible. The preference field specifies the order a mailer should follow if there is more than one mail exchanger for a given host. A low preference value indicates a higher precedence for the mail exchanger.

In the example below, mail for rabbit should go first to rabbit.div.inc.com. If rabbit is down, its mail should be sent to indigo.div.inc.com.

See Chapter 5 “Installing and Administering sendmail” for information on sendmail and how it uses the name server's MX records for mail routing.


;

; db.div

;

@

IN

SOA

rabbit.div.inc.com. root.moon.div.inc.com.(

1

; Serial

10800

; Refresh every 3 hours

3600

; Retry every hour

604800

; Expire after a week

86400 )

; Minimum ttl of 1 day

IN

NS

rabbit.div.inc.com

IN

NS

indigo.div.inc.com.

localhost

IN

A

127.0.0.1

indigo

IN

A

15.19.8.197

IN

A

15.19.13.197

IN

HINFO

HP9000/840 HPUX

incindigo

IN

CNAME

indigo

cheetah

IN

A

15.19.8.64

IN

HINFO

HP9000/850 HPUX

IN

WKS

15.19.8.64

UDP syslog domain route

IN

WKS

15.19.8.64

TCP (telnet smtp ftp shell domain)

rabbit

IN

MX

5 rabbit.div.inc.com.

IN

MX

10 indigo.div.inc.com.

rabbit

IN

A

15.19.8.119

The Primary Master Server's db.net Files

A primary server has one db.net file for each network it serves. net is the network number specified with the -n option in the hosts_to_named command. This file should contain a PTR (pointer) record for every host in the zone. A PTR record allows BIND to translate an IP address back into its host name. BIND resolves the address of a name by tracing down the domain tree and contacting a server for each label of the name.

The in-addr.arpa domain was created to allow this inverse mapping. The in-addr.arpa domain is preceded by four labels corresponding to the four bytes (octets) of an internet address. Each byte must be specified even if it is zero. For example, the address 143.22.0.3 has the domain name 3.0.22.143.in-addr.arpa. Note that the four octets of the address are reversed.

;

;  db.15.19.8

;

@

IN

SOA

rabbit.div.inc.com. root.moon.div.inc.com.(

1

; Serial

10800

; Refresh every 3 hours

3600

; Retry every hour

604800

; Expire after a week

86400 )

; Minimum ttl of 1 day

IN

NS

rabbit.div.inc.com.

IN

NS

indigo.div.inc.com.

119

IN

PTR

rabbit.div.inc.com.

64

IN

PTR

cheetah.div.inc.com.

197

IN

PTR

indigo.div.inc.com.

This example file, db.15.19.8, contains the following records:

SOA

Start of Address record. The SOA record designates the start of a domain, and indicates that this server is authoritative for the data in the domain.

In data files, @ represents the current origin. The current origin is the domain configured in this file, according to the boot file. The boot file says that the 8.19.15.in-addr.arpa domain is configured in the db.15.19.8 file. Therefore, every instance of @ in the db.15.19.8 file represents 8.19.15.in-addr.arpa.

The SOA record indicates the name of the host this data file was created on, the mailing address of the person responsible for the name server, and the following values:

Serial

The version number of this file, incremented whenever the data is changed.

Refresh

Indicates (in seconds) how often a secondary name server should try to update its data from a master server.

Retry

Indicates (in seconds) how often a secondary server should retry after an attempted refresh fails.

Expire

Indicates (in seconds) how long the secondary name server can use the data before it expires for lack of a refresh.

Minimum ttl

The minimum number of seconds for the time to live field on other resource records for this domain.

NS

Name Server records. The NS records give the names of the name servers and the domains for which they have authority. The domain for the name servers in the example is the current origin (8.19.15.in-addr.arpa), because @ was the last domain specified.

PTR

Pointer records. PTR records are usually used to associate an address in the in-addr.arpa domain with the canonical name of a host. The first PTR record in the example file associates the name rabbit.div.inc.com with the address 119.8.19.15.in-addr.arpa. (The current origin is appended to the 119 in the first field, because it does not end with a dot.)

To Add a Host to the Domain Data Files

  1. Add the host to /etc/hosts and run hosts_to_named again.

    or

    Add the host manually, as follows:

    1. Edit db.domain. Add an Address (A) resource record for each address of the new host. Add CNAME, HINFO, WKS, and MX resource records as necessary. Increment the serial number in the SOA resource record.

    2. Edit db.net. Add a PTR resource record for each host address. Increment the serial number in the SOA resource record.

    3. Add the host to the /etc/hosts file. If the host is not listed in /etc/hosts, someone might run hosts_to_named, which overwrites your db.domain and db.net files, and the host will be lost.

    Examples of these records are shown in “The Primary Master Server's db.domain Files” and “The Primary Master Server's db.net Files”.

  2. After modifying the domain data files, issue the following command to restart the name server and force it to reload its databases:

    /usr/sbin/sig_named restart

To Delete a Host from the Domain Data Files

  1. Delete the host from /etc/hosts and run hosts_to_named again.

    or

    Delete the host manually, as follows:

    1. Edit db.[domain]. Delete all A, CNAME, HINFO, WKS, and MX resource records associated with the host. Increment the serial number in the SOA resource record.

    2. Edit db.[net]. Delete all PTR resource records for the host. Increment the serial number in the SOA resource record.

  2. After modifying the domain data files, issue the following command to restart the name server and force it to reload its databases:

    /usr/sbin/sig_named restart

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1996 Hewlett-Packard Development Company, L.P.