You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
systemd-resolved keeps static order of DNS records #16297
Is your feature request related to a problem? Please describe.
When resolving a host which has multiple A records, systemd-resolved always returns the A records in the same order:
While upstream servers may randomize the order upon each query, systemd-resolved keeps the order static within the cache lifetime.
This prevents simple load balancing and, if the first server in the list has an issue, that issue is seen permanently locally.
One example would be if the first server in the list causes SSH connection attempts to hang, which prevents SSH from retrying other servers in the list.
Describe the solution you'd like
Randomization of records to provide load balancing, as other caching resolvers do (e.g. dnsmasq).
Reacted by darkdragon-001, Dominique DERRIER, jellytoo and Zhanwei Wang
Thanks, that's an interesting read indeed. So that clarifies this is not a "bug" per-se in system-resolved, still, it behaves differently from other resolvers, which either emulate the shuffling of upstream servers or keep the order.
The problem is that even though I believe the article is correct, shuffling by DNS order may still be useful: When you don't need fault tolerance and traffic locality, and an actual load balancer is not an option (e.g. for SSH you pay the price of bandwidth, which you can't always do), randomly having the client choose from a list is still a good option.
SSH clients themselves, though, can't do that. Luckily, all DNS cachers I know do either keep the upstream DNS server order or even shuffle the records.
Is there a specific reason why systemd-resolved chose a different approach? While certainly not wrong, it is very different from how other software behaves.
Hi,
I've got the same issue.
(I'm using the poooooor loadbalancing over DNS to avoid other solution - nginx/haproxy).
Is a patch is available insted of using dnsmasq.
Activity
jdebp commentedon Jul 9, 2020
http://jdebp.uk./FGA/dns-round-robin-is-useless.html will be salutary reading at this point.
olifre commentedon Jul 9, 2020
Thanks, that's an interesting read indeed. So that clarifies this is not a "bug" per-se in
system-resolved, still, it behaves differently from other resolvers, which either emulate the shuffling of upstream servers or keep the order.The problem is that even though I believe the article is correct, shuffling by DNS order may still be useful: When you don't need fault tolerance and traffic locality, and an actual load balancer is not an option (e.g. for SSH you pay the price of bandwidth, which you can't always do), randomly having the client choose from a list is still a good option.
SSH clients themselves, though, can't do that. Luckily, all DNS cachers I know do either keep the upstream DNS server order or even shuffle the records.
Is there a specific reason why
systemd-resolvedchose a different approach? While certainly not wrong, it is very different from how other software behaves.whoo commentedon Sep 28, 2020
Hi,
I've got the same issue.
(I'm using the poooooor loadbalancing over DNS to avoid other solution - nginx/haproxy).
Is a patch is available insted of using dnsmasq.
Regards.
resolved: randomize RR order in answers each time we get something fr…
resolved: randomize RR order in answers each time we get something fr…