Configuring a Name Server as a Slave for a Zone
1.17.1 Problem
You want to configure a name server to be a slave for a zone.
1.17.2 Solution
Add the appropriate zone statement to the name server's named.conf file.
The zone statement specifies the domain name of the zone, the IP address of the master name server, the name of the backup zone data file, and that this name server is a slave for the zone (with type slave):
zone "foo.example" { type slave; masters { 192.168.0.1; }; file "bak.foo.example"; };
1.17.3 Discussion
When configuring a slave zone, there's no need to create the backup zone data file: The name server will write the backup zone data file after it has transferred the zone from the master name server you designated. The slave name server will transfer the zone each time its check of its master shows that the master's copy of the zone has a higher serial number than the slave's copy.
The master name server doesn't need to be the zone's primary master. A slave can just as easily transfer a zone from another of the zone's slaves, as long as that slave gets its zone data from the primary master -- directly or indirectly. You can even specify that a slave use multiple master name servers: just list their IP addresses in the masters substatement in the order in which you want the slave to use them.
It's a good idea to distinguish backup zone data files from zone data files for primary master zones; I use the prefix "bak" instead of "db" for backup zone data files. This cue makes it less likely that I'll try to make changes to a backup (and hence read-only) copy of a zone's data.
Note that this example shows the most basic zone configuration: I didn't use any zone-specific options, such as an access list for transfers of this zone.
1.17.4 See Also
"Running a Slave Name Server" in Chapter 4 of DNS and BIND.