mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 11:15:54 +03:00
[PR #3343] [MERGED] recursive resolver opportunistic encryption nameserver state persistence #3762
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#3762
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/3343
Author: @cpu
Created: 11/5/2025
Status: ✅ Merged
Merged: 11/19/2025
Merged by: @cpu
Base:
main← Head:cpu-9539-state_dev📝 Commits (7)
f992912server: fix copy-pasta config documentation960bc7cresolver: enc transport state Instant -> SystemTime0313b88resolver: simplify name server transport state56cfe0aresolver: fixup opp enc config duration serdec1ea60fresolver: serde for opp enc transport state typesfef42c7proto: move extra bounds to traitsa1c6b02resolver: encrypted transport state load/periodic save📊 Changes
14 files changed (+400 additions, -70 deletions)
View changed files
📝
crates/proto/src/dnssec/handle.rs(+5 -0)📝
crates/proto/src/runtime.rs(+3 -3)📝
crates/recursor/src/recursor.rs(+10 -1)📝
crates/recursor/src/recursor_dns_handle.rs(+4 -0)📝
crates/resolver/Cargo.toml(+3 -0)📝
crates/resolver/src/config.rs(+35 -4)📝
crates/resolver/src/lib.rs(+2 -0)📝
crates/resolver/src/name_server.rs(+7 -7)📝
crates/resolver/src/name_server_pool.rs(+219 -43)📝
crates/server/Cargo.toml(+1 -1)📝
crates/server/src/store/blocklist.rs(+1 -1)📝
crates/server/src/store/forwarder.rs(+1 -1)📝
crates/server/src/store/recursor.rs(+92 -7)📝
tests/test-data/test_configs/example_recursor_opportunistic_enc.toml(+17 -2)📄 Description
Provide a method for hickory server's running a recursive resolver external zone with opportunistic encryption enabled to load pre-existing state at zone handler creation time, and to periodically have updates to the state saved. Requires the hickory-resolver
tomlfeature. Principally this is useful so a long-running recursor doesn't have to re-probe nameservers after a restart. It can remember its preexisting success/failures talking to nameservers with encrypted protocols and avoid using Do53 while reprobing.Along the way, some pre-existing code had to be adjusted. Of main note:
Instantinstead ofSystemTimein theNameServerTransportStatewas a mistake in retrospect, and since it's platform specific makes ser/der difficult. This branch switches toSystemTimeto make that easier.(IpAddr, Protocol)tuple key for the stateHashMapalso plays poorly with ser/der since most formats (in particular TOML) require aStringkey for maps. Rather than hack around that in the ser/der code I revisited one of djc's earlier suggestions to useIpAddras the key, and to add an intermediate struct with per-protocol fields. With the other refactoring we did this is a pretty nice solution (a.k.a lesson learned, djc is always right 😝). The number of protocols supported for opp. enc. encryption is fixed, so doesn't need to be part of the key anyway.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.