mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 11:15:54 +03:00
[GH-ISSUE #1171] Can no longer detect NXDOMAIN/empty answer in Resolver queries #618
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#618
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 @glts on GitHub (Jul 23, 2020).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1171
I have been using the synchronous
Resolverto do DNS lookups and switching onResolveErrorKind::NoRecordsFound { .. }to detect NXDOMAIN errors.This no longer works, instead I now get an untyped/generic protocol error:
I believe #1086 changed this, a breaking change. Is this intentional? How does one recognise NXDOMAIN/empty answers in the
ResolverAPI?To reproduce:
d67acf9)@bluejekyll commented on GitHub (Jul 23, 2020):
We can make that more strongly typed. Not sure if we missed that in the review or if this is a new code path, but that’s probably the easiest fix for this.
@glts commented on GitHub (Jul 23, 2020):
To give just a little bit of context, my application is SPF protocol implementation. For the SPF protocol I must be able to distinguish both the NXDOMAIN and the empty answer results from other errors.
@bluejekyll commented on GitHub (Jul 23, 2020):
Understood. There are two error codes here, NxDomain and NoError. No error is the empty response, NxDomain is the authoritative non-existent domain. All we need to do is associate the proper error code to a real type in the errors.
@zaharidichev commented on GitHub (Aug 28, 2020):
@bluejekyll what issue does https://github.com/bluejekyll/trust-dns/issues/1171 solve exactly? It seems to me that we can not have the
NxDomainandNoErrorcodes as proto errors and just leave them be processed by this logic so we get aNoRecordsFounderror. I am fine with putting up a PR for that. Does this approach sound ok to you?@bluejekyll commented on GitHub (Aug 28, 2020):
@zaharidichev I'm sorry, I'm not fully understanding the way in which your suggesting to fix this. If you have a PR ready, I'm happy to take a look.
One of the issues here is really a question of what
Errormeans in this context. I'm not entirely certain we should surface an error to the caller of the lookup as anNXDomainis a valid response from the upstream server. Right now, we don't pass that information back to the lookup caller at all. So I think the first question we should decide on is, should this be an error returned via theResulton theResolver::lookup, or should we add a new field onLookupthat returns the underlying response code from the request?@bluejekyll commented on GitHub (Aug 29, 2020):
For a little more context here. There are a number of things that make returning NXDomain accurately from the lookup call difficult. Off the top of my head:
So for the API change, I think we need to incorporate this, and also anticipate that NXDomain will only be semi-accurate for fqdns...
@zaharidichev commented on GitHub (Aug 31, 2020):
@bluejekyll Sorry I might be missing a big part of the context here but it seems to me that before this commit
NameServer::inner_sendwas returning the response instead of an error when encountering NXDomain. Later that response was processed byCachingClient::inner_lookupby looking at the response code. Are you saying that all this logic should not be there and instead the caller should be responsible for handling all that?@bluejekyll commented on GitHub (Aug 31, 2020):
Maybe I'm overthinking the issue here. Would it be enough to surface the error in this case directly with the ResponseCode?
@zaharidichev commented on GitHub (Sep 2, 2020):
Yes I think this is what needs to happen.
@bluejekyll commented on GitHub (Sep 5, 2020):
Let me work on a quick PR for this, perhaps there are some folks on this thread that would be interested in testing with it.
Also, please notice the flag
distrust_nx_responses, that flag purposefully ignores NXDomain as an upstream permanent failure (which it should be), and instead regards it as a potential issue in upstream resolver configuration and continues lookups. Making that false, should return NXDomain properly, I hope.@bluejekyll commented on GitHub (Sep 7, 2020):
@zaharidichev @glts please see #1197, I believe this will fix the issue.
I know remember why this wasn't correct before, I had punted on doing the type golf needed to support this. I need to take a pass to see if I can simplify any of the type signatures, but this should resolve the concerns here, I hope.
@zaharidichev commented on GitHub (Sep 16, 2020):
@bluejekyll This is great. Thanks a lot for the fix! Is there any ETA on when a new release will be out including these changes?
@bluejekyll commented on GitHub (Sep 16, 2020):
I will publish today. There are a few library deps I want to update first.
@bluejekyll commented on GitHub (Sep 17, 2020):
@zaharidichev 0.20.0-alpha.2 has been published.