DNS Slave 表示连接失败:主机无法访问

DNS Slave 表示连接失败:主机无法访问

我有一个 DNS 主服务器(192.168.102.159)和从服务器(192.168.102.132),两者都是虚拟机,主服务器配置很好,并且可以进行正向和反向查找,但是,当我尝试使用从服务器进行区域传输时,从服务器会抛出以下错误无法连接:主机无法访问,我已检查conf和区域文件中的IP地址是否正确,区域文件在named-checkzone中也没有显示错误。这是我的第二个设置,在之前的设置中,我收到了一个错误 rndc.key not find ,然后是这个错误,但是,在这个设置中我只收到了这个错误。

我已经在 Slave 中的 Slaves 文件夹中添加了 chgrp 和 chown,但是,没有添加防火墙条目,不确定是否必须这样做。

防火墙条目

iptables -A INPUT -i ens33 -p tcp -m state --state NEW,ESTABLISHED -s 192.168.102.132 --sport 1024:65535 --dport 53 -j ACCEPT

iptables -A INPUT -i ens33 -p udp -m state --state NEW,ESTABLISHED -s 192.168.102.132 --sport 1024:65535 --dport 53 -j ACCEPT

命名.conf(主)

acl internals { 192.168.102.0/24;  };

options {
        listen-on port 53 { 127.0.0.1; 192.168.102.159; };
        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";
        recursing-file  "/var/named/data/named.recursing";
        secroots-file   "/var/named/data/named.secroots";
        allow-transfer { 192.168.102.132; };
        allow-query     { localhost; internals; };

        recursion yes;
        /*
        dnssec-enable yes;
        dnssec-validation yes;
        */
        /* Path to ISC DLV key */
        bindkeys-file "/etc/named.iscdlv.key";

        managed-keys-directory "/var/named/dynamic";

        pid-file "/run/named/named.pid";
        session-keyfile "/run/named/session.key";
};

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

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

zone "abc.local" { type master; file "abc.db"; allow-transfer { 192.168.102.132; };  };

zone "102.168.192.IN-ADDR.ARPA" { type master; file "cba.db"; allow-transfer { 192.168.102.132; }; };

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

命名.conf(从属)

acl internals { 192.168.102.0/24; };

options {
        listen-on port 53 { 127.0.0.1; 192.168.102.132; };
        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";
        recursing-file  "/var/named/data/named.recursing";
        secroots-file   "/var/named/data/named.secroots";
        allow-notify { 192.168.102.159; };
        allow-query     { localhost; internals; };

        recursion yes;

        dnssec-enable yes;
        dnssec-validation yes;

        /* Path to ISC DLV key */
        bindkeys-file "/etc/named.iscdlv.key";

        managed-keys-directory "/var/named/dynamic";

        pid-file "/run/named/named.pid";
        session-keyfile "/run/named/session.key";
};

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

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

zone "abc.local" { type slave; masters { 192.168.102.159; }; file "slaves/abc.db"; allow-transfer { 192.168.102.159; }; };

zone "102.168.192.IN-ADDR.ARPA" { type slave; masters { 192.168.102.159; }; file "slaves/cba.db"; allow-transfer { 192.168.102.159; }; };

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

abc.db

$TTL 3H
$ORIGIN abc.local.
@       IN SOA ns1.abc.local. ns2.abc.local. (
                                        0       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
        IN NS ns1.abc.local.
        IN NS ns2.abc.local.
ns1     IN A 192.168.102.159
ns2     IN A 192.168.102.132

篮球协会数据库

$TTL 3H
$ORIGIN 102.168.192.IN-ADDR.ARPA.
@       IN SOA ns1.abc.local. ns2.abc.local. (
                                        0       ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
        IN NS ns1.abc.local.
        IN NS ns2.abc.local.
159     IN PTR ns1.abc.local.
132     IN PTR ns2.abc.local.

错误

30-Dec-2018 20:33:24.030 managed-keys-zone: journal file is out of date: removing journal file

30-Dec-2018 20:33:24.030 managed-keys-zone: loaded serial 2

30-Dec-2018 20:33:24.031 zone 0.in-addr.arpa/IN: loaded serial 0

30-Dec-2018 20:33:24.033 zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0

30-Dec-2018 20:33:24.035 zone localhost.localdomain/IN: loaded serial 0

30-Dec-2018 20:33:24.035 zone localhost/IN: loaded serial 0

30-Dec-2018 20:33:24.037 zone 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 0

30-Dec-2018 20:33:24.037 all zones loaded

30-Dec-2018 20:33:24.037 running

30-Dec-2018 20:34:54.045 zone abc.local/IN: refresh: retry limit for master 192.168.102.159#53 exceeded (source 0.0.0.0#0)

30-Dec-2018 20:34:54.045 zone abc.local/IN: Transfer started.

30-Dec-2018 20:34:54.046 transfer of 'abc.local/IN' from 192.168.102.159#53: failed to connect: host unreachable

30-Dec-2018 20:34:54.046 transfer of 'abc.local/IN' from 192.168.102.159#53: Transfer completed: 0 messages, 0 records, 0 bytes, 0.001 secs (0 bytes/sec)

30-Dec-2018 20:34:54.547 zone 102.168.192.IN-ADDR.ARPA/IN: refresh: retry limit for master 192.168.102.159#53 exceeded (source 0.0.0.0#0)

主从双方都能互相ping通。

答案1

这个问题已经解决,作为一个非 Linux 用户,仍在学习,我发现 IP 表从未安装,是防火墙正在工作并阻止端口 53 上的 tcp/udp,一旦我在防火墙中允许两者,区域传输就会发生地方。

相关内容