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
No new DNS Server selected after currently selected DNS server does no longer respond and concurrent DNS requests #17040
If more then one DNS server are configured, and the currently selected DNS server does no longer respond to DNS requests, I would expect, that from the list of configured DNS server, excluding the DNS server who are in a failed state, the first is selected as the new currently selected DNS server
Unexpected behaviour you saw
With many cuncurrent DNS requests no new DNS server gets selected for more then one request. Instead a round-robin over all configured DNS server (even the failed one) is made.
Steps to reproduce the problem
I reproduced the issue with the following setup:
Configure iptables to route 10.0.0.0:53 to 8.8.8.8:53 (the problem does not occur if traffic is dropped on the local node, probably because resolved is somehow informed, that the dns packages were dropped and switches immediately instead of waiting for the timeout):
I think the issue is not the same as #5755 because in #5755 it is explained in the comments that both DNS servers are having timeouts and the switching occurs for that reason. In my case I have three perfectly fine DNS servers which as far as I can tell never did not reply to a request and one faulty one, which no longer replies to any requests. I would expect that one of the remaining three is chosen as the new 'Current DNS Server' and no round-robin over all (even the faults) DNS servers is made.
it is because that thread is biiig, but your behavior is discussed there too. Basically, the core of this discussion is to move into default resolv.conf that is what you are saying after fail one, try the next one.
resolv.conf also has this option to round-robin (but it is a flag optional) that de-facto is what systemd implements. It is a huge thread but you can find every kind of opinion there.
I did read the hole thread prior to opening this bug report and looked over it again now and can not find any post where my behavior is discussed. Can you please point me to the corresponding post?
If the meaning of your post is, that this is the same behavior as described in my report, then let me point out a simple differences:
The primary DNS server in my issue does not answer any requests at all. My issue is that the faulty primary DNS server is still tried for DNS answers even if perfectly fine working DNS server are configured and answering DNS requests correctly!
And for further clarification: my issue is not that no fallback is done to the first configured DNS server or that not all configured DNS servers are queried.
Maybe I am wrong on this but I think both issues are related in the sense that, at least in my experience (which I tested a while ago and might have changed) the nameservers seem to be rotated without reason.
For what I understand, systemd-resolved selects an active nameserver and when this fails, it selects a different one in round robin. Although I believe it is true that the failed nameserver is not "marked" as failed and will be retried, the problem is that it keeps switching nameservers even if the active one works.
Sorry, if I misunderstood your intention. But I also think it is farfetched, that the problem I described, that after a correct start of switching the primary DNS Server no new primary DNS server gets permanently selected and the claimed switching of working DNS servers, are related, because both the trigger (primary DNS server failure in my case vs. unknown cause in switching working primary DNS server) and the triggered process (no new primary DNS server is permanently selected vs. a new primary DNS server is selected) do not match. Also, the problem of switching working primary DNS server is in the trigger, while the problem in not selecting permanently a new primary DNS server is in the triggered process. But I concede that this is only a clue and no proof.
Hmm, so let me get this right: when a ton of parallel requests all fail, each time we switch DNS servers, and you'd prefer we'd instead just switch once? i.e. we shouldn't round robin the DNS server unnecessarily: if the current DNS server is already different than the one we originally tried there's no point in switching.
Sorry, for my late reply, I did somehow miss your reply. Your proposed solution will fix our problem and Iooks like the best solution. Thanks for working on this issue.
Activity
StefanYohansson commentedon Sep 14, 2020
same as #5755
vicinus commentedon Sep 14, 2020
I think the issue is not the same as #5755 because in #5755 it is explained in the comments that both DNS servers are having timeouts and the switching occurs for that reason. In my case I have three perfectly fine DNS servers which as far as I can tell never did not reply to a request and one faulty one, which no longer replies to any requests. I would expect that one of the remaining three is chosen as the new 'Current DNS Server' and no round-robin over all (even the faults) DNS servers is made.
StefanYohansson commentedon Sep 14, 2020
it is because that thread is biiig, but your behavior is discussed there too. Basically, the core of this discussion is to move into default resolv.conf that is what you are saying after fail one, try the next one.
resolv.conf also has this option to round-robin (but it is a flag optional) that de-facto is what systemd implements. It is a huge thread but you can find every kind of opinion there.
vicinus commentedon Sep 14, 2020
I did read the hole thread prior to opening this bug report and looked over it again now and can not find any post where my behavior is discussed. Can you please point me to the corresponding post?
diego-treitos commentedon Sep 24, 2020
#5755 (comment)
vicinus commentedon Sep 24, 2020
If the meaning of your post is, that this is the same behavior as described in my report, then let me point out a simple differences:
The primary DNS server in my issue does not answer any requests at all. My issue is that the faulty primary DNS server is still tried for DNS answers even if perfectly fine working DNS server are configured and answering DNS requests correctly!
And for further clarification: my issue is not that no fallback is done to the first configured DNS server or that not all configured DNS servers are queried.
diego-treitos commentedon Sep 24, 2020
Maybe I am wrong on this but I think both issues are related in the sense that, at least in my experience (which I tested a while ago and might have changed) the nameservers seem to be rotated without reason.
For what I understand,
systemd-resolvedselects an active nameserver and when this fails, it selects a different one in round robin. Although I believe it is true that the failed nameserver is not "marked" as failed and will be retried, the problem is that it keeps switching nameservers even if the active one works.vicinus commentedon Sep 24, 2020
Sorry, if I misunderstood your intention. But I also think it is farfetched, that the problem I described, that after a correct start of switching the primary DNS Server no new primary DNS server gets permanently selected and the claimed switching of working DNS servers, are related, because both the trigger (primary DNS server failure in my case vs. unknown cause in switching working primary DNS server) and the triggered process (no new primary DNS server is permanently selected vs. a new primary DNS server is selected) do not match. Also, the problem of switching working primary DNS server is in the trigger, while the problem in not selecting permanently a new primary DNS server is in the triggered process. But I concede that this is only a clue and no proof.
poettering commentedon Oct 1, 2020
Hmm, so let me get this right: when a ton of parallel requests all fail, each time we switch DNS servers, and you'd prefer we'd instead just switch once? i.e. we shouldn't round robin the DNS server unnecessarily: if the current DNS server is already different than the one we originally tried there's no point in switching.
Is that the request?
vicinus commentedon Dec 29, 2020
Sorry, for my late reply, I did somehow miss your reply. Your proposed solution will fix our problem and Iooks like the best solution. Thanks for working on this issue.
resolved: don't redundantly switch DNS servers because of transaction…
resolved: don't redundantly switch DNS servers because of transaction…