Centos

BIND 反向 DNS 忽略區域外數據

  • November 13, 2018

我有一個簡單的單地址反向 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

您已經創建了區域“0.142.10.in-addr.arpa”,因此您必須檢查該區域:

named-checkzone 0.142.10.in-addr.arpa /var/named/zones/0.142.10.in-addr.arpa.db

引用自:https://unix.stackexchange.com/questions/481518