mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 03:05:51 +03:00
[GH-ISSUE #2188] Not convenient to call bind_with_addr to make a AsyncResolver #912
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#912
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 @hainesc on GitHub (Apr 20, 2024).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/2188
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Maybe I have missed something, but AFAIK, it is not convenient to call bind_with_addr when I want to make dns resolver with a specific network interface.
Now I can write as below:
I don't like copy the code how trust_dns_resolver::system_conf::read_system_conf() does and set bind addr there.
Describe the solution you'd like
A clear and concise description of what you want to happen.
And I think make a method named
set_bind_addrfor ResolverConfig will be a simple solution.Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
https://github.com/hickory-dns/hickory-dns/blob/main/crates/resolver/src/config.rs#L827
@hainesc commented on GitHub (Apr 20, 2024):
If that is acceptable, I can make a PR ASAP.
@hainesc commented on GitHub (Apr 20, 2024):
Related issue:
https://github.com/hickory-dns/hickory-dns/issues/2087
@djc commented on GitHub (Apr 22, 2024):
bind_addris a public property ofNameServerConfigso by itself that seems easy enough to change. I guess it might be okay to expose agroups_mut()accessor onResolverConfigand aservers_mut()accessor onNameServerGroup?@bluejekyll commented on GitHub (May 18, 2024):
We could definitely make NameServer and NameServerGroup configuration more ergonomic. I haven't revisited these interfaces in a while, there are probably better patterns that could be adopted.
@GICodeWarrior commented on GitHub (Jul 9, 2024):
I will try and summarize my current understanding of the situation and then summarize a few options.
Current Situation
system_conf::read_system_conf()) with some modifications. (e.g. custom bind address, timeout, protocol, etc.)NameServerGroupheld byResolverConfigResolverOptsNameServerConfigwithin theNameServerGroupheld byResolverConfigSome Improvement Options
These are still high level thoughts and not mutually exclusive. Based on your feedback I can make a more narrow/specific proposal if useful.
set_bind_addronResolverConfigthat pushes the address into eachNameServerConfigwithin theNameServerGroup)NameServerGroupfunctionality intoResolverConfigand/or moveResolverOptsintoResolverConfig)ResolverConfigBuildercould include afrommethod or static method accepting an existing ResolverConfig to copy options fromPlease let me know your thoughts.
@djc commented on GitHub (Jul 9, 2024):
That sounds about right!
On your options:
set_bind_addr()that implicitly updates allNameSserverConfigalso feels a little too magicResolverOptsbe part ofResolverConfig(perhaps by flattening it) and maybe also dissolve theNameServerConfigGrouptype. Another aspect here is how we configure TLS, which might also want some refactoring (you can find earlier issues/PRs from @daxpedda about this -- for example, it would be nice to get rid of the static TLS configs).