'dnsmasq forwards local request despite domain-needed

From a new Debian 11 installation, I use the following dnsmasq configuration

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

So Dnsmasq should not forward a no-full qualified request to the server.

But when I run host nowhere, /var/log/syslog shows the following lines

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

So the request is forward to 8.8.8.8.

Is it a bug ?



Solution 1:[1]

domain-needed is only for A and AAAA queries. Your log shows only MX query forwarding.

-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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mak