Where does NM get it's config...? A deceptively simple question

Hi Folks,

I have this output from systemctl status NetworkManager:

● NetworkManager.service - Network Manager
     Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; preset: enabled)
     Active: active (running) since Sun 2025-06-22 20:51:33 BST; 20min ago
       Docs: man:NetworkManager(8)
   Main PID: 197893 (NetworkManager)
      Tasks: 4 (limit: 614448)
     Memory: 14.0M
        CPU: 332ms
     CGroup: /system.slice/NetworkManager.service
             ├─197893 /usr/sbin/NetworkManager --no-daemon
             └─197935 /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/run/NetworkManager/dnsmasq.pid --listen-address=127.0.0.1 --cache-size=400 --clear-on-reload --conf-file=/dev/null --enable-dbus=org.freedesktop.NetworkManager.dnsmasq --conf-dir=/etc/NetworkManager/dnsmasq.d

Jun 22 21:12:07 server dnsmasq[197935]: query[AAAA] optimizationguide-pa.googleapis.com from 192.168.1.142
Jun 22 21:12:07 server dnsmasq[197935]: forwarded optimizationguide-pa.googleapis.com to 1.1.1.1
Jun 22 21:12:07 server dnsmasq[197935]: query[AAAA] optimizationguide-pa.googleapis.com from 192.168.1.188

And, the question is, where does --listen-address=127.0.0.1 come from?

It’s not in the dnsmasq configs under /etc/NetworkManager/dnsconfig.d or anywhere else under NM’s config - where’s it getting picked up from and how do I edit it out (given there’s no negative declaration for listen-address in dnsmasq.conf as there is for interface).

Thanks,
M

This doesn’t anwer your question, but NM doesn’t invoke Dnsmasq on my system:

● NetworkManager.service - Network Manager
     Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; preset: enabled)
    Drop-In: /usr/lib/systemd/system/service.d
             └─10-timeout-abort.conf
     Active: active (running) since Wed 2025-06-18 11:02:07 CEST; 4 days ago
 Invocation: ead9f52ca8cb4b509bc0fe37a32b78fa
       Docs: man:NetworkManager(8)
   Main PID: 1339 (NetworkManager)
      Tasks: 4 (limit: 27450)
     Memory: 8.8M (peak: 11M)
        CPU: 17.868s
     CGroup: /system.slice/NetworkManager.service
             └─1339 /usr/bin/NetworkManager --no-daemon

The parameter dns=dnsmasq makes it run a local caching nameserver:
NetworkManager.conf: NetworkManager configuration file | NetworkManager File Formats | Man Pages | ManKier

If you want to avoid limitations, use the standalone dnsmasq service.

Thank you @vgaetera for the ref to the very fine manual - I think it should tell all I need to know… :wink:

I’m keeping an open mind on that one, see final para of my comment here

My mind is now closed:

Thanks @vgaetera , but seriously - who the f’ uses hardcoded configs - completely unbelievable - it was simply so far out of the realm of possibility that it didn’t come close to crossing my mind - I feel like I’ve regressed 30 years to Window 95… Never mind.