Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have zone file like this for domain maindomain.com

$TTL 14400
maindomain.com. IN SOA ns1.maindomain.com. webmaster@maindomain.com. (
  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. webmaster@maindomain.com. (
  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.
share|improve this question
    
There must be NS records in each zone. They don't have to be in the domain in question, but every zone must have them. –  MadHatter Dec 7 '13 at 20:19

1 Answer 1

One domain per zone file. Just edit your named.conf file to use a different file for each zone.

zone "anotherdomain.com"    {  type master;  file "anotherdomain.DB";  };
share|improve this answer
    
Update question. I already added to named.conf.local –  sweb Dec 7 '13 at 19:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.