mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 03:05:51 +03:00
[PR #2919] [MERGED] Fix QNAME minimization behavior #3421
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#3421
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?
📋 Pull Request Information
Original PR: https://github.com/hickory-dns/hickory-dns/pull/2919
Author: @divergentdave
Created: 4/9/2025
Status: ✅ Merged
Merged: 4/11/2025
Merged by: @djc
Base:
main← Head:david/rfc9156📝 Commits (4)
55c9a12Add test for bug in QNAME minimization handling7c4ff2fSimplify re-query with longer name, fix CNAME bug9f8b676Add a short-circuit for NXDOMAIN responses7e5a1f1Add a short-circuit for timeouts📊 Changes
4 files changed (+104 additions, -38 deletions)
View changed files
📝
conformance/packages/conformance-tests/src/resolver/dns.rs(+1 -0)➕
conformance/packages/conformance-tests/src/resolver/dns/rfc9156.rs(+54 -0)📝
crates/recursor/src/error.rs(+13 -0)📝
crates/recursor/src/recursor_dns_handle.rs(+36 -38)📄 Description
This simplifies the recursor's logic, and fixes #2788. A conformance test is included that reproduces the original issue.
Currently
ns_pool_for_zone()includes a loop that follows "SOA referrals", but this seems to be a non-standard concept. What it was doing, in effect, was taking negative responses for NS queries and using the SOA owner name to get a different name server pool. However, in a well-constructed zone, this should produce an ancestor of the name we just queried for, and the tower of recursivens_pool_for_zone()calls has already constructed a name server pool for that ancestor. Therefore, we can keep passing the parent zone's pool to the caller until we either get another referral or return toresolve()and run the original query against the pool. We do this when the NS query either returns any error or returns zero NS records (fixing the CNAME-related bug). This now better aligns with the algorithm from RFC 9156, because we effectively try again with a longer name in these cases, via the recursive calls already on the stack.In the last commit, I implemented a short-circuit for when we get an NXDOMAIN response to one of the minimized NS queries. The algorithm in RFC 9156 mentions this in the context of interactions with RFC 8020.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.