Redundant data in zone file.

Bill Larson wllarso at swcp.com
Tue Nov 16 21:33:19 UTC 2004


On Nov 16, 2004, at 11:31 AM, SilentRage wrote:

> With similar domains that share dns records, I certainly do specify 
> multiple zone {} blocks in named.conf that refer to the same file.  
> You just have to be careful to never explicitly indicate any one of 
> the domains that use that file.  Use nothing but relative hosts and 
> '@' to refer to the zone name.  Sure makes updating all three zones 
> much easier.

Although this is good advice, it isn't exactly correct either.  Some 
DNS information, such as the target of an MX record, the SOA record, 
and the NS records may need (maybe "should") be fully qualified.  For 
example, as a generic zone file for multiple zones where "domain1.com" 
is your "primary" domain name, you could have:

	$TTL 86400
	@	IN	SOA	ns1.domain1.com. hostmaster.domain1.com. (
					1;	Serial
					28800;	Refresh
					14400;	Retry
					3600000;	Expire
					86400 );	MinTTL

	; delegated DNS servers for zone
		IN	NS	ns1.domain1.com.
		IN	NS	ns2.domain1.com.

	; Mail Exchanger info for zone
		IN	MX	10 mail.domain1.com.

	; Host information
	ns1	IN	A	1.2.3.4
	ns2	IN	A	1.2.3.5

	; Web server for domain	
	www	IN	A	1.2.3.10

For zones "domain1.com", "domain2.com", and "domain3.com", you would 
end up with the following "A" record information defined:

	ns1.domain1.com	IN	A	1.2.3.4
	ns1.domain2.com	IN	A	1.2.3.4
	ns1.domain3.com	IN	A	1.2.3.4
	ns2.domain1.com	IN	A	1.2.3.5
	ns2.domain2.com	IN	A	1.2.3.5
	ns2.domain3.com	IN	A	1.2.3.5

So, each zone would have an "ns1" and an "ns2" host identified, and 
they would all point to the IP addresses of the DNS servers, but the 
actual name servers for each of the zones would actually be 
"ns1.domain1.com" and "ns2.domain1.com" as defined by your "NS" 
records.  Don't confuse the "ns*" name with the identification of the 
delegated server.

More telling would be the "A" record for the "www" host.  These fully 
qualified domain names would be:

	www.domain1.com	IN	A	1.2.3.10
	www.domain2.com	IN	A	1.2.3.10
	www.domain3.com	IN	A	1.2.3.10

So, accessing "http://www.domain*.com" would always get you to the same 
server by IP address.  Now, by setting up virtual domains on the web 
server, you could have each of these names return different 
information.  At a minimum, the URL information returned could be 
specific to the web site address given.  I.e., "www.domain1.com" would 
return that you are accessing domain1, and "www.domain2.com" would be 
for "domain2".  If you do NOT configure this virtual domain info for 
your web server, then everything would report back to the user as if it 
were for "domain1".  (The same thing would also occur if you got to the 
web server by it's IP address, no name in the URL.  The returned 
information goes back to the user as if it were for the "primary" 
domain that the server is set up for.)

So, you can, and should, have a mixture of fully qualified domain 
information and partially qualified domain information in your zone 
file when you are creating a common zone file for multiple domains.

Bill Larson

> Dave
>
> --- Reply to: bob prohaska <bp at fib.eecs.berkeley.edu> ---
>>
>> Is there any harm in having redundant information in zone files?
>>
>> For example, I've registered three domains:
>> zefox.com
>> zefox.net
>> zefox.org
>>
>> They must share 5 ip addresses: one for each nameserver in .net
>> and one for each www.zefox.com/net/org address. The netblock is
>> 64.161.5.105-109.
>>
>> Will errors result if a zone file contains A records for hosts
>> in a different zone? It would simplify matters of all could share
>> the same zone file, but clearly that can't go on forever, if at all.
>>
>> Thanks for reading, and your help so far!
>>
>> bob prohaska
>>
>>
>>
>>
>
>
>



More information about the bind-users mailing list