multiple domains on 1 IP # - file layout

Kevin Darcy kcd at chrysler.com
Tue Jul 8 20:58:55 UTC 2008


No, you can't mix data from different zones like that. You need a 
separate zone definition in named.conf for each zone, and the nameserver 
needs to see only data in the zonefile which is *specific* for that zone 
(with the only exception being "glue" records for child zones, but that 
doesn't apply here). If named sees data in the zone file for a different 
zone, then it'll give you a "out of zone data" error.

Having said that, some people use the "trick" of using the same zone 
file for multiple zones, using single-label ("relative") names and the 
"@" syntax, e.g.

=== named.conf ===
zone "pianos4all.biz" {
    type master;
    file "common";
};

zone "xtufd.org" {
    type master;
    file "common";
};

=== ${DATADIR}/common ===

$TTL 3h
; Definition of zones at @
@         IN	SOA	olaf.com.	admin.olaf.com.	(
		2008070301	; Serial (date, 2 digit version of day)
		86400		; refresh (1 day)
		7200		; retry (2 hrs)
		8640000		; expire (100 days)
		86400 )		; minimum (1day)
			
; name servers
				IN	NS	ns3.olaf.com.
				IN	NS	ns4.olaf.com.

; MX records
				IN	A	50	mail.olaf.com.

; Hosts
            			IN	A	192.168.50.73	
	
; nickname
www         			IN      CNAME   @

(In the olaf.com zone itself, you'd still need to define the A records 
for ns3.olaf.com and ns4.olaf.com, so it wouldn't use "common" zone file 
for that one).

                                                              - Kevin

Adam Smith wrote:
> Hello,
> I am setting up a nameserver - multiple domains on 1 IP #. BIND 9.3.1 on 
> FreeBSD 6.x;
> I am not too clear on the exact format for these files in the master 
> folder, could someone suggest the correct way. Special concerns as to 
> whether all the domains should be listed here as under "Hosts" and 
> "nickname". There is only one reverse_dns file used in the master folder 
> and one db.* for each of the domains (zones) listed in the named.conf file.
> Thanks!
>
>
>
> __________________________________________________________________________
>
> $TTL 3h
> ; Definition of zones at olaf.com.
> olaf.com.	IN	SOA	olaf.com.	admin.olaf.com.	(
> 		2008070301	; Serial (date, 2 digit version of day)
> 		86400		; refresh (1 day)
> 		7200		; retry (2 hrs)
> 		8640000		; expire (100 days)
> 		86400 )		; minimum (1day)
> 			
> ; name servers
> 				IN	NS	ns3.olaf.com.
> 				IN	NS	ns4.olaf.com.
> ns3.olaf.com.			IN	A	192.168.50.73
> ns4.olaf.com.			IN	A	192.168.50.73
>
>
> ; MX records
> 				IN	A	50	mail.olaf.com.
>
> ; Hosts
> pianos4all.biz.			IN	A	192.168.50.73	
> xtufd.org.			IN	A	192.168.50.73		
> sodas4all.biz.			IN	A	192.168.50.73		
> sodas4all.com.			IN	A	192.168.50.73		
> olaf.biz.			IN	A	192.168.50.73		
> olaf.com.			IN	A	192.168.50.73		
> we32.biz.			IN	A	192.168.50.73		
> mimic.org.			IN	A	192.168.50.73		
> incredible.info.		IN	A	192.168.50.73	
> tango4all.biz.			IN	A	192.168.50.73		
> allegro.biz.			IN	A	192.168.50.73		
> chachacha.com.		        IN	A	192.168.50.73	
> staccato.com.	                IN	A	192.168.50.73
> saywho.biz.			IN	A	192.168.50.73		
>
>
> ; nickname
> www.pianos4all.biz.             IN      CNAME   pianos4all.biz.
> www.xtufd.org.                  IN      CNAME   xtufd.org.
> www.sodas4all.biz.              IN      CNAME   sodas4all.biz.
> www.sodas4all.com.              IN      CNAME   sodas4all.com.
> www.olaf.biz.                   IN      CNAME   olaf.biz.
> www.olaf.com.                   IN      CNAME   olaf.com.
> www.we32.biz.                   IN      CNAME   we32.biz.
> www.mimic.org.                  IN      CNAME   mimic.org.
> www.incredible.info.            IN      CNAME   incredible.info.
> www.tango4all.biz.              IN      CNAME   tango4all.biz.
> www.allegro.biz.                IN      CNAME   allegro.biz.
> www.chachacha.com.              IN      CNAME   chachacha.com.
> www.staccato.com.               IN      CNAME   staccato.com.
> www.saywho.biz.                 IN      CNAME   saywho.biz.
>
> ______________________________________________________________________
>
>
>
> $TTL 3h
> ; Definition for reverse DNS at olaf.com.
> 73.50.168.192.in-adr.arpa.       IN      SOA     olaf.com. 
> admin.olaf.com.        (
>                                  2008070301      ; Serial (date, 2 digit 
> version of day)
>                                  86400           ; refresh (1 day)
>                                  7200            ; retry (2 hrs)
>                                  8640000         ; expire (100 days)
>                                  86400 )         ; minimum (1day)
>
>
> ; name servers
> 73.50.168.192.in-adr.arpa.       IN      NS      ns3.olaf.com.
> 73.50.168.192.in-adr.arpa.       IN      NS      ns4.olaf.com.
>
> ; Reversed hosts
>
> 73.50.168.192.in-adr.arpa.       IN      PTR     olaf.com.
>
>
>



More information about the bind-users mailing list