Hi,
I recently switched to systemd coming from OpenRC on a Gentoo system.
Currently installed version is: systemd-257.9 .
I have an issue with systemd-resolved: when the network changes (for
example from a home wireless network to a mobile hotspot with
different uplink), the DNS servers are not updated.
In the resolved log, I see that the DNS server list is received
correctly from DHCP, but I don't see that reflected in the output of
'resolvectl', and actual DNS resolution does not work.
Initially I was using networkd and resolved (stub resolv.conf)
together. In that scenario, restarting networkd after switching
wireless network, fixed the DNS resolution. But I don't want to
manually restart networkd just to get DNS working, this shouldn't be
necessary.
With NetworkManager and /etc/resolv.conf pointing to resolved's stub
resolver, the problem is also present.
With NetworkManager and /etc/resolv.conf pointing to NetworkManager's
copy, there is no issue.
I have searched the internet for this issue, but don't find people
with that issue, or the root cause of their problem does not apply to
my system.
Here is what shows in the resolved log, for example also when you
restart resolved:
Oct 15 20:41:11 hostname systemd-resolved[3065052]: wlp0s20f3: Bus
client set search domain list to: home
Oct 15 20:41:11 hostname systemd-resolved[3065052]: wlp0s20f3: Bus
client set default route setting: yes
Oct 15 20:41:11 hostname systemd-resolved[3065052]: wlp0s20f3: Bus
client set DNS server list to: 195.130.131.4, 195.130.130.4
Oct 15 20:41:12 hostname systemd-resolved[3065052]: wlp0s20f3: Bus
client set search domain list to: ~.
resolvectl shows:
Global
Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: stub
Link 2 (enp0s31f6)
Current Scopes: none
Protocols: -DefaultRoute -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Default Route: no
Link 3 (wlp0s20f3)
Current Scopes: none
Protocols: -DefaultRoute -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
DNS Domain: ~.
Default Route: no
Link 4 (docker0)
Current Scopes: none
The non-commented lines of the resolved config file:
$ rg -v '^#' /etc/systemd/resolved.conf | cat
[Resolve]
DNSSEC=no
DNSSEC=no
MulticastDNS=no
LLMNR=no
Cache=no
FallbackDNS=
(Initially only DNSSEC=no was present, I added the other lines
aligning with someone else's working system, and the FallbackDNS= line
to avoid masking the issue)
/etc/resolv.conf is a symlink to the stub resolver:
$ ls -l /etc/resolv.conf
lrwxrwxrwx 1 root root 37 Oct 15 19:32 /etc/resolv.conf ->
/run/systemd/resolve/stub-resolv.conf
I didn't become much wiser from debug logs for resolved. The output is
huge and I don't know what to look for.
I did notice some messages like
"Using degraded feature set TCP instead of UDP for DNS server xxxx"
but also the inverse message is present, so I don't know if this is relevant:
"Using degraded feature set UDP instead of TCP for DNS server xxxx"
Looking forward to your suggestions.
Thanks,
Thomas