mehrere Domänen in der Zonendatei akzeptieren

mehrere Domänen in der Zonendatei akzeptieren

Ich habe eine Zonendatei wie diese für die Domänemaindomain.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.

anotherdomain.comAber ich muss andere Domänen wie exampledomain.netan diesen Server binden . Ich habe DNS für diese Domänen auf ns1.maindomain.comund eingestellt ns2.maindomain.com. Also muss ich eine Zonendatei für andere Domänen erstellen. Beispiel:

$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.

Ich brauche keinen Nameserver für 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";
};

Außerdem habe ich einen Fehler in der Zonendatei:

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.

Antwort1

Eine Domäne pro Zonendatei. Bearbeiten Sie einfach Ihre named.conf-Datei, um für jede Zone eine andere Datei zu verwenden.

zone "anotherdomain.com"    {  type master;  file "anotherdomain.DB";  };

verwandte Informationen