• No results found

Creating the Slave Server’s Data Files Manually

• “Setting the Default Domain Name” (page 79)

Creating Slave Server Data Files Using hosts_to_named

This section discusses the steps involved in creating the slave server configuration files using the hosts_to_named command.

1. If you want your slave server to store its data in backup files on its disk, run the hosts_to_namedcommand on the slave server as follows:

/usr/sbin/hosts_to_named -z primary_server’s_IP_address

If you want your slave server to always load its data from the master server, run hosts_to_namedon the slave server as follows:

/usr/sbin/hosts_to_named -Z primary_server’s_IP_address

2. If you run hosts_to_named with the -z option, copy the file conf.sec.save from the current directory on the master server to the /etc directory on the slave server.

If you run hosts_to_named with the -Z option, copy the file conf.sec from the current directory on the master server to the /etc directory on the slave server.

3. On the slave server, rename /etc/conf.sec.save or /etc/conf.sec to

/etc/named.conf.

4. Copy the files /etc/named.data/db.cache and /etc/named.data/db.127.0.0 from

the master server to the slave server.

The format of the data files copied from the master server is described in“Configuring a Master Name Server” (page 67).

An example named.conf configuration file for a slave server is shown in“Creating the Slave Server’s Data Files Manually” (page 77).

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

Creating the Slave Server’s Data Files Manually

1. Copy the files /etc/named.conf, /etc/named.data/db.cache, and /etc/named.data/db.127.0.0from the master server to the slave server.

2. On the slave server, make the following changes to the configuration file /etc/named.conf, using a text editor:

• For every entry in the /etc/named.conf file containing the word primary, except the entry containing db.127.0.0, replace the word primary with the word

secondary.

• In every entry containing the word secondary, add the Internet address of the master server after the domain name.

• If you do not want the slave server to store backup files on disk, delete the last field of every secondary line (the field that specifies the file name).

Following are the example /etc/named.conf configuration files for a slave server. Example 1

The following example is a named.conf configuration file for a slave server that does not store the database information in a local file.

// generated by named-bootconf.pl options {

check-names response fail; //do not change this check-names slave warn;

directory “/etc/named.data”; //running directory for named /*

* If there is a firewall between you and nameservers you want * to talk to, you might need to uncomment the query-source * directive below. Previous versions of BIND always asked * questions using port 53, but BIND 8.1 uses an

* unprivileged port by default */

// query-source address * port 53; };

//

// type domain source file // zone “0.0.127.IN.ADDR.ARPA” { type master; file “db.127.0.0”; }; zone “div.inc.com”; { type slave; masters { 15.19.8.119; }; }; zone “8.19.15.IN-ADDR.ARPA” { type slave; masters { 15.19.8.119; }; }; zone “.” { type hint; file “db.cache”; }; Example 2

The following example is a named.conf configuration file for a slave server that stores the database information in a local file.

// generated by named-bootconf.pl options {

check-names response fail; //do not change this check-names slave warn;

directory “/etc/named.data”; //running directory for named /*

* If there is a firewall between you and nameservers you want * to talk to, you might need to uncomment the query-source * questions using port 53, but BIND 8.1 uses an

* unprivileged port by default. */

// query-source address * port 53; };

//

// type domain source file // zone “0.0.127.IN.ADDR.ARPA” { type master; file “db.127.0.0”; }; zone “div.inc.com”; { type slave; file “db.div”; masters { 15.19.8.119; }; }; zone “8.19.15.IN-ADDR.ARPA” { type slave; file “db.15.19.8”; masters { 15.19.8.119; }; }; zone “.” { type hint; file “db.cache”; };

In this example, the slave server uses the file db.div to store the database information. The slave server uses this file as a backup file. When the slave server reboots, it reads the authoritative data from the backup file, and later contacts the master server to verify the data. If the master server contains new data, the slave server saves this new data in the backup file.

The format of the data files copied from the master server is described in“Configuring a Master Name Server” (page 67).

Setting the Default Domain Name

You can initialize the default domain name either by specifying the domain name in the

/etc/resolv.conffile or by specifying the host name using the hostname command in the

/etc/rc.config.d/netconffile.

If you use 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” (page 81).

If you do not use an /etc/resolv.conf file to configure the default domain name, follow these steps:

1. Set the default domain name with the hostname command by appending the domain name to the host name. For example, type the following at the HP-UX prompt to set the default host name to indigo.div.inc.com:

/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

Your default domain is now set.

Related documents