Я столкнулся со странной проблемой. Может кто знает ответ. Я использую 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 ответ1

1
sudo named-checkzone www.example.com /var/named/example.com.zone

Там ошибка. Первым аргументом должно быть имя зоны (example.com), а не полное доменное имя, например www.example.com ; Итак, правильная команда будет

sudo named-checkzone example.com /var/named/example.com.zone

Всё ещё ищете ответ? Посмотрите другие вопросы с метками .