Ubuntu

無法使反向 dns 工作

  • November 4, 2016

我之前已經設置了 bind9,但現在我顯然在某處做了錯誤的配置,我沒有看到它。DNS工作正常,反向DNS不行。我知道我必須反轉 IP 範圍才能使其正常工作。在我的配置下面。有好心人能告訴我我哪裡搞砸了嗎?

/etc/bind/named.conf.default-zones

// prime the server with knowledge of the root servers
zone "." {
   type hint;
   file "/etc/bind/db.root";
};

// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912

zone "localhost" {
   type master;
   file "/etc/bind/db.local";
};

   zone "127.in-addr.arpa" {
   type master;
   file "/etc/bind/db.127";
};

zone "0.in-addr.arpa" {
   type master;
   file "/etc/bind/db.0";
};

zone "255.in-addr.arpa" {
   type master;
   file "/etc/bind/db.255";
};

zone "10.168.192.in-addr.arpa" in {
   file "/etc/bind/db.10.168.192.in-addr.arpa";
   type master;
   check-names ignore;
};

zone "XXX.local" in {
   file "/etc/bind/db.XXX.local";
   type master;
   check-names ignore;
};

/etc/bind/db.XXX.local

$TTL 2D
@               IN SOA          fw.XXX.be.  root.fw.XXX.be. (
                               2011071000      ; serial
                               3H              ; refresh
                               1H              ; retry
                               1W              ; expiry
                               1D )            ; minimum

XXX.local.              IN NS           fw.XXX.be.

XXXApp01                A               192.168.10.6
XXXApp02                A               192.168.10.7
XXXHistorian            A               192.168.10.8
XXXShared               A               192.168.10.9
XXXFujitsuLaptop        A               192.168.10.3
fw                      A               192.168.10.254

/etc/bind/db.10.168.192.in-addr.arpa

$ORIGIN .
$TTL 604800     ; 1 week
10.168.192.in-addr.arpa  IN SOA  fw.XXX.be root.XXX.be. (
                               3          ; serial
                               604800     ; refresh (1 week)
                               86400      ; retry (1 day)
                               2419200    ; expire (4 weeks)
                               604800     ; minimum (1 week)
                               )
                       NS      fw.
$ORIGIN 10.168.192.in-addr.arpa.
$TTL 1200       ; 20 minutes
254             PTR     fw.XXX.be.
$TTL 604800     ; 1 week
006             PTR     XXXApp01.XXX.local.
007             PTR     XXXApp02.XXX.local.
008             PTR     XXXHistorian.XXX.local.
009             PTR     XXXShared.XXX.local.
003             PTR     XXXFujitsuLaptop.XXX.local.

/etc/bind/named.conf.options

options {
   directory "/var/cache/bind";
   dnssec-validation auto;

   auth-nxdomain no;    # conform to RFC1035
   listen-on-v6 { any; };
   allow-query { localhost; 192.168.10.0/24; 192.168.160.0/24; 10.0.0.0/16; 10.0.50.0/24; 10.0.51.0/24; };
};

非常感謝提前,

乾杯,

土地

我認為您可能在反向區域文件中失去了您的 NS 記錄(我看不到“IN”位)。此外,您可能不需要用零填充最後一個八位字節。

引用自:https://serverfault.com/questions/813144