mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 11:15:54 +03:00
[GH-ISSUE #2237] what's the use case for Recursor::resolve(Query::query(not_fully_qualified_name, ..), ..)? / bug in Recursor::resolve with security_aware = false? #932
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#932
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 @japaric on GitHub (Jun 12, 2024).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/2237
as far as I understand the DNS RFCs, specifically RFC1035, the NAME field of a resource record is always considered to be fully qualified. that can be confirmed with this
hickory-dnscodeand I believe that the main use case of
Recursoris as a recursive resolver authority (inhickory-server) which answers requests (records) that have been decoded from some network source (e.g. UDP). given howName::readbehaves as shown above, it seems to me thatRecursor::resolvewill always observe FQDN (fully qualified domain names) when operating as a recursive resolver server / authority.however,
Recursor::resolvecurrently accepts not fully-qualified domain names. what it does in that case is that it performs the query as if the givenNamewas fully qualified. tracing the messagesRecursorexchanges, I can see that in both cases (e.g.example.com&example.com.)Recursorgets the correct answer records but in the case the inputNamewas not fully qualified it discards the records using theis_subzonefunction and returns an error of the kind "no records found".however, that's only the behavior when
Recursoris configured as not beingsecurity_aware. whenRecursor'ssecurity_awaresetting istruethen bothexample.comandexample.com.resolve correctlythat behavior can be checked with the following program ( and revision
ed192864f3)my question is should
Recursor::resolvereject (i.e. fail early) the query argument when it's not a fully qualified domain name?if not, then I think
Recursor::resolvehas a bug since it behaves differently with not-fully-qualified domain names depending on thesecurity_awaresetting as explained above even though it correctly gets the answer from the name servers it contacts (i.e. resolution succeeds)@djc commented on GitHub (Jun 13, 2024):
I don't have a great amount of context here but you've convinced me that it probably should. Have you tested the behavior of other implementations in this regard, for example in your conformance test suite?
@japaric commented on GitHub (Jun 13, 2024):
the conformance tests interact with name servers and resolvers over the network and over the network all the domain names in the queries are treated as being fully qualified so through those tests I can't test the equivalent of
Recursor::resolve("example.com"). IOW, the BIND / unbound / hickory-dns binaries are not going to exercise that code path, I think.I think the only way to test / trigger recursive resolution of non-fully qualified domain names is via library API and I don't know if BIND / unbound offer such API or even libraries for development since they are mainly use as server binaries.
@djc commented on GitHub (Jun 13, 2024):
By itself that seems like enough reason to disallow it for now, can always adjust course if we get feedback about it later? (I don't think many people are relying on the
Recursorlibrary API, though...)@bluejekyll commented on GitHub (Jun 16, 2024):
For the recursor, I agree, this makes sense to disallow. I think I was basing a lot of this implementation initially off the resolver interface, I make not have considered this in enough detail in the current implementation.