NM, dnsmasq & systemd-resolved...

Petr Menšík pemensik at redhat.com
Tue Jul 29 19:10:18 UTC 2025


Hi!

I maintain dnsmasq on Fedora.

I think this comes from the NM plugin code for dnsmasq [1]. This is to 
avoid listening on all addreses on lo interface. This specifies only 
IPv4 localhost, not IPv6 localhost address, because there is reasonable 
assumption it is always present.

If there was just --interface=lo, it may listen also on ::1 and any 
additional addresses present on the interface. Which is not wanted usually.

You can add any extra interfaces or addresses to listen on in additional 
config file. But sadly there is no simple way to suppress 127.0.0.1 what 
were already explicitly given on the command line.

There is no simple way to listen on both 127.0.0.1 and ::1 if present, 
but continuing in case of ::1 is missing. Therefore it does not listen 
on ::1 from NM, but usually does when started from separate systemd 
service. Makes dig @localhost print errors, but I do not know any nice 
solution working always.

Cheers,
Petr

[1] 
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/1.52.1/src/core/dns/nm-dns-dnsmasq.c?ref_type=tags#L526

On 01/07/2025 22:08, Morgan Read wrote:
> On 01/07/2025 3:48 pm, Morgan Read wrote:
>
>>> The part of the reported dnsmasq config I take offence to is 
>>> `--listen-address=127.0.0.1` and my question is, where on earth is
>>> this coming from?
>>
>> Maybe NM starts dnsmasq.
>
> Absolutely, with my original post I include:
>> ---next-file->>>: /etc/NetworkManager/conf.d/00-use-dnsmasq.conf
>>
>> # /etc/NetworkManager/conf.d/00-use-dnsmasq.conf #
>> # This enabled the dnsmasq plugin.
>> ### 
>> https://docs.fedoraproject.org/en-US/fedora-server/administration/dnsmasq/
>> ### https://fedoramagazine.org/using-the-networkmanagers-dnsmasq-plugin/
>> ### See also https://access.redhat.com/solutions/2189401#nm-helper
>>
>> [main]
>> dns=dnsmasq
>
> But, there's no `--listen-address=127.0.0.1` anywhere in there.
>
> Many thanks
> M

-- 
Petr Menšík
Senior Software Engieer, RHEL
Red Hat, https://www.redhat.com/
PGP: DFCF908DB7C87E8E529925BC4931CA5B6C9FC5CB



More information about the Networkmanager mailing list