mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 19:25:56 +03:00
[GH-ISSUE #612] Query multiple nameservers in parallel #252
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#252
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @stuartnelson3 on GitHub (Nov 11, 2018).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/612
Is your feature request related to a problem? Please describe.
Querying multiple nameservers in parallel is something done by musl to improve performance, cf. https://wiki.musl-libc.org/functional-differences-from-glibc.html#Name-Resolver/DNS.
My feature request is to allow this functionality.
Describe the solution you'd like
Allow setting parallel lookups in ResolverOpts, and limiting the number of parallel lookups at a time. For example, maybe I only want have 3 parallel requests at once (a la musl). Related to #606, I can further say to take the first response that isn't a failure, or if all fail, returning one of those. This requires some thought as a response is then only as fast as it's slowest failure (or timeout).
Describe alternatives you've considered
If a SERVFAIL didn't abort trying other nameservers, that would be an alternative, albeit trying requests in serial is not ideal typically.
Additional context
See #606
@bluejekyll commented on GitHub (Nov 11, 2018):
FYI, I’ve got a patch coming for #606. This one, we’ll have to consider options on. I think we might want to have a maximum on the number of parallel queries, and default to 2 or so.
@stuartnelson3 commented on GitHub (Nov 12, 2018):
Makes sense. It might be easier to say max number of nameservers. If we allow more nameservers than parallel attempts, what is the behavior if all nameservers in the N that get queried fail? Continue trying with the next batch, or fail, and start priority sorting nameservers...
I think musl's policy makes sense: set a max number of nameservers to be queried.
@bluejekyll commented on GitHub (Nov 12, 2018):
Perhaps both a max nameserver attempts and max parallel requests would be best? There already exists a max_retries option so we should consider its relationship to these new options.
I haven’t really considered exactly how to implement this yet, but we should be able to pop N nameservers from the set of M in the pool, wher N is the number to execute in parallel. Then in the case where no nameserver returned a successful result, use the existing loop to continue popping N until we’ve attempted all M, unless we hit the max_attempts as described here.
@stuartnelson3 commented on GitHub (Nov 12, 2018):
Sounds reasonable to me
@bluejekyll commented on GitHub (Nov 14, 2018):
PR #615 is the current proposed fix for this, I think it's simple enough to incorporate. Right now it defaults to 2 concurrent requests.
lookup_ipshould checkout/etc/hosts/before dns requests? #387