如何配置 Ubuntu 以使用 dnsmasq 检测到的所有名称服务器?

如何配置 Ubuntu 以使用 dnsmasq 检测到的所有名称服务器?

尽管 dnsmasq 成功检测到 VPN 上的名称服务器,但我在解析内部 VPN 网络上的 DNS 名称时遇到了问题。以下是来自的相关输出/var/log/syslog

/var/log/syslog.1:Oct 13 19:07:58 snowman NetworkManager[840]: <info> DNS: starting dnsmasq...
/var/log/syslog.1:Oct 13 19:07:58 snowman NetworkManager[840]: <warn> dnsmasq not available on the bus, can't update servers.
/var/log/syslog.1:Oct 13 19:07:58 snowman NetworkManager[840]: <error> [1413241678.445577] [nm-dns-dnsmasq.c:396] update(): dnsmasq owner not found on bus: Could not get owner of name 'org.freedesktop.NetworkManager.dnsmasq': no such name
/var/log/syslog.1:Oct 13 19:07:58 snowman NetworkManager[840]: <warn> DNS: plugin dnsmasq update failed
/var/log/syslog.1:Oct 13 19:07:58 snowman dnsmasq[1052]: started, version 2.68 cache disabled
/var/log/syslog.1:Oct 13 19:07:58 snowman dnsmasq[1052]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth
/var/log/syslog.1:Oct 13 19:07:58 snowman dnsmasq[1052]: DBus support enabled: connected to system bus
/var/log/syslog.1:Oct 13 19:07:58 snowman dnsmasq[1052]: warning: no upstream servers configured
/var/log/syslog.1:Oct 13 19:07:59 snowman NetworkManager[840]: <warn> dnsmasq appeared on DBus: :1.13
/var/log/syslog.1:Oct 13 19:07:59 snowman dnsmasq[1052]: setting upstream servers from DBus
/var/log/syslog.1:Oct 13 19:07:59 snowman dnsmasq[1052]: using nameserver 192.168.1.1#53
/var/log/syslog.1:Oct 13 19:07:59 snowman dnsmasq[1052]: using nameserver 10.1.90.6#53
/var/log/syslog.1:Oct 13 19:07:59 snowman dnsmasq[1052]: using nameserver 10.4.4.9#53

显然,dnsmasq 能够正确地自动检测我的连接的所有上游名称服务器。但是,我的系统不知何故无法查询所有系统的 DNS 解析。

ping: unknown host source

相关nslookup输出:

> server
Default server: 127.0.1.1
Address: 127.0.1.1#53
> source
Server:     127.0.1.1
Address:    127.0.1.1#53

** server can't find source: NXDOMAIN
> server 10.1.90.6
Default server: 10.1.90.6
Address: 10.1.90.6#53
> source
Server:     10.1.90.6
Address:    10.1.90.6#53

Name:   source.<REDACTED>
Address: 10.4.4.44

以下是在我的系统上运行的完整 dnsmasq 命令:

1052 ?        S      0:00 /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/run/sendsigs.omit.d/network-manager.dnsmasq.pid --listen-address=127.0.1.1 --conf-file=/var/run/NetworkManager/dnsmasq.conf --cache-size=0 --proxy-dnssec --enable-dbus=org.freedesktop.NetworkManager.dnsmasq --conf-dir=/etc/NetworkManager/dnsmasq.d

答案1

我最终必须将 dnsmasq conf 文件从 复制/usr/share/doc/dnsmasq-base/examples/dnsmasq.conf.example/etc/NetworkManager/dnsmasq.d/dnsmasq.conf,启用它strict-order以便它命中所有名称服务器,然后sudo restart network-manager重新启动 dnsmasq 服务。

我认为禁用的默认行为不strict-order正确。我想我会在 Launchpad 上提交错误...

相关内容