Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prioritize cached DNS results over DNS resolver results #5918

Closed
link2xt opened this issue Aug 26, 2024 · 0 comments · Fixed by #6045
Closed

Prioritize cached DNS results over DNS resolver results #5918

link2xt opened this issue Aug 26, 2024 · 0 comments · Fixed by #6045
Assignees

Comments

@link2xt
Copy link
Collaborator

link2xt commented Aug 26, 2024

If DNS resolver returns a lot of results we should not prioritize all of them over cached results. DNS server may be misconfigured, return malicious results (100 of blackhole IP addresses that never respond and take 1 minute each to connection timeout on them) etc. Even with parallelization #5915 it may take a long time to try all the results.

lookup_host_with_cache should return DNS results first, but probably take some fixed number of them e.g. first two or the first one and random one, then follow with cached recently working results and then return some of the remaining DNS resolver results. So DNS load balancing should still work and on a good network we should try the first returned DNS result first, but if DNS results are bad it should never take forever until we try the IP address that worked last time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
@link2xt and others