mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 03:05:51 +03:00
[GH-ISSUE #1860] Empty NOERROR responses from trusted resolvers are incorrectly retried #794
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#794
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 @jeff-hiner on GitHub (Dec 15, 2022).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1860
Describe the bug
Empty authoritative NOERROR responses from trusted resolvers should not be retried elsewhere.
Many domains are valid but aren't able to serve IPv6 traffic. A compliant resolver will respond to an AAAA record request for such a domain with an authoritative response: an empty answer set, and one or more SOA records describing how it was able to make the determination. This is not an error, nor does it imply that a client should ask other resolvers for a "better" answer.
This means a lookup matching this pattern will not return until every resolver in the list has been queried. In practice, a single slow or misbehaving DNS server in the list can cause these queries to take far longer than they should, even if queries are run in parallel.
To Reproduce
This is most easily demonstrated with a set of serialized servers.
Create a
ResolverConfigwith more than one DNS server in the list. (I use1.1.1.1and1.0.0.1but you can pick any two valid DNS servers.) Make sure thetrust_nx_responsesfield for each resolver istrue.Build a
ResolverOpts, setting itsnum_concurrent_reqsto1to serialize server hits, andserver_ordering_strategytoServerOrderingStrategy::UserProvidedOrderfor repeatability.Create an
AsyncResolverwith the pieces above. Successful requests should complete after receiving a response from the first resolver in the list, and not query the second resolver. Monitor DNS traffic using wireshark, and send an A record request that you know is valid. Note that no query is issued to the second resolver. Now try issuing a AAAA request with no records.m.dict.cc.works fine for this. Note that the response comes back from the first resolver, and thentrust-dnsqueries the next server.For extra fun, try appending an IP address to the server set that's blackholed or unreachable. Regardless of how
num_concurrent_reqsis set, empty AAAA queries will wait until the bad server times out before returning a result.Expected behavior
For records that may return empty answer sets, like HTTPS or AAAA against domains that don't host IPv6, the resolver should return the first NOERROR immediately without having to wait for responses from every resolver in the set.
System:
Version:
Crate: resolver
Version: main
Additional context
Amusingly, the existing behavior is documented in
NameServerConfig. But it's not correct.