dnsmasq 转发本地请求,尽管需要域

dnsmasq forwards local request despite domain-needed

在新的 Debian 11 安装中,我使用以下 dnsmasq 配置

domain-needed
log-queries
no-resolv
no-hosts
server=8.8.8.8

因此 Dnsmasq 不应将不完全合格的请求转发到服务器。

但是当我 运行 host nowhere, /var/log/syslog 显示以下几行

Mar 11 20:52:42 gateway dnsmasq[3904]: query[A] nowhere from 127.0.0.1
Mar 11 20:52:42 gateway dnsmasq[3904]: config nowhere is NODATA-IPv4
Mar 11 20:52:42 gateway dnsmasq[3904]: query[AAAA] nowhere from 127.0.0.1
Mar 11 20:52:42 gateway dnsmasq[3904]: config nowhere is NODATA-IPv6
Mar 11 20:52:42 gateway dnsmasq[3904]: query[MX] nowhere from 127.0.0.1
Mar 11 20:52:42 gateway dnsmasq[3904]: forwarded nowhere to 8.8.8.8

所以请求转发到8.8.8.8.

这是一个错误吗?

domain-needed 仅适用于 A 和 AAAA 查询。您的日志仅显示 MX 查询转发。

-D, --domain-needed Tells dnsmasq to never forward A or AAAA queries for plain names, without dots or domain parts, to upstream nameservers. If the name is not known from /etc/hosts or DHCP then a "not found" answer is returned.