绑定 DNS 服务器未响应任何请求

绑定 DNS 服务器未响应任何请求

我在 CentOS 6.7 VPS 上运行 bind,但无法让它响应请求。我不确定,但我有点怀疑 m 和 loopback 接口之间存在一些冲突。这是我的 ifconfig:

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:47950 errors:0 dropped:0 overruns:0 frame:0
          TX packets:47950 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:5117063 (4.8 MiB)  TX bytes:5117063 (4.8 MiB)

venet0    Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:127.0.0.1  P-t-P:127.0.0.1  Bcast:0.0.0.0  Mask:255.255.255.255
          inet6 addr: MY:EXT:IP:V6::IP/56 Scope:Global
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
          RX packets:326740 errors:0 dropped:0 overruns:0 frame:0
          TX packets:136115 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:260931596 (248.8 MiB)  TX bytes:25033964 (23.8 MiB)

venet0:0  Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:MY.EXT.ERN.IP  P-t-P:MY.EXT.ERN.IP  Bcast:AAA.AAA.AAA.AAA  Mask:255.255.224.0
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1

这是我的/etc/named.conf(我非常怀疑问题出在包含的配置文件中):

options {
        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";
        forwarders {
        # these are the DNS servers from the VPS provider (look in /etc/resolv.conf if yours are different)
                MY.PROV.DNS.IP;
                8.8.8.8;
                8.8.4.4;
        };

        auth-nxdomain no;    # conform to RFC1035
        listen-on { any; };
        listen-on-v6 { any; };
        allow-query { any; };
        allow-recursion { any; };
        allow-transfer { MY.PROV.DNS.IP;};
        recursion yes;
        dnssec-enable no;
        dnssec-validation no;

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

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

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

include "/etc/named.zones.override.fr";

logging {
        channel default_log {
                file "data/named.run" versions 5 size 30m;
                severity debug;
                print-time yes;
                print-severity yes;
                print-category yes;
        };

        category default { default_log; };
        category queries { default_log; };
};

我用 检查了配置named-checkconf -z,看起来不错。下面是 netstat:

tcp        0      0 127.0.0.1:53                0.0.0.0:*                   LISTEN      25         54195107   13451/named
tcp        0      0 127.0.0.1:953               0.0.0.0:*                   LISTEN      25         54195112   13451/named
tcp        0      0 ::1:53                      :::*                        LISTEN      25         54195109   13451/named
tcp        0      0 ::1:953                     :::*                        LISTEN      25         54195113   13451/named
udp        0      0 127.0.0.1:53                0.0.0.0:*                               25         54195106   13451/named
udp        0      0 ::1:53                      :::*                                    25         54195108   13451/named

以下是我的测试结果:

nslookup google.com 127.0.0.1
;; connection timed out; trying next origin
nslookup google.com MY.EXT.ERN.IP
;; connection timed out; trying next origin

任何帮助都值得感激,谢谢!

答案1

第一站停靠港口:

  • 检查 /var/log/daemon.log
  • 检查绑定日志
  • 考虑在这里发布相关的日志
  • 考虑使用 dig 代替 nslookup 例如dig google.com @127.0.0.1

相关内容