无法使用绑定加载反向区域

无法使用绑定加载反向区域

我已经创建了一个简单的绑定 DNS 服务器来在测试实验室中托管 3 个区域。

  • 沐浴.本地 (192.168.100.0/24)
  • 慕尼黑.本地 (192.168.101.0/24)
  • dhcp.本地(192.168.99.0/24)

我想要正向和反向解析,但我无法验证反向配置。

我是否遗漏了一些关键概念,或者这只是打字错误?

提前谢谢了!

我使用以下内容作为我的/etc/named.conf

//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
options {
        listen-on port 53 { 
                127.0.0.1; 
                192.168.99.2; 
                192.168.100.2; 
                192.168.101.2; 
              }; ### Master DNS IP ###

        listen-on-v6 port 53 { ::1; };
        directory "/var/named";
        dump-file "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
        allow-query     {
                         localhost;
                         192.168.99.0/24;
                         192.168.100.0/24;
                         192.168.101.0/24;
                        }; ### IP Range ###
        recursion yes;
        dnssec-enable no;
        dnssec-validation no;
        // dnssec-lookaside auto;
        /* Path to ISC DLV key */
        bindkeys-file "/etc/named.iscdlv.key";
        managed-keys-directory "/var/named/dynamic";
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {
        type hint;
        file "named.ca";
};

zone "dhcp.local" IN {
        type master;
        file "forward.dhcp.local";
        allow-update { none; };
};

zone "bath.local" IN {
        type master;
        file "forward.bath.local";
        allow-update { none; };
};

zone "munich.local" IN {
        type master;
        file "forward.munich.local";
        allow-update { none; };
};

zone"99.168.192.in-addr.arpa" IN {
        type master;
        file "reverse.dhcp.local";
        allow-update { none; };
};

zone"100.168.192.in-addr.arpa" IN {
        type master;
        file "reverse.bath.local";
        allow-update { none; };
};

zone"101.168.192.in-addr.arpa" IN {
        type master;
        file "reverse.munich.local";
        allow-update { none; };
};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

这依赖于 3 个正向文件和 3 个反向文件/var/named/[forward.*|reverse.*]

/var/named
├── data
├── dynamic
├── forward.bath.local
├── forward.dhcp.local
├── forward.munich.local
├── named.ca
├── named.empty
├── named.localhost
├── named.loopback
├── reverse.bath.local
├── reverse.dhcp.local
├── reverse.munich.local
└── slaves

只选择一个(bath.local),前向配置是

[root@dhcp named]# cat forward.bath.local
$TTL 86400
@   IN  SOA     dns.bath.local root.bath.local. (
        2011071001  ;Serial
        3600        ;Refresh
        1800        ;Retry
        604800      ;Expire
        86400       ;Minimum TTL
)
@       IN  NS          dns.bath.local.
@       IN  A           192.168.100.2
dns     IN  A           192.168.100.2
router     IN  A           192.168.100.1

反向配置是 [root@dhcp named]# cat reverse.bath.local

$TTL 86400
@   IN  SOA     dns.bath.local. root.bath.local. (
        2011071001  ;Serial
        3600        ;Refresh
        1800        ;Retry
        604800      ;Expire
        86400       ;Minimum TTL
)
100.168.192.in-addr.arpa.       IN  NS          dns.bath.local.

2     IN  PTR         dns.bath.local.

当我验证转发配置时一切正常

[root@dhcp named]# named-checkzone tsvtest /var/named/forward.bath.local
zone tsvtest/IN: loaded serial 2011071001
OK

但相反的做法却失败了

[root@dhcp named]# named-checkzone tsvtest /var/named/reverse.bath.local 
/var/named/reverse.bath.local:9: ignoring out-of-zone data (100.168.192.in-addr.arpa)
zone tsvtest/IN: has no NS records
zone tsvtest/IN: not loaded due to errors.

有任何想法吗 ?

答案1

1)(常见)Fwd 区域,第 2 行 dns.bath.local 需要在 dns.bath.local 后面加一个句点。

2)删除第 9 行

====== 反向区域 1) BIND 希望将反向文件命名为 100.168.192.in-addr.arpa BINDD 反向文件中指定的域是 IP 子网的名称,而不是正向域的名称。您的反向文件与 bath.local 无关,但与 192.168.100.x 有关

2)第 9 行 - 从行首删除 100.168.192.in-addr.arpa。

3)请发布您的 /etc/named.conf,以便我们检查其中的内容。

相关内容