mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 11:15:54 +03:00
[GH-ISSUE #559] Get access to "raw" dns reply #240
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#240
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 @kpcyrd on GitHub (Sep 19, 2018).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/559
I'm looking for a method similar to
Resolver::lookup(name, record_type)that returns something like this:I've tried to match on a specific error in ResolveError but it seems I can only match on NXDOMAIN, but not e.g. SRVFAIL.
I would like to treat every dns reply as a success and only return an
Err(_)if I didn't receive a reply at all (eg timeouts or something else io related).Thanks!
@bluejekyll commented on GitHub (Sep 19, 2018):
The message is evaluated here:
github.com/bluejekyll/trust-dns@04c9f817c8/resolver/src/lookup_state.rs (L351-L358)Right now ResolveError and ResolveErrorKind don't currently have detailed error conditions for this, but these can be added. You'll notice that the Resolver has that
handle_nxdomainmethod call. This is because NxDomain isn't regarded as a protocol, or service error, but a valid response where the records just don't exist.For what you want, we could add a new kind to ResolveErrorKind, similar to
NoRecordsFound, that would have the response code, and then whatever information we want. This could be the full Message. I haven't really considered this case in a lot of detail, so if you have other details, I'm happy to discuss.Edit: I didn't respond to this
This would be a much bigger change. I understand why you want this, and am aware other libraries for things like HTTP take this stance. This would be a bigger fundamental change to the API, so we'd have to discuss the value of that, as I think extracting the details from the Error/ErrorKind would be fairly straightforward. Again, happy to discuss.
@ntrippar commented on GitHub (Nov 14, 2019):
@bluejekyll O'm looking for the same kind of details, i would like to get if the response is nxdomain, noerror, or whatever. currently with the
trust_dns_resolver::error::ResolveErrorthe response details is really limited. (maybe there is another way, thats also why im asking here)@bluejekyll commented on GitHub (Nov 14, 2019):
So the problem here as I see it is that the Resolver will always retry on errors, and the only thing your get in response is the last or final error.
Not knowing what your use-case is, but is the Client out of trust-dns-client something that would be potentially a little closer to your needs?