[systemd-devel] systemd-resolve and name servers order

Rafał Jankowski jankowsr at oceanic.wsisiz.edu.pl
Wed Oct 11 07:41:25 UTC 2023


I hope this is the right mailing list to ask that kind of question. I'm 
following what is recommended on github issue tracker: 
https://github.com/systemd/systemd/issues/new/choose
If it's not - feel free to point me to a different place.

I use azure ubuntu 20.04 build with nameservers obtained by DHCP (there 
are three custom nameservers assigned to Azure private Vnet and they are 
owned by my company).
These three nameservers are not equal. So the first server provides 
different answers than the second and the third server.
I don't know if there is any specification (such as RFC) that says 
resolver should follow name servers order or not. I guess there is not 
since systemd-resolve seems to use any random DNS server from the list.
In the traditional /etc/resolv.conf without systemd-resolve order I 
think was followed. With systemd-resolve it's not. So in case of using 
three name servers obtained by DHCP where these DNS servers are not 
equal I receive sub-optimal responses. My guess is this whole design 
(with assumption that the first server on the list will be preferred) is 
not quite right. Anyway my question is - is there a way to instruct 
systemd-resolve to follow the order of name servers on the list (so 
treat them as primary, secondary, tertiary with a preference order and 
always prefer DNS server that is higher on the list if only it is 
available)?


More information about the systemd-devel mailing list