我遇到了一个奇怪的问题。也许有人知道答案。我用来named-checkzone
检查我的区域文件。
将显示以下区域文件忽略区域外数据当我使用完全限定域名时:
$TTL 30
@ IN SOA localhost. admin.example.com. (
2017072702 ; serial
3 ; refresh
1 ; retry
2 ; expire
1M) ; negative TTL
IN NS localhost.;
www.example.com. IN A 192.168.111.45
www.example.com. IN AAAA fe80::22c9:d0ff:1ecd:c0ef
foo.example.com. IN A 192.168.121.11
bar.example.com. IN CNAME www.example.com.
;generate 100 hosts
$GENERATE 1-100 host$.example.com. IN A 10.20.45.$
但是,对于相对名称,不会像此区域文件中那样显示此类消息:
$TTL 30
@ IN SOA localhost. admin.example.com. (
2017072702 ; serial
3 ; refresh
1 ; retry
2 ; expire
1M) ; negative TTL
IN NS localhost.;
www IN A 192.168.111.45
www IN AAAA fe80::22c9:d0ff:1ecd:c0ef
foo IN A 192.168.121.11
bar IN CNAME www.example.com.
;generate 100 hosts
$GENERATE 1-100 host$ IN A 10.20.45.$
有人可以解释为什么会这样吗?
我输入的命令如下sudo named-checkzone www.example.com /var/named/example.com.zone
。
包含完全限定域名 (FQDN) 的文件的输出如下:
/var/named/example.com.zone:11: ignoring out-of-zone data (foo.example.com)
/var/named/example.com.zone:12: ignoring out-of-zone data (bar.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host1.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host2.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host3.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host4.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host5.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host6.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host7.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host8.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host9.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host10.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host11.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host12.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host13.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host14.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host15.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host16.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host17.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host18.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host19.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host20.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host21.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host22.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host23.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host24.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host25.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host26.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host27.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host28.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host29.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host30.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host31.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host32.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host33.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host34.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host35.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host36.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host37.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host38.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host39.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host40.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host41.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host42.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host43.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host44.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host45.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host46.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host47.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host48.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host49.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host50.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host51.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host52.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host53.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host54.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host55.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host56.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host57.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host58.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host59.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host60.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host61.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host62.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host63.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host64.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host65.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host66.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host67.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host68.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host69.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host70.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host71.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host72.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host73.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host74.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host75.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host76.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host77.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host78.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host79.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host80.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host81.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host82.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host83.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host84.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host85.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host86.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host87.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host88.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host89.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host90.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host91.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host92.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host93.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host94.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host95.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host96.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host97.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host98.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host99.example.com)
/var/named/example.com.zone:14: ignoring out-of-zone data (host100.example.com)
zone www.example.com/IN: loaded serial 2017072702
OK
包含相对域名的文件的输出如下:
zone www.example.com/IN: loaded serial 2017072702
OK
答案1
命令错误。第一个参数必须是区域,而不是 FQDN:
sudo named-checkzone example.com /var/named/example.com.zone