1

I'm wondering what DNS servers systemd-resolved will use when no domains are set. Does it use the Global DNS server or use one of the Link DNS servers? For example, when there are no domains set:

$ resolvectl domain
Global:
Link 217 (vethcad2158):
Link 215 (vethbcc93d0):
Link 213 (veth97a2e2d):
Link 205 (vethea47238):
Link 201 (vethfd64a0e):
Link 3 (docker0):
Link 2 (ens160):

And we have Global DNS servers configured via /etc/systemd/resolved.conf and also from a Link via DHCP:

$ resolvectl dns
Global: 10.3.0.21
Link 217 (vethcad2158):
Link 215 (vethbcc93d0):
Link 213 (veth97a2e2d):
Link 205 (vethea47238):
Link 201 (vethfd64a0e):
Link 3 (docker0):
Link 2 (ens160): 10.3.0.21 10.3.0.22 10.3.0.23 8.8.8.8 8.8.4.4

Does systemd-resolved default to sending everything to Global if there are no domains set, or would it chose to send to Link 2 for anything? If the Global DNS server (10.3.0.21) doesn't respond, will it round-robin through the Link 2 DNS servers? If yes, when (if ever) does systemd-resolved decide when to try the Global DNS server again?

This line from the systemd-resolved documentation seems relevant:

If a query does not match any configured routing domain (either per-link or global), it is sent to all DNS servers that are configured on links with the DefaultRoute= option set, as well as the globally configured DNS server.

So my guess is that it will use all configured DNS servers, from both Global and Links. What's the priority? Will it start with Global and continue using that until/unless the Global DNS server doesn't respond? And the doc says the query "is sent to all DNS servers", does that mean it will actually send a single query to every configured DNS server at once, perhaps taking the response from whichever server responds first?

Sorry for all the questions and thanks for any and all information!

0

1 Answer 1

1

This is an interesting article on the topic. It says:

... When there are multiple matches of the same length on different interfaces, they are resolved in parallel.

It were great if resolvectl query had an option to enable verbose output showing which DNS server in the end provided the resolution to the query, like dig used to do...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .