dnsmasq配置问题

早上。 尝试在我的小型网络上设置dnsmasq,但遇到了一些麻烦。

跑步

 dig cnn.com

; <<>> DiG 9.11.5-P4-5.1ubuntu2.1-Ubuntu <<>> cnn.com
;; global options: +cmd
;; connection timed out; no servers could be reached

直接尝试检查我的服务器,我得到以下信息:

nslookup cnn.com 172.16.99.50 
Server:         172.16.99.50 
Address:   172.16.99.50#53

Non-authoritative answer: Name:   cnn.com 
Address: 151.101.1.67 
Name: cnn.com 
Address: 151.101.129.67 
Name:   cnn.com 
Address: 151.101.65.67
...

查看dnsmasq服务,我看到以下内容:

status dnsmasq.service 
dnsmasq.service - dnsmasq - A lightweight
DHCP and caching DNS server    Loaded: loaded
(/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2020-02-07 13:08:31 IST; 15min ago 
Process: 2232 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited,
status=0/SUCCESS)   Process: 2233 ExecStart=/etc/init.d/dnsmasq
systemd-exec (code=exited, status=0/SUCCESS)   Process: 2259
ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf
(code=exited, status=0/SUCCESS)  Main PID: 2258 (dnsmasq)
    Tasks: 1 (limit: 4915)    Memory: 2.2M    CGroup: /system.slice/dnsmasq.service
           └─2258 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -r /run/dnsmasq/resolv.conf -7
/etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new --local-serv

Feb 07 13:08:26 Rain dnsmasq[2232]: dnsmasq: syntax check OK. Feb 07
13:08:26 Rain dnsmasq[2258]: started, version 2.80 cachesize 150 Feb
07 13:08:26 Rain dnsmasq[2258]: compile time options: IPv6 GNU-getopt
DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC
loop-detect inotify dump Feb 07 13:08:26 Rain dnsmasq[2258]: using
nameserver 8.8.4.4#53 Feb 07 13:08:26 Rain dnsmasq[2258]: using
nameserver 8.8.8.8#53 Feb 07 13:08:26 Rain dnsmasq[2258]: using local
addresses only for domain xxxxx.local
**Feb 07 13:08:26 Rain dnsmasq[2258]: no servers found in /run/dnsmasq.resolv.conf, will retry** Feb 07 13:08:26 Rain
dnsmasq[2258]: bad name at /etc/hosts line 12 Feb 07 13:08:26 Rain
dnsmasq[2258]: read /etc/hosts - 45 addresses Feb 07 13:08:31 Rain
systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS
server.

/run/dnsmasq/resolv.conf文件为空(显然在重新启动服务时被覆盖)。

在dnsmasq上,我将no-resolve选项设置为忽略/etc/resolv.conf文件 因此,我认为将查询指向本地dnsmasq实例是有问题的,因为如果我明确指出,那么事情就可以了。 任何想法dnsmasq会在哪里使用/run/dnsmasq/resolv.conf文件的定义?

还有其他故障排除步骤吗?

提前致谢 !

评论