|
4 | 4 | [](https://www.rust-lang.org/) |
5 | 5 | [](https://crates.io/crates/doh-proxy) |
6 | 6 |
|
7 | | -A fast and secure DoH (DNS-over-HTTPS) and ODoH (Oblivious DoH) server. |
| 7 | +A fast and secure DoH (DNS-over-HTTPS), DoQ (DNS-over-QUIC), and ODoH (Oblivious DoH) server. |
8 | 8 |
|
9 | | -`doh-proxy` is written in Rust, and has been battle-tested in production since February 2018. It doesn't do DNS resolution on its own, but can sit in front of any DNS resolver in order to augment it with DoH support. |
| 9 | +`doh-proxy` is written in Rust, and has been battle-tested in production since February 2018. It doesn't do DNS resolution on its own, but can sit in front of any DNS resolver in order to augment it with DoH, DoQ, and ODoH support. |
10 | 10 |
|
11 | 11 | ## Table of Contents |
12 | 12 |
|
@@ -56,6 +56,7 @@ A fast and secure DoH (DNS-over-HTTPS) and ODoH (Oblivious DoH) server. |
56 | 56 | ## Features |
57 | 57 |
|
58 | 58 | - **DNS-over-HTTPS (DoH)** - Encrypts DNS queries using HTTPS |
| 59 | +- **DNS-over-QUIC (DoQ)** - Encrypts DNS queries using QUIC protocol (RFC 9250) |
59 | 60 | - **JSON API Support** - Compatible with Google DNS-over-HTTPS JSON API format |
60 | 61 | - **Oblivious DoH (ODoH)** - Provides additional privacy by hiding client IP addresses |
61 | 62 | - **EDNS Client Subnet** - Forward client IP information to upstream resolvers for geo-optimized responses |
@@ -139,6 +140,9 @@ OPTIONS: |
139 | 140 | --enable-ecs Enable EDNS Client Subnet |
140 | 141 | --ecs-prefix-v4 <ecs_prefix_v4> IPv4 prefix length for EDNS Client Subnet [default: 24] |
141 | 142 | --ecs-prefix-v6 <ecs_prefix_v6> IPv6 prefix length for EDNS Client Subnet [default: 56] |
| 143 | + --enable-doq Enable DNS-over-QUIC (DoQ) server on UDP port 853 |
| 144 | + --doq-port <doq_port> UDP port for DNS-over-QUIC server [default: 853] |
| 145 | + --doq-idle-timeout <doq_idle_timeout> Idle timeout for DoQ connections in seconds [default: 30] |
142 | 146 | ``` |
143 | 147 |
|
144 | 148 | ### Example Configurations |
@@ -170,6 +174,17 @@ doh-proxy -H 'doh.example.com' \ |
170 | 174 | doh-proxy -H 'doh.example.com' -u 127.0.0.1:53 -l 127.0.0.1:3000 |
171 | 175 | ``` |
172 | 176 |
|
| 177 | +**With DNS-over-QUIC (DoQ) support:** |
| 178 | +```sh |
| 179 | +doh-proxy -H 'doh.example.com' \ |
| 180 | + -u 127.0.0.1:53 \ |
| 181 | + -i /path/to/cert.pem \ |
| 182 | + -I /path/to/key.pem \ |
| 183 | + --enable-doq \ |
| 184 | + --doq-port 853 |
| 185 | +``` |
| 186 | +This enables both DoH on HTTPS port and DoQ on UDP port 853. |
| 187 | + |
173 | 188 | ## Deployment Architectures |
174 | 189 |
|
175 | 190 | ### Behind a Reverse Proxy (Recommended) |
@@ -409,6 +424,71 @@ curl -H "X-Forwarded-For: 1.2.3.4" \ |
409 | 424 |
|
410 | 425 | For maximum privacy, avoid enabling ECS or use larger prefix values (smaller subnets) like /8 for IPv4 or /32 for IPv6. |
411 | 426 |
|
| 427 | +## DNS-over-QUIC (DoQ) |
| 428 | + |
| 429 | +### Overview |
| 430 | + |
| 431 | +DNS-over-QUIC (DoQ) is specified in RFC 9250 and provides DNS transport over the QUIC protocol. It offers similar privacy properties to DoH but with improved performance characteristics: |
| 432 | + |
| 433 | +- **Zero Round-Trip Time (0-RTT)**: Faster connection establishment for returning clients |
| 434 | +- **No Head-of-Line Blocking**: Independent stream delivery prevents one slow query from blocking others |
| 435 | +- **Connection Migration**: Maintains connections even when client IP addresses change |
| 436 | +- **Lower Latency**: QUIC's efficient packet loss recovery and congestion control |
| 437 | + |
| 438 | +### Configuration |
| 439 | + |
| 440 | +Enable DoQ support with the following command-line options: |
| 441 | + |
| 442 | +- `--enable-doq` - Enable DNS-over-QUIC server |
| 443 | +- `--doq-port <port>` - UDP port for DoQ (default: 853) |
| 444 | +- `--doq-idle-timeout <seconds>` - Connection idle timeout (default: 30) |
| 445 | + |
| 446 | +### Examples |
| 447 | + |
| 448 | +**Basic DoQ setup:** |
| 449 | +```sh |
| 450 | +doh-proxy -H 'dns.example.com' \ |
| 451 | + -u 127.0.0.1:53 \ |
| 452 | + -i /path/to/cert.pem \ |
| 453 | + -I /path/to/key.pem \ |
| 454 | + --enable-doq |
| 455 | +``` |
| 456 | + |
| 457 | +**DoQ with custom port and timeout:** |
| 458 | +```sh |
| 459 | +doh-proxy -H 'dns.example.com' \ |
| 460 | + -u 127.0.0.1:53 \ |
| 461 | + -i /path/to/cert.pem \ |
| 462 | + -I /path/to/key.pem \ |
| 463 | + --enable-doq \ |
| 464 | + --doq-port 8853 \ |
| 465 | + --doq-idle-timeout 60 |
| 466 | +``` |
| 467 | + |
| 468 | +**Combined DoH and DoQ:** |
| 469 | +```sh |
| 470 | +doh-proxy -H 'dns.example.com' \ |
| 471 | + -u 127.0.0.1:53 \ |
| 472 | + -l 0.0.0.0:443 \ |
| 473 | + -i /path/to/cert.pem \ |
| 474 | + -I /path/to/key.pem \ |
| 475 | + --enable-doq |
| 476 | +``` |
| 477 | +This configuration serves DoH on TCP port 443 and DoQ on UDP port 853. |
| 478 | + |
| 479 | +### Client Configuration |
| 480 | + |
| 481 | +DoQ clients can connect using: |
| 482 | +- Protocol: DNS-over-QUIC (RFC 9250) |
| 483 | +- Port: UDP 853 (default) |
| 484 | +- ALPN: "doq" |
| 485 | + |
| 486 | +### Requirements |
| 487 | + |
| 488 | +- TLS certificates are required (same certificates used for DoH) |
| 489 | +- UDP port 853 must be accessible (or custom port if configured) |
| 490 | +- QUIC uses UDP, ensure firewalls allow UDP traffic |
| 491 | + |
412 | 492 | ## Oblivious DoH (ODoH) |
413 | 493 |
|
414 | 494 | Oblivious DoH is similar to Anonymized DNSCrypt, but for DoH. It requires relays, but also upstream DoH servers that support the protocol. |
|
0 commit comments