为什么将 DNS 记录设置为私有地址时 nslookup 会失败?

cwd*_*cwd 3 dns openwrt dnsmasq resolution nslookup

设置

在某些网络上,我可以用来nslookup解析指向私有 IP 地址的域名:

@work> nslookup my192.ddns.net
Server:     10.1.2.3
Address:    10.1.2.3#53

Non-authoritative answer:
Name:   my192.ddns.net
Address: 192.168.20.20
Run Code Online (Sandbox Code Playgroud)

但是,在我的家庭网络上,同样的查询失败了:

@home> nslookup my192.ddns.net
Server:     192.168.0.1
Address:    192.168.0.1#53

Non-authoritative answer:
*** Can't find my192.ddns.net: No answer
Run Code Online (Sandbox Code Playgroud)

什么有效

我发现如果我更改 A 记录以my192.ddns.net使其指向公共 IP 范围,它将正常工作:

@home> nslookup my192.ddns.net
Server:     192.168.0.1
Address:    192.168.0.1#53

Non-authoritative answer:
Name:   my192.ddns.net
Address: 172.217.12.238
Run Code Online (Sandbox Code Playgroud)

在家里,如果我为 nslookup 指定 DNS 服务器,或者nslookup按预期将我的笔记本电脑的 DNS 服务器设置为 Google 的工作:

@home> nslookup my192.ddns.net 8.8.8.8
Server:     8.8.8.8
Address:    8.8.8.8#53

Non-authoritative answer:
Name:   my192.ddns.net
Address: 192.168.20.20
Run Code Online (Sandbox Code Playgroud)

但我想继续使用我的家庭路由器作为我的主要 DNS,以便它可以解析本地网络名称。我只是喜欢它不要试图做的DNS记录查找时不能在该点私有地址范围(如:192.168.20.20

家庭网络

我在我的家用路由器上运行LEDE(以前称为OpenWRT),它运行dnsmasq. 我查看了DNS 的文档,甚至设置了系统,以便它用来解析地址的 DNS 服务器是 Google 的 ( 8.8.8.8) - 但它仍然失败,我似乎无法弄清楚原因。

这里发生了什么,我该如何解决?

Jde*_*eBP 5

这是dnsmasq. 在dnsmasq人们称它为“重新绑定保护”,你可以看到它无论是在dnsmasq手动的--stop-dns-rebind命令行选项,并在LEDE DOCO作为rebind_protection选项。

它默认为开启。将其关闭,或将您希望使用的域添加到白名单rebind_domain域集。

它旨在防止的攻击是攻击者利用您的 WWW 浏览器将自动从世界范围内自动下载和运行攻击者提供的程序这一事实,使 xyr 域名似乎在外部IP 地址和 LAN 内部的一个,允许您的机器成为 LAN 上具有该 IP 地址的另一台机器与某些攻击者运行的内容服务器之间的管道。