以下是我从命令行调试此问题的方法:
$ dnsmasq --no-daemon --log-queries
Run Code Online (Sandbox Code Playgroud)
将log-queries选项放入配置文件中并将其作为守护进程运行,日志文件中仍然没有显示任何内容。我期待当我这样做时dig example.com,它应该出现。
这是上面命令的输出:
dnsmasq: started, version 2.89 cachesize 150
dnsmasq: compile time options: IPv6 GNU-getopt DBus no-UBus i18n IDN2 DHCP DHCPv6 no-Lua TFTP conntrack ipset nftset auth cryptohash DNSSEC loop-detect inotify dumpfile
dnsmasq: reading /etc/resolv.conf
dnsmasq: using nameserver 8.8.8.8#53
dnsmasq: using nameserver 1.1.1.1#53
dnsmasq: using nameserver 2001:4860:4860::8888#53
dnsmasq: using nameserver 2001:4860:4860::8844#53
dnsmasq: read /etc/hosts - 7 names
Run Code Online (Sandbox Code Playgroud)
Ubuntu版本:23.10
内核6.5.0
dnsmasq版本:2.89