Best way to handle multiple zones

Chris Buxton cbuxton at menandmice.com
Mon Aug 27 20:14:07 UTC 2007


Either use the same zone file for all three zones, or put an $INCLUDE  
directive into each zone pointing to a common file.

Here is an example of using the first method, which requires that the  
three zones be completely identical other than zone name:

In named.conf (not the whole file):
-----------------------------------
zone "domain1.com" { type master; file "shared.zone"; };
zone "domain2.com" { type master; file "shared.zone"; };
zone "domain3.com" { type master; file "shared.zone"; };
-----------------------------------
In shared.zone:
-----------------------------------
$TTL 1d
@	SOA	[... 7 data fields ...]
	NS	a.ns.maindomain.
	NS	b.ns.maindomain.
	MX	10  a.mx.maindomain.
host1	A	10.0.0.1
host2	A	10.0.0.2
-----------------------------------

The key here is to not reference the domain name itself anywhere. "@"  
stands in for the zone name, as specified in each zone statement. All  
other domain names are carefully written unqualified unless they  
should not change between zones.

Whenever a change is made to the shared zone file, be sure to issue  
'rndc reload <domain>' for each of these domains, or else use 'rndc  
reload' without specifying a domain argument.

Chris Buxton
Men & Mice

On Aug 27, 2007, at 10:45 AM, Ryan McCain wrote:

> I have 3 zones that need to stay in sync.  For example  
> host1.domain1.com needs to be the same as host1.domain2.com and  
> host1.domain3.com.  What is the best way to handle this?
>
> I was thinking of writing a script to update the domain2 and  
> domain3 zone files when I update the domain1 zone file but figured  
> there has to be something in built into BIND that handles this as  
> I'm not the only one who does this.
>
> Thanks..
>
>
>
>
>



More information about the bind-users mailing list