mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 11:15:54 +03:00
[PR #3264] [CLOSED] Tidy up ResolverOpts usage, default trait impls #3693
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#3693
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/3264
Author: @cpu
Created: 9/5/2025
Status: ❌ Closed
Base:
main← Head:cpu-tidying-recursor-opts_dev📝 Commits (5)
f239ec3config: introduce ConnectionOpts type15bc67erecursor: extract case randomization to constructor arg8778471resolver: split out NameServerOptions from ResolverOpts02f5982use NameServerOptions for resolver name servers/poolsc05abfdreplace manual Default impl for enums📊 Changes
15 files changed (+313 additions, -257 deletions)
View changed files
📝
bin/tests/integration/config_tests.rs(+1 -0)📝
conformance/dns-test/src/implementation.rs(+2 -7)📝
crates/proto/src/dnssec/rdata/key.rs(+6 -21)📝
crates/proto/src/op/response_code.rs(+2 -7)📝
crates/recursor/src/recursor_dns_handle.rs(+26 -31)📝
crates/recursor/src/recursor_pool.rs(+4 -2)📝
crates/resolver/src/config.rs(+108 -66)📝
crates/resolver/src/name_server/connection_provider.rs(+11 -6)📝
crates/resolver/src/name_server/name_server.rs(+14 -15)📝
crates/resolver/src/name_server/name_server_pool.rs(+12 -12)📝
crates/resolver/src/resolver.rs(+2 -3)📝
crates/resolver/src/system_conf/unix.rs(+14 -3)📝
crates/server/src/zone_handler/auth_lookup.rs(+4 -14)📝
tests/integration-tests/src/mock_client.rs(+3 -2)📝
tests/integration-tests/tests/integration/name_server_pool_tests.rs(+104 -68)📄 Description
The configuration situation for name servers & name server pools was complicated by the pervasive use of the
ResoverOptsstruct. This struct has a lot of configuration options, but very few are meaningfully used by these lower layers, resulting in some confusing behaviour (e.g. unit tests setting fields that have no effect on the actual implementation). For instance,name_server_pool_tests.rstests were settingtry_tcp_on_errorat a layer where the value was never consulted, and therecursor_dns_handle.rsrecursor_opts()func was setting/documenting fields likevalidatethat had no effect.I suspect there's further room for improvement; in particular, both before & after this branch we're using hard-coded values for
NameServerOptionsconfiguration when building the root server pool, and when creating a name server pool for a zone. For now since this is a large diff already I've called this out with a couple of TODO comments while preserving the values used previously.Along the way I also took this as a chance to tidy up a handful of manual
Defaultimpls on enums that could be replaced with derived implementations by marking the correct enum variant as the#[default].🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.