mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 19:25:56 +03:00
[GH-ISSUE #1800] Specify IP address of upstream servers directly? #770
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#770
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 @phylake on GitHub (Oct 14, 2022).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1800
I looked at
pub struct ResolverOptsand did a couple queries in GitHub issues but didn't find anythingI'm wondering: is there an equivalent of dnsmasq's
--serveroption? If not can you point me to where I'd hook into the DNS request and provide a different response?@bluejekyll commented on GitHub (Oct 14, 2022):
I think you're looking for
ResolverConfigspecifically either configure everything all at once: https://docs.rs/trust-dns-resolver/0.22.0/trust_dns_resolver/config/struct.ResolverConfig.html#method.from_parts or add each name server in one at a time: https://docs.rs/trust-dns-resolver/0.22.0/trust_dns_resolver/config/struct.ResolverConfig.html#method.add_name_server@phylake commented on GitHub (Oct 17, 2022):
Looking at what
add_name_serverdoes I don't think this is what I'm looking forI'm looking to provide a name server for a FQDN. The use case here is that on a Kubernetes cluster I know that CoreDNS running on the cluster is authoritative for
*.cluster.local.so I don't want the query to be forwarded to any other name server@phylake commented on GitHub (Oct 18, 2022):
I started looking at how to do this. Looks like with my own
impl RequestHandlerI can spin up a resolver and get back aLookup. Not sure how to convert that to aMessageResponsethough. Am I on the right track at least @bluejekyll? I'm currently staring at https://docs.rs/trust-dns-server/0.22.0/trust_dns_server/authority/struct.MessageResponseBuilder.html#method.build wondering what to give itAt a high level I'm trying to build a DNS server that mostly forward DNS requests onto a public DNS server and conditionally forwards to an authoritative DNS server I run
@bluejekyll commented on GitHub (Oct 18, 2022):
Ah, I think I misunderstood the context of what you were trying to do. I understand better now. I think what I would do is build a new Authority that has a list of other Authorities associated to it, and then in the message processing you could inspect the request and then decide to forward on based on that inspection. Does that help? or do you think you need more details?
The Forwarding Authority is probably the best example to use for this: https://github.com/bluejekyll/trust-dns/blob/main/crates/server/src/store/forwarder/authority.rs#L95
@phylake commented on GitHub (Oct 20, 2022):
I think I need more details. This conditional logic I'm talking about is also dynamic in nature based on what FQDNs are present and there is additional filtering logic I'd like to add. In the simple forwarding case what's the fastest path given a
pub struct Lookupfromlookup()and turn it (or its fields) into apub struct MessageResponseto givesend_response()?Tell me if I'm going about this all wrong. Still looking through the source (which is super clean, btw 💯) and this is where I'm at
@phylake commented on GitHub (Oct 20, 2022):
I think I got it. How does this look for the simple forwarding case? I'm new to rust just FYI