我有一个简单的单地址反向 DNS PTR 来10.142.0.2
记录gbox.example.com
设置,如下所示:
# cat /var/named/zones/0.142.10.in-addr.arpa.db
$ORIGIN .
$TTL 1D
0.142.10.in-addr.arpa. IN SOA gbox.example.com. dnsadmin.example.com. (
2018111401 ;
12h ;
5m ;
1w ;
3h ;
)
NS gbox.example.com.
$ORIGIN 0.142.10.in-addr.arpa.
2 PTR gbox.example.com.
当我跑步时:
# named-checkzone 2.0.142.10.in-addr.arpa /var/named/zones/0.142.10.in-addr.arpa.db
/var/named/zones/0.142.10.in-addr.arpa.db:5: ignoring out-of-zone data (0.142.10.in-addr.arpa)
zone 2.0.142.10.in-addr.arpa/IN: has 0 SOA records
zone 2.0.142.10.in-addr.arpa/IN: has no NS records
zone 2.0.142.10.in-addr.arpa/IN: not loaded due to errors.
# named-checkzone 10.142.0.2 /var/named/zones/0.142.10.in-addr.arpa.db
/var/named/zones/0.142.10.in-addr.arpa.db:5: ignoring out-of-zone data (0.142.10.in-addr.arpa)
/var/named/zones/0.142.10.in-addr.arpa.db:16: ignoring out-of-zone data (2.0.142.10.in-addr.arpa)
zone 10.142.0.2/IN: has 0 SOA records
zone 10.142.0.2/IN: has no NS records
zone 10.142.0.2/IN: not loaded due to errors.
对于我的一生,我无法弄清楚这里发生了什么。
$ cat /etc/centos-release
CentOS Linux release 7.5.1804 (Core)
$bind -v
BIND 9.9.4-RedHat-9.9.4-61.el7_5.1 (Extended Support Version)
编辑:我尝试了区域文件的替代语法版本,没有任何更改:
# cat /var/named/zones/0.142.10.in-addr.arpa.db
$ORIGIN 0.142.10.in-addr.arpa.
$TTL 1D
@ IN SOA gbox.example.com. dnsadmin.example.com. (
2018111401 ;
12h ;
5m ;
1w ;
3h ;
)
NS gbox.example.com.
2 PTR gbox.example.com.
编辑2:将其集成到named.conf
:
zone "0.142.10.in-addr.arpa" {
type master;
allow-transfer { none; };
notify no;
file "/var/named/zones/0.142.10.in-addr.arpa.db";
};
我仍然遇到同样的错误named-checkzone
答案1
您已经创建了区域“0.142.10.in-addr.arpa”,因此您必须检查该区域:
named-checkzone 0.142.10.in-addr.arpa /var/named/zones/0.142.10.in-addr.arpa.db