mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 19:25:56 +03:00
[GH-ISSUE #1476] Intercepting/Overriding ForwardAuthority #678
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#678
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 @moschroe on GitHub (May 2, 2021).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1476
Beg your pardon if this was asked already but I am trying to build a simple server that basically only forwards queries (no entries/zone on its own) and is able to intercept (and possibly modify) both, request and response. Use case would be surveillance of outgoing connections/firewalling requirements.
My first approach was implementing a
RequestHandlerdirectly, encapsulating a Catalog with aForwardingAuthoritycreated from the system resolver and then adding code tohandle_request(). But due to the interface, this requires also a customResponseHandler, which has no usable access to the response at all and I'd need to read any A or CNAME (or any at all) records.The second approach was implementing a custom
Authoritywith an innerForwardingAuthorityfield. Here the sync signature makesawaiting impossible but I can create a chained future withand_then()that is in the loop. On querying for A records for (example) "marketplace-cdn.atlassian.com", the upstream DNS answers with A and CNAME records. CNAME records are not contained in theLookupstruct returned. Where are these filtered out and why? They have to be traced back to the original query, so they would need to be accessible in its context. Also, being able to change the query on the fly would be great for later extensions.Any hints on how to approach this endeavor would be much appreciated.
@bluejekyll commented on GitHub (May 3, 2021):
I get what you're asking for. I wonder if we should change some of the internal interfaces to work a little better for your needs? It sounds like you've already dived through the code and looks like you have some ideas where things need to be changed potentially.
I think it would be nice if you could do what you're asking for by modifying the FowardingAuthority to work they way you want... I have been planning to expand the Lookup type to provide access to all of the fields from a Message, as similar issues have been brought up. Would that fix the issue you're having now or are more changes needed?
@moschroe commented on GitHub (May 3, 2021):
Juggling a few projects at the moment but maybe I can try my hand at a POC this weekend. Knowing you're fundamentally open to necessary changes is great to know!
@moschroe commented on GitHub (Jan 5, 2022):
Recently picked up development again.
opts.preserve_intermediates = trueresolves that.async_trait(in the 0.21. RC releases), my initial complaint about it being difficult to create customized trait implementation also was resolved.