bind9 DNS 不响应 LAN 上的查询

问题描述

我正在将 bind9 设置为我们本地网络的 DNS 服务器。对于来自运行服务器的机器的 DNS 查询,服务器按预期工作,但不响应来自网络上其他机器的查询。在 DNS 服务器上运行 tcpdump,我看到来自其他机器的查询到达,但我在 bind9 日志中没有看到任何响应或任何指示错误的内容。感谢您收到有关此问题的可能来源或调试途径的任何建议!

详细说明:

在 Ubuntu 上运行 bind9。我的配置是:

options {
    directory "/etc/bind";
    listen-on port 53 {100.1.1.2; };
    listen-on-v6 port 53 { none; };
    allow-query { any; };
    dnssec-validation no;
};

zone "mydomain.com" IN {
    type master;
    file "mydomain.com.db";
    allow-update { none; };
};

zone "1.1.100.in-addr.arpa" {
    type master;
    file "revp.100.1.1";
};

区域文件是

$ORIGIN mydomain.com.
$TTL    5; 3600
@   IN  SOA dns admin.mydomain.com. (
                              1         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
; DNS Servers
            NS      dns

; Machine Names
localhost   IN  A   127.0.0.1
dns     IN  A   100.1.1.2
bar     IN  A   100.1.1.10
baz     IN  A   100.1.1.11

named 开头的 sudo named -c /etc/bind/named.conf -g -d100。查看日志,它确实在侦听正确的 IP(我看到 listening on IPv4 interface enp6s0,100.1.1.2#53)。在运行带有 dig baz.mydomain.com @100.1.1.2 的 DNS 服务器的同一台机器上测试 DNS 查找我从 DNS 服务器获得了一个答案,并在 named 日志中包含相应的条目。我还在 sudo tcpdump -i lo -u port 53 中看到了 DNS 请求。

接下来,现在在 PC 栏上,我运行了 dig baz.mydomaain.com @100.1.1.2。这个请求没有得到 DNS 服务器的任何响应,我在 DNS 日志中没有看到任何内容。查看 DNS 服务器上的 sudo tcpdump -u port 53,我看到来自 bar 的 DNS 请求但没有响应,因此这似乎不是防火墙问题。

对下一步有什么建议吗?

解决方法

我将从不使用 MCI 通信服务地址块开始,并使用来自 RFC1918 的正确网络块:

NetRange:       100.0.0.0 - 100.19.255.255
CIDR:           100.16.0.0/14,100.0.0.0/12
NetName:        V4-VZO
NetHandle:      NET-100-0-0-0-1
Parent:         NET100 (NET-100-0-0-0-0)
NetType:        Direct Allocation
OriginAS:       AS19262
Organization:   MCI Communications Services,Inc. d/b/a Verizon Business (MCICS)
RegDate:        2010-12-28
Updated:        2018-01-10
Ref:            https://rdap.arin.net/registry/ip/100.0.0.0

然后当然使用wireshark(或tcpdump)来观察数据包被路由到哪里。但强烈建议不要使用其他人的网络。

,

好的,结果证明这是一个基本的防火墙问题。长话短说,我没有意识到 tcpdump 在防火墙之前看到数据包,因此看到入站 DNS 请求并不意味着它们到达了服务器。哦!

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...