System Administration Guide: Naming and Directory Services (DNS, NIS, and LDAP)

How to Specify a Slave Server

A slave server maintains a copy of the data for the zone. The master server sends its data and delegates authority to the slave server. Clients can query a slave server for DNS information. By using slave servers, you can improve response time by spreading the load over multiple machines. Slave servers also provide backup when the master server crashes.

When in.named starts, the daemon requests all the data for the given zone from the master. The slave server then periodically checks with the master to see if the master needs to update its database. The process of sending the most recent zone database from the master to the slave is called a zone transfer. Therefore, you do not modify data files on a slave server. You modify the data files on the zone's master server. The slave servers then update their files from the master.

To specify that a server is to be the slave server for a given zone, you create slave records in that server's named.conf file. Separate records can designate the server as a slave server for the zone, the zone's reverse address domain, and the loopback host. A slave zone definition has a similar format as the master zone definition. The type is changed to slave and a line with the keyword masters along with the IP address(es) of the master server(s) is added.

For example, the following lines in a configuration file specify that the server is the slave server for the doc.sun.com zone and its reverse address domain. The lines also specify that the slave server obtains its authoritative data from the master server at 172.16.0.1 and initially loads its data from the file tmp.db.doc.sun.com:


zone "doc.sun.com"   in   {
       type slave;
       file "tmp.db.doc.sun.com";
       masters { 172.16.0.1; };
};

Note –

A server can act as the master server for one or more zones, and as the slave server for one or more zones. The mixture of entries in the configuration file determines whether a server is a master or slave server for a given zone.