
我有這樣的域區域文件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.
但我需要將另一個網域(例如anotherdomain.com
, )綁定exampledomain.net
到該伺服器。我將這些網域的 dns 設定為ns1.maindomain.com
和ns2.maindomain.com
。所以我必須為其他網域建立區域文件。例如 :
$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.
我不需要名稱伺服器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";
};
我的區域文件也有錯誤:
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.
答案1
每個區域檔案一個網域。只需編輯您的named.conf 檔案即可為每個區域使用不同的檔案。
zone "anotherdomain.com" { type master; file "anotherdomain.DB"; };