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 {; };
 file "";

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.

Getting Started

Zone Data

BIND Name Server Configuration

Electronic Mail

BIND Name Server Operations

Delegation and Registration


Interoperability and Upgrading

Resolvers and Programming

Logging and Troubleshooting


DNS & BIND Cookbook
DNS & BIND Cookbook
ISBN: 0596004109
EAN: 2147483647
Year: 2005
Pages: 220
Authors: Cricket Liu © 2008-2020.
If you may any questions please contact us: