resolved falls back to a non-preferred name server when the preferred name server appears to be working.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
systemd (Ubuntu) |
Expired
|
Undecided
|
Unassigned |
Bug Description
This is split from bug #2007728.
On a network with multiple DNS servers provided by DHCP, the "Current DNS Server" shown by `resolvectl status` is sometimes not the first server or even the second server, even when those servers appear to be working (and other hosts continue to use them). This appears to occur on Ubuntu 22.04 but not on Ubuntu 20.04, Ubuntu 18.04, or Windows 10.
RFC 2132 section 3.8 provides that servers are listed in order of preference.
It seems that the correct behavior is that resolved picks as its "Current DNS Server" the first reachable server in the list provided by the DHCP server. The observed behavior is that resolved sometimes picks as its "Current DNS Server" some server other than the first reachable server in the list.
My hypothesis is that there is some name server availability check that is too stringent and that there is no mechanism to retry the preferred server after that check fails. I have not looked at the code or captured packets.
I was able to reproduce on Ubuntu 20.04 too (by switching the active network interface), so this may not be a recent regression.