NM starts dnsmasq with --listen-address=127.0.0.1 and that doesn't work for ipv6
When configured:
$ cat /etc/NetworkManager/conf.d/dns.conf
[main]
dns=dnsmasq
dnsmasq
is run as:
/usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/var/run/NetworkManager/dnsmasq.pid --listen-address=127.0.0.1 --cache-size=400 --clear-on-reload --conf-file=/dev/null --proxy-dnssec --enable-dbus=org.freedesktop.NetworkManager.dnsmasq --conf-dir=/etc/NetworkManager/dnsmasq.d
which results in resolution failures:
host www.seznam.cz localhost
;; communications error to ::1#53: connection refused
;; communications error to ::1#53: connection refused
Using domain server:
Name: localhost
Address: 127.0.0.1#53
Aliases:
www.seznam.cz has address 77.75.77.222
www.seznam.cz has address 77.75.79.222
;; communications error to ::1#53: connection refused
;; communications error to ::1#53: connection refused
www.seznam.cz has IPv6 address 2a02:598:a::79:222
www.seznam.cz has IPv6 address 2a02:598:2::1222
;; communications error to ::1#53: connection refused
;; communications error to ::1#53: connection refused
because
telnet ::1 53
Trying ::1...
telnet: connect to address ::1: Connection refused
If I run a separate dnsmasq.service
on port 5353 (compare to NM's one on 53), it listens on ::/0.0.0.0
:
udp UNCONN 0 0 0.0.0.0:5353 0.0.0.0:* users:(("dnsmasq",pid=2950,fd=4))
udp UNCONN 0 0 127.0.0.1:53 0.0.0.0:* users:(("dnsmasq",pid=20555,fd=4))
udp UNCONN 0 0 [::]:5353 [::]:* users:(("dnsmasq",pid=2950,fd=6))
tcp LISTEN 0 32 127.0.0.1:53 0.0.0.0:* users:(("dnsmasq",pid=20555,fd=5))
tcp LISTEN 0 32 0.0.0.0:5353 0.0.0.0:* users:(("dnsmasq",pid=2950,fd=5))
tcp LISTEN 0 32 [::]:5353 [::]:* users:(("dnsmasq",pid=2950,fd=7))
So the listen address should be likely ::1
or both ::1
and 127.0.0.1
: