mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 19:25:56 +03:00
[GH-ISSUE #1687] DNS-over-QUIC (DoQ) does not work with dns.adguard.com #736
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#736
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 @bluejekyll on GitHub (Apr 8, 2022).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1687
Describe the bug
When using DoQ for queries, the QUIC protocol errors with:
To Reproduce
The current easiest way to reproduce this is to use the new
dnsutility from the project, see trust-dns-client-cli:cargo run --all-features --bin dns -- --debug -p quic -t dns.adguard.com -n 94.140.14.14:853 query www.example.com. SOAedit: it appears that adguard may require a custom ALPN,
doq-i02, as opposed to the RFC's ALPN ofdoq, the proper command for that is, but has the same result:cargo run --all-features --bin dns -- --debug -p quic -t dns.adguard.com -n 94.140.14.14:853 -a doq-i02 query www.example.com. SOAExpected behavior
Correct behavior with DoH can be seen with the same server:
Version:
Trust-DNS on up-to-date branch trust-dns-client-cli
Quinn version
0.8.2Additional context
I've also be testing against a different DoQ service setup, which has fewer details, though I have more logs. It appears that the remote is seeing the stream as "finished" before the client has sent all logs. From that server, there are these logs:
Notice the "Stream FIN before query was received.
In the code we have this structure for sending quic packets:
github.com/bluejekyll/trust-dns@e6ab219f81/crates/proto/src/quic/quic_client_stream.rs (L58-L74)Which appears to follow the RFC:
https://www.ietf.org/archive/id/draft-ietf-dprive-dnsoquic-11.html#name-stream-mapping-and-usage
@Ralith or @djc not sure if this looks familiar to you?
I'm not sure if these issues would have anything to do with the compatibility tests here: https://interop.seemann.io/
https://github.com/private-octopus/quicdoq
@Ralith commented on GitHub (Apr 8, 2022):
Assuming nothing interesting is happening in the
QuicStreamwrapper, your QUIC use looks sensible. I'd verify thatmessage.into_parts().0is correct, then try to determine where exactly the peer sees the stream getting cut off, and verify thatsendisn't failing with some other error halfway through queuing data. Wireshark might be useful to provide insight into what data was actually sent.@bluejekyll commented on GitHub (Apr 8, 2022):
End-to-end tests work locally so there isn't an issue with the DNS packet as far as I can tell. I'll see what we can see with wireshark.
@bluejekyll commented on GitHub (Apr 8, 2022):
And thanks for taking the time.
@IvanNardi commented on GitHub (Apr 9, 2022):
Not an expert, but is it possible that Adguard is still using DoQ draft-02, instead of the latest versions?
Draft-02 is incompatible with latest versions because it doesn't have the "2-octet length field" of the beginning of the message.
My 2 cents
@djc commented on GitHub (Apr 9, 2022):
That sounds very plausible.
@bluejekyll commented on GitHub (Apr 9, 2022):
Oh... that's significant, and I didn't notice that. I'll focus on the other service. There's a setup guide for testing with it that I need to go through. I'll see when I have time to do that. I don't think it's necessarily worth providing an option for that, but I suppose I could hack it temporarily to see if I can get it to work.
This is the current doc I'm working off of that links to other implementations: https://docs.google.com/document/d/1aMVwZf979-xa6wbQUx6pm56Kk0AYI0FoY41tBqmniKk/edit#
@bluejekyll commented on GitHub (Apr 9, 2022):
@Ralith thanks for noticing that.
I just hacked the current implementation to remove the 2 byte length from the stream, and it indeed works as expected with
dns.adguard.coms quic implementation ondoq-i02.So that's a nice validation.
@bluejekyll commented on GitHub (Apr 9, 2022):
I'm going to open a separate issue in regards to the
doq-i03issues.@bluejekyll commented on GitHub (Apr 9, 2022):
We won't fix this issue, as the
dns.adguard.comname server isn't on the current RFC, I don't think it makes sense for us to try and support different versions of the RFC. We'll only focus on the current (as of this writing, version 11): https://www.ietf.org/archive/id/draft-ietf-dprive-dnsoquic-11.html#name-reservation-of-dedicated-po