Add DNS over TCP, TLS, and QUIC support#813
Merged
Merged
Conversation
Extend --dns-server to accept URL-style schemes for DNS over TCP (tcp://), DNS over TLS (tls://, dot://), and DNS over QUIC (quic://, doq://), in addition to the existing UDP and DoH support. Key changes: - Parse --dns-server values via a shared scheme dispatcher in src/dns/custom.rs. - Add stream-based DNS transports in src/dns/transport.rs for TCP, TLS (tokio-rustls), and QUIC (quinn with doq ALPN). - Implement pipelined A/AAAA resolution for TCP/TLS and concurrent streams for QUIC in src/dns/resolver.rs. - Extend --inspect-dns to support all new transports. - Wire new transports through WebSocket direct dialing in src/net.rs. - Use DNS Message ID 0 for DoQ queries per RFC 9250. - Bound post-connect reads/writes with the remaining TimeoutBudget to avoid hangs. - Add validation for short framed DNS responses. - Update CLI help, configuration docs, advanced-features docs, and CLI reference docs. Tests added for scheme parsing, TCP/TLS/QUIC lookups, short frames, and single-family resolution.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR extends
--dns-serverto support DNS over TCP, DNS over TLS (DoT), and DNS over QUIC (DoQ), in addition to the existing UDP and DoH transports.New URL schemes
IP[:PORT]/udp://IP[:PORT]tcp://IP[:PORT]tls://HOST[:PORT]/dot://HOST[:PORT]quic://HOST[:PORT]/doq://HOST[:PORT]https://URLImplementation highlights
src/dns/custom.rs.src/dns/transport.rsfor TCP, TLS (viatokio-rustls), and QUIC (viaquinnwithdoqALPN).src/dns/resolver.rs.--inspect-dnsnow supports all new transports.src/net.rs.TimeoutBudgetto prevent hangs.Testing
cargo fmt --check,cargo clippy --locked --all-targets --all-features -- -D warnings,cargo test --locked --all-features --lib --bins, and integration tests for http/network/websocket.