I have zone file like this for domain maindomain.com
$TTL 14400
maindomain.com. IN SOA ns1.maindomain.com. [email protected]. (
2013120716 ; serial
14400 ; refresh
3600 ; retry
1209600 ; expire
7200 ; negative cache
) ;
; name servers
@ IN NS ns1.maindomain.com.
@ IN NS ns2.maindomain.com.
; mail
; maindomain.com. IN MX 10 mail.maindomain.com.
; name servers
maindomain.com. IN A 4.2.2.1
ns1 IN A 4.2.2.1
ns2 IN A 4.2.2.2
; cname
www IN CNAME maindomain.com.
But i need to bind another domains like anotherdomain.com
, exampledomain.net
to this server. I set dns for these domains to ns1.maindomain.com
and ns2.maindomain.com
.
So I must create zone file for another domains. for example :
$TTL 14400
anotherdomain.com. IN SOA ns1.maindomain.com. [email protected]. (
2013120716 ; serial
14400 ; refresh
3600 ; retry
1209600 ; expire
7200 ; negative cache
) ;
; cname
www IN CNAME anotherdomain.com.
I dont need name server for anotherdoamin.com
...
zone "maindomain.com" {
type master;
file "/etc/bind/zones/master/maindomain.com.db";
};
zone "anotherdomain.com" {
type master;
file "/etc/bind/zones/master/anotherdomain.com.db";
};
Also i have an error in zone file:
named-checkzone anotherdomain.com /etc/bind/zones/master/anotherdomain.com.db
zone anotherdomain.com/IN: has no NS records
zone anotherdomain.com/IN: not loaded due to errors.
One domain per zone file. Just edit your named.conf file to use a different file for each zone.