DNSMasq不parsing公共域名上的不可路由的IP

我们的DNSMasq无法parsing来自指定私有IP地址的公共域的A,CNAME或别名logging。

例如:

$ nslookup > server 172.16.1.1 Default server: 172.16.1.1 Address: 172.16.1.1#53 > www.work-domain.com Server: 172.16.1.1 Address: 172.16.1.1#53 Non-authoritative answer: Name: www.work-domain.com Address: 55.77.XXX.XXX > server-b.work-domain.com Server: 172.16.1.1 Address: 172.16.1.1#53 Non-authoritative answer: *** Can't find server-b.work-domain.com: No answer 

但切换到公共DNS工作正常:

 $ nslookup > server 8.8.8.8 Default server: 8.8.8.8 Address: 8.8.8.8#53 > www.work-domain.com Server: 8.8.8.8 Address: 8.8.8.8#53 Non-authoritative answer: Name: www.work-domain.com Address: 55.77.XXX.XXX > server-b.work-domain.com Server: 8.8.8.8 Address: 8.8.8.8#53 Non-authoritative answer: Name: server-b.work-domain.com Address: 10.1.XXX.XXX 

请注意, server-b.work-domain.com条目正确parsing为不可路由的IP地址10.1.XXX.XXX ? 这是我的问题,这不适用于本地networking上的本地dnsmasq

这些IP地址是我们的亚马逊AWS专用子网的一部分,我们有VPN来访问它们。

这在所有200多个服务器上都是100%一致的,这些服务器通过几个子网注册了4个不同的公共域,全都使用私有的不可路由的IP地址。 但是,所有其他使用公共可路由IP地址的logging都可以在同一个域上正常工作!

其他一切都是100%正常工作与本地dnsmasq:

  • 解决所有公共领域
  • 解决所有公共IP的IP反向查找
  • 解决所有内部专用域和主机
  • 解决私有IP和DHCP租约的所有IP反向查找

这只是公共logging使用私人不可路由的IP。

我必须错过一些选项,我无法中断阅读MAN页面。

版:

 Dnsmasq version 2.73 # (part of AdvancedTomato) 

configuration(删除敏感的条目,左边的例子):

 # dhcp-option=lan,3,172.16.1.1 cache-size=8192 log-async=25 strict-order #local=/lan/ #domain=lan,172.16.1.0/24,local expand-hosts domain-needed # network devices address=/router-gateway.lan/172.16.1.1 address=/router-office.lane/172.16.1.2 ...and so on x 70 # arpa entries ptr-record=1.1.16.172.in-addr.arpa,"router-gateway.lan" ptr-record=2.1.16.172.in-addr.arpa,"router-office.lan" ...and so on 

AdvancedTomato上的本地resolvs被吐出:

 # cat /etc/resolv.conf nameserver 127.0.0.1 # cat /etc/resolv.dnsmasq nameserver 8.8.8.8 nameserver 8.8.4.4 

再次..一切工作完全与本地局域网在Windows,OSX和Linux客户端解决公共和内部域和局域网,甚至没有域后缀(服务器xyz – >parsing为server-xyz.lan)的主机。

这只是使用不可路由的IP的公共域。

@HåkanLindqvist评论指出我在正确的方向。 只要他回答,我会标记他的答案。 直到那时…

他的评论指出了dnsmasq的rebind选项:

 --stop-dns-rebind Reject (and log) addresses from upstream nameservers which are in the private IP ranges. This blocks an attack where a browser behind a firewall is used to probe machines on the local network. --rebind-localhost-ok Exempt 127.0.0.0/8 from rebinding checks. This address range is returned by realtime black hole servers, so blocking it may disable these services. --rebind-domain-ok=[<domain>]|[[/<domain>/[<domain>/] Do not detect and block dns-rebind on queries to these domains. The argument may be either a single domain, or multiple domains surrounded by '/', like the --server syntax, eg. --rebind-domain-ok=/domain1/domain2/domain3/ 

用这些知识武装起来,我看到事实正在发生:

 # cat /tmp/etc/dnsmasq.conf ... rebind-localhost-ok ... 

然后我将下面的内容添加到我的dnsmasq.conf中以解决它:

 rebind-domain-ok=/work-domain1.com/work-domain2.com/ 

呜呼! 有用!

我的dnsmasq必须已经被严格的编译选项默认为。