Redundant data in zone file.

Bill Larson wllarso at
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 "" 
is your "primary" domain name, you could have:

	$TTL 86400
	@	IN	SOA (
					1;	Serial
					28800;	Refresh
					14400;	Retry
					3600000;	Expire
					86400 );	MinTTL

	; delegated DNS servers for zone

	; Mail Exchanger info for zone
		IN	MX	10

	; Host information
	ns1	IN	A
	ns2	IN	A

	; Web server for domain	
	www	IN	A

For zones "", "", and "", you would 
end up with the following "A" record information defined:	IN	A	IN	A	IN	A	IN	A	IN	A	IN	A

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 
"" and "" 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:	IN	A	IN	A	IN	A

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., "" would 
return that you are accessing domain1, and "" 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> ---
>> Is there any harm in having redundant information in zone files?
>> For example, I've registered three domains:
>> They must share 5 ip addresses: one for each nameserver in .net
>> and one for each address. The netblock is
>> 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