mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 11:15:54 +03:00
[GH-ISSUE #1561] Allow resolver to switch to TCP for large messages without having to include TCP in name server pool #700
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#700
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 @peterthejohnston on GitHub (Oct 6, 2021).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1561
Is your feature request related to a problem? Please describe.
We encountered an issue testing a device running Fuchsia where the local router timed out any DNS requests over TCP. (It's possible that it was just dropping TCP packets to port 53.) It responded to DNS over UDP fine. This ended up significantly slowing down IP lookup requests, because by default we include both a UDP "version" and a TCP version of each name server in the name server pool, to allow for TCP connections to be used when needed. However, when retry comes into the equation, this effectively means that on a DNS query that gets retried, potentially all the name servers get requested, including the TCP versions.
Describe the solution you'd like
As RFC 5966, section 1 describes:
I don't think we want to be making any DNS queries over TCP by default; it seems to me that we should only do that in the case that the message doesn't fit into a single DNS message. It looks to me like trust-dns already does this; if we get a response that a message has been truncated, trust-dns attempts to switch to a TCP connection to make the query. However, it relies on there being TCP connections in the name server pool. Ideally, I'd like to allow for this use case (using TCP for oversize messages) without having to include TCP name servers alongside UDP ones in the regular pool.
Maybe we could optionally have a separate name server pool for TCP to allow for this fallback to occur without having TCP name servers in the regular pool. Do you have any thoughts about the approach here?
Describe alternatives you've considered
We can always just not include any TCP versions in the name server pool, but this would prevent the resolver from falling back to TCP when the message size is too large which is undesirable.
@bluejekyll commented on GitHub (Oct 6, 2021):
I'm thinking of options here, and definitely open to ideas. I think the truncation flag should be set in the case that you're talking about. In that case, you want to drop through to the TCP logic. A simple option we could add an option that would only promote to TCP on truncation and not on any other errors. That would stop us from attempting TCP after timeouts...
@peterthejohnston commented on GitHub (Oct 6, 2021):
I've uploaded a PR that adds an option to only promote to TCP on truncation, and not on other errors. Let me know what you think.
@peterthejohnston commented on GitHub (Oct 13, 2021):
Hi, sorry for the frequent requests—would it be possible to tag a v0.21.0-alpha.4 release so we could pull in this change? We'd really appreciate it.
@bluejekyll commented on GitHub (Oct 13, 2021):
yeah, let me get that process going.
@peterthejohnston commented on GitHub (Oct 13, 2021):
Thanks! We could also depend on a specific git revision rather than a publicly released crates.io version in order to pull in the change, if that would make things easier for you.
@bluejekyll commented on GitHub (Oct 13, 2021):
That’s completely up to you. I know that you have specific vendoring rules, so I’d leave that in your court to decide.
@peterthejohnston commented on GitHub (Oct 13, 2021):
Sounds good, I'll see if that's feasible for us then and follow up with you if we do need a new release.
@bluejekyll commented on GitHub (Oct 13, 2021):
@peterthejohnston: https://github.com/bluejekyll/trust-dns/releases/tag/v0.21.0-alpha.4, crates are up on crates.io as well.