mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 03:05:51 +03:00
[PR #3310] [MERGED] Use Message in Lookup instead of [Record] to preserve section information #3730
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#3730
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/3310
Author: @bryanlarsen
Created: 10/13/2025
Status: ✅ Merged
Merged: 12/15/2025
Merged by: @djc
Base:
main← Head:feature/dns-section-preservation📝 Commits (10+)
99c143bresolver: move LookupRecordIter next to LookupItera38e84cuse Message in Lookup instead of [Record]ced3997server: remove AuthLookupIter::Resolved342c780util: print all sections in resolve util82aeedaresolver: rework caching client record filtering158067fresolver: centralize DNSSEC record stripping2c8426dserver: catalog resp as Message, comprehensive DNSSEC strip9a44553resolver: use edns_set_dnssec_ok from context opts557c845resolver: as a forwarder, strip RRSIGs appropriately8355ef3server: preserve message sections when forwarding📊 Changes
15 files changed (+1767 additions, -648 deletions)
View changed files
📝
conformance/conformance-tests/src/forwarder/dnssec/scenarios.rs(+62 -1)📝
crates/proto/src/dnssec/mod.rs(+38 -1)📝
crates/proto/src/op/message.rs(+43 -1)📝
crates/resolver/examples/flush_cache.rs(+16 -5)📝
crates/resolver/src/caching_client.rs(+928 -116)📝
crates/resolver/src/hosts.rs(+117 -89)📝
crates/resolver/src/lookup.rs(+225 -246)📝
crates/resolver/src/lookup_ip.rs(+38 -22)📝
crates/resolver/src/recursor/handle.rs(+2 -10)📝
crates/resolver/src/recursor/mod.rs(+4 -34)📝
crates/resolver/src/resolver.rs(+40 -23)📝
crates/server/src/zone_handler/auth_lookup.rs(+2 -7)📝
crates/server/src/zone_handler/catalog.rs(+215 -78)📝
tests/integration-tests/tests/integration/lookup_tests.rs(+12 -12)📝
util/src/bin/resolve.rs(+25 -3)📄 Description
Fixes #2781
In Lookup, replace the
records: Arc<[Record]>field withmessage: Message. This allows users of the Lookup, such as theresolveutil to print section information. It also ensures that section information is not lost when using hickory as a forwarderupdate the
resolveutil to print section informationhandle_noerror in caching_client.rs, which does cname and SRV chasing changed considerably as a consequence. I assumed that some of the filtering previously done in this code was there because all records were being put into the answers section. Now that we preserve sections, I don't think this filtering is necessary. Changes to this function should be carefully reviewed.
many of the previous functions on Lookup became ambiguous. For example, should iter() iterate over answers or all_sections? In the discussion it was decided that these functions should be removed. Users now have better options. They can use message() to access the Message and use it's accessors. Or they can use the LookupIp wrapper which has less ambiguous iterators. These removals have been split into multiple commits so it's easy to undo some of the removals while keeping others.
one dnssec conformance test broke with the initial changes. Stripping of RRSIG records was happening accidentally and unconditionally. This PR makes the stripping conditional on dnssec_ok, puts it in an appropriately named function, and adds a conformance test for both dnssec_ok true and false.
moved DnssecIter into the proto crate. Lookup had a method dnssec_iter() which didn't have an equivalent in Message. So rather than leaving dnssec_iter() on Lookup, DnssecIter was moved to the Proto crate and dnssec_answers() added to the Message struct.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.