Best way to handle multiple zones

Chris Buxton cbuxton at menandmice.com
Wed Sep 19 20:22:40 UTC 2007


No. This zone file is not for your main domain, and your name server  
and mail server hostnames should fall into your main domain. For  
example, here are some (very short) complete zone files, one for the  
main zone and the other for all other zones:

____________________________

; $ORIGIN maindomain.
@	SOA	a.ns hostmaster 2007091900 1h 5m 6w 1h
	NS	a.ns
	NS	b.ns
	MX	10  a.mx
	A	192.0.2.4
www	A	192.0.2.4
a.ns	A	192.0.2.1
b.ns	A	192.0.2.2
a.mx	A	192.0.2.3
____________________________

; share zone file, $ORIGIN value indeterminate from this point
@	SOA	a.ns.maindomain. hostmaster.maindomain. 2007091900 1h 5m 6w 1h
	NS	a.ns.maindomain.
	NS	b.ns.maindomain.
	MX	10  a.mx.maindomain.
	A	192.0.2.4
www	A	192.0.2.4
____________________________

Chris Buxton
Men & Mice

On Sep 19, 2007, at 11:29 AM, Ryan McCain wrote:

> One more thing..
>
> Wouldn't it look like this:
>
>> In shared.zone:
>> -----------------------------------
>> $TTL 1d
>> @	SOA	[... 7 data fields ...]
>> 	NS	a.ns
>> 	NS	b.ns
>> 	MX	10  a
>> host1	A	10.0.0.1
>> host2	A	10.0.0.2
>> -----------------------------------
>
> rather than
>
>> 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
>> -----------------------------------
>
> thanks...
>
>
>>>> On Mon, Aug 27, 2007 at  3:14 PM, in message
> <634EB382-69D9-4DAF-9173-BDFE6F911062 at menandmice.com>, Chris Buxton
> <cbuxton at menandmice.com> wrote:
>> 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