DNS 服务器设置

DNS 服务器设置

我正在尝试安装 DNS 服务器,运行后sudo named-checkzone ostechnix.lan /etc/bind/for.austen.lan出现错误

zone austen.lan/IN: 
NS 'pri.austen.lan.austen.lan' has no address records (A or AAAA)
zone austen.lan/IN: NS 'sec.austen.lan.austen.lan' has no address records (A or AAAA)
zone austen.lan/IN: not loaded due to errors.

这是我的正向和反向区域文件

$TTL 86400
@   IN SOA   pri.austen.lan.  root.austen.lan (
       2011071001  ;Serial
       3600        ;Refresh
       1800        ;Retry
       604800      ;Expire
       86400       ;Minimum TTL
)
@      IN  NS     pri.austen.lan
@      IN  NS     sec.austen.lan
@      IN  A      10.142.0.2
@      IN  A      10.142.0.2
@      IN  A      10.142.0.2
pri    IN  A      10.142.0.2
sec    IN  A      10.142.0.2
client IN  A      10.142.0.2

我的反向文件是

$TTL 86400
@   IN SOA   pr.austen.lan. root.austen.lan. (
       2011071002  ;Serial
       3600        ;Refresh
       1800        ;Retry
       604800      ;Expire
       86400       ;Minimum TT
)
@      IN NS pri.austen.lan.
@      IN NS sec.austen.lan.
@      IN PTR austen.lan.
pri    IN A   10.142.0.2
sec    IN A   10.142.0.2
client IN A   10.142.0.2
200    IN PTR pri.austen.lan
201    IN PTR sec.austen.lan
202    IN PTR cleint.austen.lan.

答案1

您的正向区域文件缺少句点和其他语法错误。请尝试以下操作(我的文件名是db.austen.lan):

$TTL 86400
@   IN SOA   austen.lan.  root.austen.lan. (
       2018111201  ;Serial
       3600        ;Refresh
       1800        ;Retry
       604800      ;Expire
       86400       ;Minimum TTL
)
       IN  A      10.142.0.2
;
@      IN  NS     pri.austen.lan.
pri    IN  A      10.142.0.2
@      IN  NS     sec.austen.lan.
sec    IN  A      10.142.0.2
;
client IN  A      10.142.0.2

通过检查的有:

doug@DOUG-64:~/config/etc/bind/test4$ named-checkzone austen.lan db.austen.lan
zone austen.lan/IN: loaded serial 2018111201
OK

对于您的反向文件也类似(我的文件名是db.10):

$TTL 86400
@   IN SOA   pri.austen.lan. root.austen.lan. (
       2018111201  ;Serial
       3600        ;Refresh
       1800        ;Retry
       604800      ;Expire
       86400       ;Minimum TTL
)
@      IN NS pri.austen.lan.
@      IN NS sec.austen.lan.
2      IN PTR pri.austen.lan.
2      IN PTR sec.austen.lan.
2      IN PTR cleint.austen.lan.

通过检查的有:

doug@DOUG-64:~/config/etc/bind/test4$ named-checkzone 0.142.10.in-addr.arpa db.10
zone 0.142.10.in-addr.arpa/IN: loaded serial 2018111201
OK

相关内容