DNSMASQ不回答来自路由子网的DNS查询


3

我有两个使用两个DD-WRT AP连接在一起的子网-远程AP处于客户端路由模式,因此它有一个单独的子网,其IP为192.168.2.1/24和192.168.0.5/24。本地AP处于AP模式远程AP的DD-WRT DHCP设置处于转发模式

我在IP 192.168.0.2/24的第一个子网中设置了DNSMASQ,它也是第二个子网的DHCP服务器-这可行,我的远程客户端获得了正确的路由器。DNSMasq机器可以ping通第二个子网中的PC,反之亦然,我也可以从第一个子网中的PC到第二个子网中的PC进行RDP-因此,在我看来,第一到第二个子网中的大多数通信是工作中

我的问题是DNSMasq不会将DNS答复发送到第二个子网-它确实可以工作到第一个子网。有人可以建议原因吗?

需要注意的一件事是,第二个网络的路由位于网关设备(192.168.0.1)上,但我发现它丢弃了许多数据包-因此,每个第一个子网设备都为添加到第二个子网的本地静态路由它。

route add 192.168.2.0 mask 255.255.255.0 192.168.0.5

由于目前的问题,我目前尚未测试DHCP分配的路由

这是我所拥有的草图 素描网

DNSMASQ配置

# Configuration file for dnsmasq.
domain-needed
bogus-priv
addn-hosts=/etc/dnsmasq.hosts
# so don't use it if you use eg Kerberos, SIP, XMMP or Google-talk. This option only affects forwarding, SRV records originating for dnsmasq (via srv-host= lines) are not
# suppressed by it.
filterwin2k

dhcp-range=set:house,192.168.0.1,192.168.0.254,infinite
dhcp-range=set:backyard,192.168.2.1,192.168.2.254,infinite

# Change this line if you want dns to get its upstream servers from somewhere other that /etc/resolv.conf
resolv-file=/var/run/dnsmasq/resolv.conf
# server=61.9.134.49
# server=61.9.133.193 setup the default gateway
dhcp-option=tag:house,option:router,192.168.0.1
dhcp-option=tag:backyard,option:router,192.168.2.1

# option 42?
dhcp-option=option:ntp-server,192.168.0.2
expand-hosts
domain=wilson.lan
dhcp-range=192.168.0.100,192.168.0.150,12h
dhcp-range=192.168.2.100,192.168.2.150,255.255.255.0,12h


# DO NOT Set The route to that network Done on Gateway
#dhcp-option=121,192.168.2.0/24,192.168.0.5
#Send microsoft-specific option to tell windows to release the DHCP lease when it shuts down. Note the "i" flag,
#  to tell dnsmasq to send the value as a four-byte integer - that's what microsoft wants. See
# http://technet2.microsoft.com/WindowsServer/en/library/a70f1bb7-d2d4-49f0-96d6-4b7414ecfaae1033.mspx?mfr=true
dhcp-option=vendor:MSFT,2,1i
# Set the DHCP server to authoritative mode. In this mode it will barge in and take over the lease for any client
# which broadcasts on the network, whether it has a record
# of the lease or not. This avoids long timeouts when a machine wakes up on a new network.
# DO NOT enable this if there's the slightest chance that you might end up
# accidentally configuring a DHCP server for your campus/company accidentally.
# The ISC server uses the same option, and this URL provides more information:
# http://www.isc.org/files/auth.html
dhcp-authoritative
# Log lots of extra information about DHCP transactions.
log-dhcp

我还在第二个子网中尝试了8.8.8.8版本的nslookup,并且有效
Ross

Answers:


4

好的,因此,在更好地阅读手册之后,我需要添加一些内容以覆盖仅回答本地子网(--local-service)的默认选项,该选项没有取反,因此例如

listen-address=192.168.0.2

但是作为resolve.conf有一行

nameserver 127.0.0.1

我的更改停止了DNSMASQ自身的查询回答-如此奇怪的是,DNS服务器不再能够解析任何dns名称,而所有其他计算机都已成功地将其用作dns服务器。我通过添加以下行来解决此问题

listen-address=192.168.0.2,127.0.0.1

因为我无法解决一种简单的方法来解决resolveconf在做什么


Arch Wiki在细节上有些含糊,但在这里提到了它:wiki.archlinux.org/index.php/dnsmasq
Jonathan Komar

谢谢,我没想到要寻找可以告诉我如何解决这个原始问题的不同Linux版本的文章,似乎也说dhcpd是一个可能的罪魁祸首,尽管我没有使用
Ross
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.