DNS over UDP, TLS, HTTPS and QUIC benchmarks: what encryption costs a lookup

NetworkingSecurity

A DNS lookup is the smallest exchange most applications make: a question of about 40 bytes, an answer of about 60. Plain DNS sends both in one UDP packet each, unencrypted, readable and rewritable by anything on the path. The encrypted alternatives wrap the same message in TLS: DoT (DNS over TLS, RFC 7858) on a TCP connection, DoH (DNS over HTTPS, RFC 8484) as an HTTP request, and DoQ (DNS over QUIC, RFC 9250) on a QUIC stream. How the name itself gets resolved, root to TLD to authoritative server, is in the DNS resolution simulator; this benchmark is about the last hop, the transport, and what each one costs per lookup.

Everything below was measured on one machine, in Docker, against one CoreDNS server that serves the same zone on all five transports, with the same certificate and the same emulated links. Every answer is checked against the zone file the server loads: 36,767,117 answers, none wrong.

SetupDetails
ServerCoreDNS 1.15.0 (coredns/coredns:1.15.0, Go 1.27.3), one process, the file plugin serving one local zone, bench.test, on five listeners: UDP and TCP :53, DoT :853/TCP, DoQ :853/UDP, DoH over HTTP/2 :443/TCP and over HTTP/3 :443/UDP · everything else at defaults · no recursion, no cache, no internet
ZoneSigned with DNSSEC (ECDSA P-256 keys). Small question: a.bench.test A, one record, no DNSSEC requested. Large question: big.bench.test AAAA with the DO bit, 64 records and their signature: a 3,008-byte answer
ClientGo 1.27.2, miekg/dns 1.1.73 for messages, plain sockets for UDP and TCP, crypto/tls for DoT, golang.org/x/net/http2 0.62.0 and quic-go 0.64.1 (http3) for DoH, quic-go for DoQ. DoH sends POST application/dns-message. One query per stream on QUIC; DoT and TCP pipeline queries on one connection and match answers by ID
QueriesEDNS(0) with a 1,232-byte buffer (DNS Flag Day 2020) on UDP, TCP, DoT and DoH; 65,535 on DoQ and DoH over HTTP/3 (see large answers) · UDP resends after 1 s without an answer; a truncated UDP answer is asked again over a new TCP connection
CheckThe client parses the same signed zone file the server loads; every answer’s records, sorted, must hash (SHA-256) to the zone’s records for that name and type, plus the signature when DNSSEC was asked for. A missing, extra, changed or truncated record fails the run
TLS1.3 everywhere, one ECDSA P-256 certificate, AES-128-GCM, key exchange X25519MLKEM768 (Go’s default, on TCP and QUIC alike), no session resumption and no 0-RTT: every new connection does a full handshake
NetworkOne network namespace, IPv4 loopback at a 1,500-byte MTU with segmentation offloads and UDP GSO off, so packets have real sizes · links emulated with tc netem: LAN (nothing added), 50 ms round trip, 200 ms round trip with 1 % random loss in each direction, 50 ms round trip with 5 % loss in each direction
CPUAMD Ryzen AI Max+ 395 · server on cores 2–3, client on cores 4–7, on a CCD reserved for the benchmark
MethodEvery cell is a fresh client process, run 10 times · reported value: median of the 10 runs (mean of the two middle ones), min–max where it matters · latency: median of the run medians, and the mean over every lookup of every run · slowest 1 %: each run’s 99th percentile, median across runs · bytes from the interface counters, every IP packet both ways, before and after · a wait for a quiet link before every cell

The scoreboard

Scoreboard, median per transport. Small answer, reused connection, LAN: UDP 14 µs, TCP 11 µs, DoT 11 µs, DoH, HTTP/2 39 µs, DoH, HTTP/3 43 µs, DoQ 27 µs. Small answer, new connection, 50 ms link: UDP 50.6 ms, TCP 101 ms, DoT 152 ms, DoH, HTTP/2 153 ms, DoH, HTTP/3 103 ms, DoQ 103 ms. Large answer, reused connection, 50 ms link: UDP 151 ms, TCP 50.3 ms, DoT 50.3 ms, DoH, HTTP/2 50.5 ms, DoH, HTTP/3 50.6 ms, DoQ 50.4 ms. Mean lookup at 5 % loss, 50 ms link: UDP 125 ms, TCP 70.8 ms, DoT 78.7 ms, DoH, HTTP/2 96.1 ms, DoH, HTTP/3 59.2 ms, DoQ 59.4 ms. Bytes per query, reused connection: UDP 203 B, TCP 256 B, DoT 300 B, DoH, HTTP/2 600 B, DoH, HTTP/3 495 B, DoQ 390 B. Bytes per query, new connection: UDP 203 B, TCP 687 B, DoT 4,672 B, DoH, HTTP/2 5,566 B, DoH, HTTP/3 7,022 B, DoQ 6,819 B. Queries/s on one connection, LAN: UDP 307,136, TCP 272,002, DoT 305,057, DoH, HTTP/2 65,220, DoH, HTTP/3 105,665, DoQ 161,516. Queries/s on one connection, 200 ms, 1 % loss: UDP 449, TCP 245, DoT 255, DoH, HTTP/2 230, DoH, HTTP/3 436, DoQ 460. Best in every run, out of 8 measures: UDP on 4; 4 have no fixed order Eight measures from the sections below · each transport as a multiple of the best plain DNS over TCP + TLS over QUIC 1× = the best median; grey line: lowest to highest run 1× (best) 2× 5× 10× 20× Small answer, reused connection, LAN UDP 14 µs TCP 11 µs DoT 11 µs DoH, HTTP/2 39 µs DoH, HTTP/3 43 µs DoQ 27 µs Small answer, new connection, 50 ms link UDP 50.6 ms TCP 101 ms DoT 152 ms DoH, HTTP/2 153 ms DoH, HTTP/3 103 ms DoQ 103 ms Large answer, reused connection, 50 ms link UDP 151 ms TCP 50.3 ms DoT 50.3 ms DoH, HTTP/2 50.5 ms DoH, HTTP/3 50.6 ms DoQ 50.4 ms Mean lookup at 5 % loss, 50 ms link UDP 125 ms TCP 70.8 ms DoT 78.7 ms DoH, HTTP/2 96.1 ms DoH, HTTP/3 59.2 ms DoQ 59.4 ms Bytes per query, reused connection UDP 203 B TCP 256 B DoT 300 B DoH, HTTP/2 600 B DoH, HTTP/3 495 B DoQ 390 B Bytes per query, new connection UDP 203 B TCP 687 B DoT 4,672 B DoH, HTTP/2 5,566 B DoH, HTTP/3 7,022 B DoQ 6,819 B Queries/s on one connection, LAN UDP 307,136 TCP 272,002 DoT 305,057 DoH, HTTP/2 65,220 DoH, HTTP/3 105,665 DoQ 161,516 Queries/s on one connection, 200 ms, 1 % loss UDP 449 TCP 245 DoT 255 DoH, HTTP/2 230 DoH, HTTP/3 436 DoQ 460 Each bar is that transport's median as a multiple of the best median for the measure, log scale: 1× is the best, a bar twice as long is twice as costly. Grey line: lowest to highest of the 10 process runs; the median is printed after each bar.
Eight headline measures from the sections below, each transport's median as a multiple of the best median for that measure (1×; log scale, a longer bar is worse), labelled with the measured value. Median of 10 process runs; grey line: lowest to highest run. The loss row is the mean over every lookup, where the lost packets show. Plain UDP has no connection; its new-connection rows are the same single round trip, and its large answer is the truncated reply plus the retry over TCP.
Scoreboard, median per transport. Small answer, reused connection, LAN: UDP 14 µs, TCP 11 µs, DoT 11 µs, DoH, HTTP/2 39 µs, DoH, HTTP/3 43 µs, DoQ 27 µs. Small answer, new connection, 50 ms link: UDP 50.6 ms, TCP 101 ms, DoT 152 ms, DoH, HTTP/2 153 ms, DoH, HTTP/3 103 ms, DoQ 103 ms. Large answer, reused connection, 50 ms link: UDP 151 ms, TCP 50.3 ms, DoT 50.3 ms, DoH, HTTP/2 50.5 ms, DoH, HTTP/3 50.6 ms, DoQ 50.4 ms. Mean lookup at 5 % loss, 50 ms link: UDP 125 ms, TCP 70.8 ms, DoT 78.7 ms, DoH, HTTP/2 96.1 ms, DoH, HTTP/3 59.2 ms, DoQ 59.4 ms. Bytes per query, reused connection: UDP 203 B, TCP 256 B, DoT 300 B, DoH, HTTP/2 600 B, DoH, HTTP/3 495 B, DoQ 390 B. Bytes per query, new connection: UDP 203 B, TCP 687 B, DoT 4,672 B, DoH, HTTP/2 5,566 B, DoH, HTTP/3 7,022 B, DoQ 6,819 B. Queries/s on one connection, LAN: UDP 307,136, TCP 272,002, DoT 305,057, DoH, HTTP/2 65,220, DoH, HTTP/3 105,665, DoQ 161,516. Queries/s on one connection, 200 ms, 1 % loss: UDP 449, TCP 245, DoT 255, DoH, HTTP/2 230, DoH, HTTP/3 436, DoQ 460. Best in every run, out of 8 measures: UDP on 4; 4 have no fixed order Eight measures from the sections below · each transport as a multiple of the best plain DNS over TCP + TLS over QUIC 1× = the best median; grey line: lowest to highest run 1× (best) 2× 5× 10× 20× Reused connection, LAN UDP 14 µs TCP 11 µs DoT 11 µs DoH, HTTP/2 39 µs DoH, HTTP/3 43 µs DoQ 27 µs New connection, 50 ms UDP 50.6 ms TCP 101 ms DoT 152 ms DoH, HTTP/2 153 ms DoH, HTTP/3 103 ms DoQ 103 ms Large answer, 50 ms UDP 151 ms TCP 50.3 ms DoT 50.3 ms DoH, HTTP/2 50.5 ms DoH, HTTP/3 50.6 ms DoQ 50.4 ms Mean lookup at 5 % loss UDP 125 ms TCP 70.8 ms DoT 78.7 ms DoH, HTTP/2 96.1 ms DoH, HTTP/3 59.2 ms DoQ 59.4 ms Bytes, reused connection UDP 203 B TCP 256 B DoT 300 B DoH, HTTP/2 600 B DoH, HTTP/3 495 B DoQ 390 B Bytes, new connection UDP 203 B TCP 687 B DoT 4,672 B DoH, HTTP/2 5,566 B DoH, HTTP/3 7,022 B DoQ 6,819 B Queries/s, LAN UDP 307,136 TCP 272,002 DoT 305,057 DoH, HTTP/2 65,220 DoH, HTTP/3 105,665 DoQ 161,516 Queries/s, 200 ms, 1 % loss UDP 449 TCP 245 DoT 255 DoH, HTTP/2 230 DoH, HTTP/3 436 DoQ 460 Each bar is that transport's median as a multiple of the best median for the measure, log scale: 1× is the best, a bar twice as long is twice as costly. Grey line: lowest to highest of the 10 process runs; the median is printed after each bar.
Eight headline measures from the sections below, each transport's median as a multiple of the best median for that measure (1×; log scale, a longer bar is worse), labelled with the measured value. Median of 10 process runs; grey line: lowest to highest run. The loss row is the mean over every lookup, where the lost packets show. Plain UDP has no connection; its new-connection rows are the same single round trip, and its large answer is the truncated reply plus the retry over TCP.
MeasureUDPTCPDoTDoH, HTTP/2DoH, HTTP/3DoQ
Small answer, reused connection, LAN14 µs
14–16 µs
11 µs
11–15 µs · 1.3×
11 µs
11–14 µs · 1.3×
39 µs
38–41 µs · 0.37×
43 µs
42–45 µs · 0.33×
27 µs
26–28 µs · 0.52×
Small answer, new connection, 50 ms link50.6 ms
50.1–50.7 ms
101 ms
100–101 ms · 0.50×
152 ms
151–153 ms · 0.33×
153 ms
151–153 ms · 0.33×
103 ms
102–103 ms · 0.49×
103 ms
102–103 ms · 0.49×
Large answer, reused connection, 50 ms link151 ms
150–151 ms
50.3 ms
50.1–50.6 ms · 3.0×
50.3 ms
50.1–50.6 ms · 3.0×
50.5 ms
50.2–50.9 ms · 3.0×
50.6 ms
50.2–50.9 ms · 3.0×
50.4 ms
50.2–50.7 ms · 3.0×
Mean lookup at 5 % loss, 50 ms link125 ms
50.3–351 ms
70.8 ms
56.5–91.5 ms · 1.8×
78.7 ms
56.9–117 ms · 1.6×
96.1 ms
62.7–112 ms · 1.3×
59.2 ms
54.1–73.2 ms · 2.1×
59.4 ms
54.3–66.6 ms · 2.1×
Bytes per query, reused connection203 B
203 B
256 B
256 B · 0.79×
300 B
300 B · 0.68×
600 B
600 B · 0.34×
495 B
483–505 B · 0.41×
390 B
375–398 B · 0.52×
Bytes per query, new connection203 B
203 B
687 B
687 B · 0.30×
4,672 B
4,659–4,688 B · 0.043×
5,566 B
5,560–5,572 B · 0.036×
7,022 B
7,010–7,053 B · 0.029×
6,819 B
6,805–6,822 B · 0.03×
Queries/s on one connection, LAN307,136
301,919–311,323
272,002
268,237–273,713 · 0.89×
305,057
300,835–306,624 · 0.99×
65,220
64,573–66,328 · 0.21×
105,665
103,428–106,429 · 0.34×
161,516
157,121–165,496 · 0.53×
Queries/s on one connection, 200 ms, 1 % loss449
437–455
245
225–270 · 0.55×
255
228–286 · 0.57×
230
221–260 · 0.51×
436
422–460 · 0.97×
460
433–476 · same

Median of 10 process runs, lowest to highest run beneath; bold: best in every run; after the range, the factor against UDP: above 1× better than UDP, below 1× worse, same: rounds to 1×.

Counting a measure only where every run agrees, against UDP: TCP is better on 1 (up to 3.0× on large answer, reused connection, 50 ms link), worse on 5 (down to 0.30× on bytes per query, new connection) and ties on 2; DoT is better on 2 (up to 3.0× on large answer, reused connection, 50 ms link), worse on 5 (down to 0.043× on bytes per query, new connection) and ties on 1; DoH, HTTP/2 is better on 1 (up to 3.0× on large answer, reused connection, 50 ms link), worse on 6 (down to 0.036× on bytes per query, new connection) and ties on 1; DoH, HTTP/3 is better on 1 (up to 3.0× on large answer, reused connection, 50 ms link), worse on 5 (down to 0.029× on bytes per query, new connection) and ties on 2; DoQ is better on 1 (up to 3.0× on large answer, reused connection, 50 ms link), worse on 5 (down to 0.03× on bytes per query, new connection) and ties on 2. The sections below take each measure in turn, with the other links, the slowest 1 %, idle connections and the runs behind every median.

Factor against plain UDP per measure, above 1 is better than UDP. Small answer, reused connection, LAN: TCP 1.3×, DoT 1.3×, DoH, HTTP/2 0.37×, DoH, HTTP/3 0.33×, DoQ 0.52×. Small answer, new connection, 50 ms link: TCP 0.50×, DoT 0.33×, DoH, HTTP/2 0.33×, DoH, HTTP/3 0.49×, DoQ 0.49×. Large answer, reused connection, 50 ms link: TCP 3.0×, DoT 3.0×, DoH, HTTP/2 3.0×, DoH, HTTP/3 3.0×, DoQ 3.0×. Mean lookup at 5 % loss, 50 ms link: TCP 1.8×, DoT 1.6×, DoH, HTTP/2 1.3×, DoH, HTTP/3 2.1×, DoQ 2.1×. Bytes per query, reused connection: TCP 0.79×, DoT 0.68×, DoH, HTTP/2 0.34×, DoH, HTTP/3 0.41×, DoQ 0.52×. Bytes per query, new connection: TCP 0.30×, DoT 0.043×, DoH, HTTP/2 0.036×, DoH, HTTP/3 0.029×, DoQ 0.03×. Queries/s on one connection, LAN: TCP 0.89×, DoT 0.99×, DoH, HTTP/2 0.21×, DoH, HTTP/3 0.34×, DoQ 0.53×. Queries/s on one connection, 200 ms, 1 % loss: TCP 0.55×, DoT 0.57×, DoH, HTTP/2 0.51×, DoH, HTTP/3 0.97×, DoQ 1.0×. Against UDP, 8 measures: TCP better on 1 · DoT on 2 · DoH, HTTP/2 on 1 · DoH, HTTP/3 on 1 · DoQ on 1 Medians of 10 process runs · log scale · above 1× is better than UDP plain DNS over TCP + TLS over QUIC 0.1× 1× (parity) Small answer, reused connection, LAN TCP 1.3× DoT 1.3× DoH, HTTP/2 0.37× DoH, HTTP/3 0.33× DoQ 0.52× Small answer, new connection, 50 ms link TCP 0.50× DoT 0.33× DoH, HTTP/2 0.33× DoH, HTTP/3 0.49× DoQ 0.49× Large answer, reused connection, 50 ms link TCP 3.0× DoT 3.0× DoH, HTTP/2 3.0× DoH, HTTP/3 3.0× DoQ 3.0× Mean lookup at 5 % loss, 50 ms link TCP 1.8× DoT 1.6× DoH, HTTP/2 1.3× DoH, HTTP/3 2.1× DoQ 2.1× Bytes per query, reused connection TCP 0.79× DoT 0.68× DoH, HTTP/2 0.34× DoH, HTTP/3 0.41× DoQ 0.52× Bytes per query, new connection TCP 0.30× DoT 0.043× DoH, HTTP/2 0.036× DoH, HTTP/3 0.029× DoQ 0.03× Queries/s on one connection, LAN TCP 0.89× DoT 0.99× DoH, HTTP/2 0.21× DoH, HTTP/3 0.34× DoQ 0.53× Queries/s on one connection, 200 ms, 1 % loss TCP 0.55× DoT 0.57× DoH, HTTP/2 0.51× DoH, HTTP/3 0.97× DoQ same ← UDP better the others better →
Each transport's median against plain UDP's on the same measure, log scale; above 1× it is better than UDP (faster, fewer bytes or more queries a second). Median of 10 process runs.
Factor against plain UDP per measure, above 1 is better than UDP. Small answer, reused connection, LAN: TCP 1.3×, DoT 1.3×, DoH, HTTP/2 0.37×, DoH, HTTP/3 0.33×, DoQ 0.52×. Small answer, new connection, 50 ms link: TCP 0.50×, DoT 0.33×, DoH, HTTP/2 0.33×, DoH, HTTP/3 0.49×, DoQ 0.49×. Large answer, reused connection, 50 ms link: TCP 3.0×, DoT 3.0×, DoH, HTTP/2 3.0×, DoH, HTTP/3 3.0×, DoQ 3.0×. Mean lookup at 5 % loss, 50 ms link: TCP 1.8×, DoT 1.6×, DoH, HTTP/2 1.3×, DoH, HTTP/3 2.1×, DoQ 2.1×. Bytes per query, reused connection: TCP 0.79×, DoT 0.68×, DoH, HTTP/2 0.34×, DoH, HTTP/3 0.41×, DoQ 0.52×. Bytes per query, new connection: TCP 0.30×, DoT 0.043×, DoH, HTTP/2 0.036×, DoH, HTTP/3 0.029×, DoQ 0.03×. Queries/s on one connection, LAN: TCP 0.89×, DoT 0.99×, DoH, HTTP/2 0.21×, DoH, HTTP/3 0.34×, DoQ 0.53×. Queries/s on one connection, 200 ms, 1 % loss: TCP 0.55×, DoT 0.57×, DoH, HTTP/2 0.51×, DoH, HTTP/3 0.97×, DoQ 1.0×. Against UDP, 8 measures: TCP better on 1 · DoT on 2 · DoH, HTTP/2 on 1 · DoH, HTTP/3 on 1 · DoQ on 1 Medians of 10 process runs · log scale · above 1× is better than UDP plain DNS over TCP + TLS over QUIC 0.1× 1× (parity) Reused connection, LAN TCP 1.3× DoT 1.3× DoH, HTTP/2 0.37× DoH, HTTP/3 0.33× DoQ 0.52× New connection, 50 ms TCP 0.50× DoT 0.33× DoH, HTTP/2 0.33× DoH, HTTP/3 0.49× DoQ 0.49× Large answer, 50 ms TCP 3.0× DoT 3.0× DoH, HTTP/2 3.0× DoH, HTTP/3 3.0× DoQ 3.0× Mean lookup at 5 % loss TCP 1.8× DoT 1.6× DoH, HTTP/2 1.3× DoH, HTTP/3 2.1× DoQ 2.1× Bytes, reused connection TCP 0.79× DoT 0.68× DoH, HTTP/2 0.34× DoH, HTTP/3 0.41× DoQ 0.52× Bytes, new connection TCP 0.30× DoT 0.043× DoH, HTTP/2 0.036× DoH, HTTP/3 0.029× DoQ 0.03× Queries/s, LAN TCP 0.89× DoT 0.99× DoH, HTTP/2 0.21× DoH, HTTP/3 0.34× DoQ 0.53× Queries/s, 200 ms, 1 % loss TCP 0.55× DoT 0.57× DoH, HTTP/2 0.51× DoH, HTTP/3 0.97× DoQ same ← UDP better the others better →
Each transport's median against plain UDP's on the same measure, log scale; above 1× it is better than UDP (faster, fewer bytes or more queries a second). Median of 10 process runs.

A new connection against a reused one

Plain DNS over UDP has no connection: the question goes out, the answer comes back, one round trip. Every encrypted transport first has to set one up, and how many round trips that takes is the first thing that separates them. The same small question on each transport, once on a connection that is already open and once on a new one, handshake included:

Time for one small DNS answer (one A record) on a reused connection and on a new connection, handshake included, per link, median. LAN, no added delay: UDP 14 µs reused, 26 µs new, TCP 11 µs reused, 29 µs new, DoT 11 µs reused, 436 µs new, DoH, HTTP/2 39 µs reused, 504 µs new, DoH, HTTP/3 43 µs reused, 635 µs new, DoQ 27 µs reused, 597 µs new. 50 ms round trip: UDP 50.5 ms reused, 50.6 ms new, TCP 50.5 ms reused, 101 ms new, DoT 50.5 ms reused, 152 ms new, DoH, HTTP/2 50.5 ms reused, 153 ms new, DoH, HTTP/3 50.7 ms reused, 103 ms new, DoQ 50.4 ms reused, 103 ms new. 200 ms round trip, 1 % loss: UDP 200 ms reused, 200 ms new, TCP 200 ms reused, 401 ms new, DoT 200 ms reused, 602 ms new, DoH, HTTP/2 201 ms reused, 603 ms new, DoH, HTTP/3 201 ms reused, 403 ms new, DoQ 200 ms reused, 402 ms new. A new connection costs 3 round trips over TCP + TLS and 2 over QUIC; reused, every transport answers in one: on a 50 ms link DoT 152 ms and DoQ 103 ms new, 50.5 ms reused Solid: reused connection · light: new connection, handshake included · median plain DNS over TCP + TLS over QUIC each link has its own scale LAN, no added delay UDP 14 µs · no connection TCP 11 µs → 29 µs DoT 11 µs → 436 µs DoH, HTTP/2 39 µs → 504 µs DoH, HTTP/3 43 µs → 635 µs DoQ 27 µs → 597 µs 50 ms round trip UDP 50.5 ms · 1 round trip · no connection TCP 50.5 ms → 101 ms · 2 round trips DoT 50.5 ms → 152 ms · 3 round trips DoH, HTTP/2 50.5 ms → 153 ms · 3 round trips DoH, HTTP/3 50.7 ms → 103 ms · 2 round trips DoQ 50.4 ms → 103 ms · 2 round trips 200 ms round trip, 1 % loss UDP 200 ms · 1 round trip · no connection TCP 200 ms → 401 ms · 2 round trips DoT 200 ms → 602 ms · 3 round trips DoH, HTTP/2 201 ms → 603 ms · 3 round trips DoH, HTTP/3 201 ms → 403 ms · 2 round trips DoQ 200 ms → 402 ms · 2 round trips Reused, the four encrypted transports cost what UDP costs: one round trip. New, TCP + TLS adds two round trips and QUIC one, because QUIC does its transport and TLS handshakes together.
One query at a time, from sending it until the verified answer is in. Reused: the connection was opened and used once before the clock starts. New: the clock includes opening the connection (TCP and TLS 1.3 handshakes, or the QUIC handshake), and the connection is closed after the answer. Plain UDP has no connection, so both are one round trip. Median of 10 process runs × 50–200 queries; each link has its own scale. The 50 ms link with 5 % loss gave the same medians; it is in the table below.
Time for one small DNS answer (one A record) on a reused connection and on a new connection, handshake included, per link, median. LAN, no added delay: UDP 14 µs reused, 26 µs new, TCP 11 µs reused, 29 µs new, DoT 11 µs reused, 436 µs new, DoH, HTTP/2 39 µs reused, 504 µs new, DoH, HTTP/3 43 µs reused, 635 µs new, DoQ 27 µs reused, 597 µs new. 50 ms round trip: UDP 50.5 ms reused, 50.6 ms new, TCP 50.5 ms reused, 101 ms new, DoT 50.5 ms reused, 152 ms new, DoH, HTTP/2 50.5 ms reused, 153 ms new, DoH, HTTP/3 50.7 ms reused, 103 ms new, DoQ 50.4 ms reused, 103 ms new. 200 ms round trip, 1 % loss: UDP 200 ms reused, 200 ms new, TCP 200 ms reused, 401 ms new, DoT 200 ms reused, 602 ms new, DoH, HTTP/2 201 ms reused, 603 ms new, DoH, HTTP/3 201 ms reused, 403 ms new, DoQ 200 ms reused, 402 ms new. A new connection costs 3 round trips over TCP + TLS and 2 over QUIC; reused, every transport answers in one: on a 50 ms link DoT 152 ms and DoQ 103 ms new, 50.5 ms reused Solid: reused connection · light: new connection, handshake included · median plain DNS over TCP + TLS over QUIC each link has its own scale LAN, no added delay UDP 14 µs · no connection TCP 11 µs → 29 µs DoT 11 µs → 436 µs DoH, HTTP/2 39 µs → 504 µs DoH, HTTP/3 43 µs → 635 µs DoQ 27 µs → 597 µs 50 ms round trip UDP 50.5 ms · 1 round trip · no connection TCP 50.5 ms → 101 ms · 2 round trips DoT 50.5 ms → 152 ms · 3 round trips DoH, HTTP/2 50.5 ms → 153 ms · 3 round trips DoH, HTTP/3 50.7 ms → 103 ms · 2 round trips DoQ 50.4 ms → 103 ms · 2 round trips 200 ms round trip, 1 % loss UDP 200 ms · 1 round trip · no connection TCP 200 ms → 401 ms · 2 round trips DoT 200 ms → 602 ms · 3 round trips DoH, HTTP/2 201 ms → 603 ms · 3 round trips DoH, HTTP/3 201 ms → 403 ms · 2 round trips DoQ 200 ms → 402 ms · 2 round trips Reused, the four encrypted transports cost what UDP costs: one round trip. New, TCP + TLS adds two round trips and QUIC one, because QUIC does its transport and TLS handshakes together.
One query at a time, from sending it until the verified answer is in. Reused: the connection was opened and used once before the clock starts. New: the clock includes opening the connection (TCP and TLS 1.3 handshakes, or the QUIC handshake), and the connection is closed after the answer. Plain UDP has no connection, so both are one round trip. Median of 10 process runs × 50–200 queries; each link has its own scale. The 50 ms link with 5 % loss gave the same medians; it is in the table below.

On a reused connection all six answer in one round trip, 50.4 ms to 50.7 ms on the 50 ms link. Encryption on an open connection costs microseconds of CPU, not round trips. On a new connection the transports split by how they start:

On the LAN the round trips vanish and what is left is CPU: a reused DoT connection answers in 11 µs, a new one in 436 µs, almost all of it the handshake’s cryptography. QUIC is slower to set up here (597 µs for DoQ): quic-go handles every packet in user space, where TCP’s part of the work is done by the kernel.

The full table, median and, below it, the mean over every lookup of every run, which is where lost packets show:

Median · meanLAN, no added delay50 ms RTT200 ms RTT, 1 % loss50 ms RTT, 5 % loss
UDP14 µs
20 µs
50.5 ms
50.5 ms
200 ms
217 ms
50.2 ms
125 ms
TCP, reused11 µs
17 µs
50.5 ms
50.4 ms
200 ms
217 ms
50.3 ms
70.8 ms
TCP, new conn.29 µs
45 µs
101 ms
101 ms
401 ms
434 ms
100 ms
221 ms
DoT, reused11 µs
16 µs
50.5 ms
50.5 ms
200 ms
210 ms
50.4 ms
78.7 ms
DoT, new conn.436 µs
474 µs
152 ms
152 ms
602 ms
658 ms
152 ms
332 ms
DoH, HTTP/2, reused39 µs
51 µs
50.5 ms
50.6 ms
201 ms
212 ms
50.5 ms
96.1 ms
DoH, HTTP/2, new conn.504 µs
551 µs
153 ms
152 ms
603 ms
674 ms
153 ms
341 ms
DoH, HTTP/3, reused43 µs
53 µs
50.7 ms
50.6 ms
201 ms
211 ms
50.5 ms
59.2 ms
DoH, HTTP/3, new conn.635 µs
710 µs
103 ms
103 ms
403 ms
430 ms
103 ms
156 ms
DoQ, reused27 µs
33 µs
50.4 ms
50.4 ms
200 ms
209 ms
50.3 ms
59.4 ms
DoQ, new conn.597 µs
665 µs
103 ms
103 ms
402 ms
443 ms
103 ms
159 ms

Bytes and packets per query

On the wire, the same split. A query and its answer on the LAN, every IP packet in both directions counted:

Bytes on the wire per query and answer, IP headers included, LAN. UDP: 203 B reused, 203 B on a new connection; large answer 5,113 B. TCP: 256 B reused, 687 B on a new connection; large answer 3,312 B. DoT: 300 B reused, 4,672 B on a new connection; large answer 3,356 B. DoH, HTTP/2: 600 B reused, 5,566 B on a new connection; large answer 3,704 B. DoH, HTTP/3: 495 B reused, 7,022 B on a new connection; large answer 2,655 B. DoQ: 390 B reused, 6,819 B on a new connection; large answer 2,466 B. A small answer costs 203 B over UDP, 300 B over a reused DoT connection and 6,819 B with a new DoQ handshake Bytes per query and answer, every IP packet both ways · LAN plain DNS over TCP + TLS over QUIC Small answer, reused connection UDP 203 B · 2 packets TCP 256 B · 2 packets DoT 300 B · 2 packets DoH, HTTP/2 600 B · 6 packets DoH, HTTP/3 495 B · 4 packets DoQ 390 B · 4 packets Small answer, new connection each time UDP 203 B · 2 packets TCP 687 B · 10 packets DoT 4,672 B · 20 packets DoH, HTTP/2 5,566 B · 28 packets DoH, HTTP/3 7,022 B · 13 packets DoQ 6,819 B · 11 packets Large answer (DNSSEC, 3,008 B), reused connection UDP 5,113 B · 16 packets · truncated, then TCP TCP 3,312 B · 5 packets DoT 3,356 B · 5 packets DoH, HTTP/2 3,704 B · 10 packets DoH, HTTP/3 2,655 B · 7 packets DoQ 2,466 B · 6 packets Reused, DoT adds 97 B to a UDP lookup and DoH over HTTP/2 397 B. The handshake is what costs: 16× a reused DoT query, mostly the post- quantum key exchange and the certificate; QUIC also pads its first packets to 1,200 B.
Network interface counters before and after 200 queries on a reused connection or 50 on new ones (handshake and close included), divided by the number of queries; every IP packet in both directions, headers included. Median of 10 process runs. The large answer is 3,008 B of DNS (64 AAAA records, DNSSEC-signed).
Bytes on the wire per query and answer, IP headers included, LAN. UDP: 203 B reused, 203 B on a new connection; large answer 5,113 B. TCP: 256 B reused, 687 B on a new connection; large answer 3,312 B. DoT: 300 B reused, 4,672 B on a new connection; large answer 3,356 B. DoH, HTTP/2: 600 B reused, 5,566 B on a new connection; large answer 3,704 B. DoH, HTTP/3: 495 B reused, 7,022 B on a new connection; large answer 2,655 B. DoQ: 390 B reused, 6,819 B on a new connection; large answer 2,466 B. A small answer costs 203 B over UDP, 300 B over a reused DoT connection and 6,819 B with a new DoQ handshake Bytes per query and answer, every IP packet both ways · LAN plain DNS over TCP + TLS over QUIC Small answer, reused connection UDP 203 B · 2 packets TCP 256 B · 2 packets DoT 300 B · 2 packets DoH, HTTP/2 600 B · 6 packets DoH, HTTP/3 495 B · 4 packets DoQ 390 B · 4 packets Small answer, new connection each time UDP 203 B · 2 packets TCP 687 B · 10 packets DoT 4,672 B · 20 packets DoH, HTTP/2 5,566 B · 28 packets DoH, HTTP/3 7,022 B · 13 packets DoQ 6,819 B · 11 packets Large answer (DNSSEC, 3,008 B), reused connection UDP 5,113 B · 16 packets · truncated, then TCP TCP 3,312 B · 5 packets DoT 3,356 B · 5 packets DoH, HTTP/2 3,704 B · 10 packets DoH, HTTP/3 2,655 B · 7 packets DoQ 2,466 B · 6 packets Reused, DoT adds 97 B to a UDP lookup and DoH over HTTP/2 397 B. The handshake is what costs: 16× a reused DoT query, mostly the post-quantum key exchange and the certificate; QUIC also pads its first packets to 1,200 B.
Network interface counters before and after 200 queries on a reused connection or 50 on new ones (handshake and close included), divided by the number of queries; every IP packet in both directions, headers included. Median of 10 process runs. The large answer is 3,008 B of DNS (64 AAAA records, DNSSEC-signed).

Plain UDP is 203 B in 2 packets: the question, the answer, 28 bytes of IP and UDP header on each. On a reused connection the encrypted transports add little: DoT 300 B (a 22-byte TLS record wrapper each way and TCP’s acknowledgements), DoQ 390 B and DoH over HTTP/2 600 B, which also carries HTTP headers and frames.

A new connection is another matter: 4,672 B for DoT, 6,819 B for DoQ, 7,022 B for DoH over HTTP/3, 23× to 35× the UDP exchange. Most of it is the TLS handshake: Go offers the post-quantum hybrid key exchange X25519MLKEM768 by default, whose key shares are 1,216 bytes in the ClientHello and 1,120 in the ServerHello, plus the certificate. QUIC adds its own rule on top: a client’s first packets must be padded to at least 1,200 bytes, so a server cannot be used to amplify traffic towards a forged address.

A resolver that opens a connection per lookup pays this every time. One that keeps it open pays it once, which is why the idle cost below matters.

Large answers

DNSSEC signatures, long TXT records and many-address answers make responses big. Since DNS Flag Day 2020, resolvers advertise a 1,232-byte EDNS buffer, small enough to never be fragmented on any normal path. A larger answer over UDP comes back truncated, with the TC bit set, and the client must ask again over TCP. Over a connection that is already open, nothing of the sort happens.

Time for a small and a large (DNSSEC-signed, over 1,232 B) answer on a reused connection, median. 50 ms round trip: UDP 50.5 ms small, 151 ms large, TCP 50.5 ms small, 50.3 ms large, DoT 50.5 ms small, 50.3 ms large, DoH, HTTP/2 50.5 ms small, 50.5 ms large, DoH, HTTP/3 50.7 ms small, 50.6 ms large, DoQ 50.4 ms small, 50.4 ms large. 200 ms round trip, 1 % loss: UDP 200 ms small, 601 ms large, TCP 200 ms small, 200 ms large, DoT 200 ms small, 200 ms large, DoH, HTTP/2 201 ms small, 201 ms large, DoH, HTTP/3 201 ms small, 201 ms large, DoQ 200 ms small, 201 ms large. An answer too big for UDP takes 3 round trips (151 ms at 50 ms): truncated, then a new TCP connection; on an open encrypted connection it takes one Solid: small answer · light: large answer (3,008 B) · reused connection · median plain DNS over TCP + TLS over QUIC 50 ms round trip UDP 50.5 ms → 151 ms · 3 round trips TCP 50.5 ms → 50.3 ms · 1 round trip DoT 50.5 ms → 50.3 ms · 1 round trip DoH, HTTP/2 50.5 ms → 50.5 ms · 1 round trip DoH, HTTP/3 50.7 ms → 50.6 ms · 1 round trip DoQ 50.4 ms → 50.4 ms · 1 round trip 200 ms round trip, 1 % loss UDP 200 ms → 601 ms · 3 round trips TCP 200 ms → 200 ms · 1 round trip DoT 200 ms → 200 ms · 1 round trip DoH, HTTP/2 201 ms → 201 ms · 1 round trip DoH, HTTP/3 201 ms → 201 ms · 1 round trip DoQ 200 ms → 201 ms · 1 round trip Plain DNS pays for size in round trips: the truncated UDP answer, then a TCP handshake, then the query again. Over a connection that is already open, size costs only bytes.
Every query carries EDNS(0) with the 1,232-byte buffer of DNS Flag Day 2020. Over UDP the server sets the TC bit and the client asks again over a new TCP connection, as stub resolvers do. Median of 10 process runs.
Time for a small and a large (DNSSEC-signed, over 1,232 B) answer on a reused connection, median. 50 ms round trip: UDP 50.5 ms small, 151 ms large, TCP 50.5 ms small, 50.3 ms large, DoT 50.5 ms small, 50.3 ms large, DoH, HTTP/2 50.5 ms small, 50.5 ms large, DoH, HTTP/3 50.7 ms small, 50.6 ms large, DoQ 50.4 ms small, 50.4 ms large. 200 ms round trip, 1 % loss: UDP 200 ms small, 601 ms large, TCP 200 ms small, 200 ms large, DoT 200 ms small, 200 ms large, DoH, HTTP/2 201 ms small, 201 ms large, DoH, HTTP/3 201 ms small, 201 ms large, DoQ 200 ms small, 201 ms large. An answer too big for UDP takes 3 round trips (151 ms at 50 ms): truncated, then a new TCP connection; on an open encrypted connection it takes one Solid: small answer · light: large answer (3,008 B) · reused connection · median plain DNS over TCP + TLS over QUIC 50 ms round trip UDP 50.5 ms → 151 ms · 3 round trips TCP 50.5 ms → 50.3 ms · 1 round trip DoT 50.5 ms → 50.3 ms · 1 round trip DoH, HTTP/2 50.5 ms → 50.5 ms · 1 round trip DoH, HTTP/3 50.7 ms → 50.6 ms · 1 round trip DoQ 50.4 ms → 50.4 ms · 1 round trip 200 ms round trip, 1 % loss UDP 200 ms → 601 ms · 3 round trips TCP 200 ms → 200 ms · 1 round trip DoT 200 ms → 200 ms · 1 round trip DoH, HTTP/2 201 ms → 201 ms · 1 round trip DoH, HTTP/3 201 ms → 201 ms · 1 round trip DoQ 200 ms → 201 ms · 1 round trip Plain DNS pays for size in round trips: the truncated UDP answer, then a TCP handshake, then the query again. Over a connection that is already open, size costs only bytes.
Every query carries EDNS(0) with the 1,232-byte buffer of DNS Flag Day 2020. Over UDP the server sets the TC bit and the client asks again over a new TCP connection, as stub resolvers do. Median of 10 process runs.

The UDP path costs 151 ms on the 50 ms link, 3 round trips: the truncated answer, the TCP handshake, the question again. That is the same as opening a new DoT connection, and it costs 5,113 B on the wire, more than DoT on an open connection (3,356 B). On the lossy 200 ms link: 601 ms against 200 ms for an open DoT connection.

One server behaviour came out of the check. With the same 1,232-byte buffer that every other query carries, CoreDNS 1.15.0 truncated the large answer on both QUIC transports as if they were UDP:

Large answer, EDNS buffer 1,232 BTC bit setAnswer records
TCPno65 of 65
DoTno65 of 65
DoH, HTTP/2no65 of 65
DoH, HTTP/3yes42 of 65
DoQyes42 of 65

RFC 9250 §4.6 says the EDNS buffer size “is ignored by DoQ” and that DoQ implementations always assume 65,535 bytes. A client that follows the RFC and sends the usual 1,232 gets 42 of 65 records with the TC bit, and nowhere obvious to retry: it is already on an encrypted connection. Every check in this benchmark caught it as a wrong answer, so the DoQ and HTTP/3 measurements send a 65,535-byte buffer, which CoreDNS honours. If you run DoQ or DoH over HTTP/3 on CoreDNS, set the client’s buffer size accordingly, or DNSSEC answers will arrive incomplete.

Packet loss

Loss is where transports differ most, and where plain UDP’s simplicity costs: it has no retransmission of its own. If the question or the answer is lost, the client waits for a timeout and asks again. The client here waits 1 s; glibc’s resolver, the default on most Linux systems, waits 5 s.

Small answer on a reused connection with packet loss, median and mean over all lookups. 200 ms round trip, 1 % loss: UDP 200 ms median, 217 ms mean, TCP 200 ms median, 217 ms mean, DoT 200 ms median, 210 ms mean, DoH, HTTP/2 201 ms median, 212 ms mean, DoH, HTTP/3 201 ms median, 211 ms mean, DoQ 200 ms median, 209 ms mean. 50 ms round trip, 5 % loss: UDP 50.2 ms median, 125 ms mean, TCP 50.3 ms median, 70.8 ms mean, DoT 50.4 ms median, 78.7 ms mean, DoH, HTTP/2 50.5 ms median, 96.1 ms mean, DoH, HTTP/3 50.5 ms median, 59.2 ms mean, DoQ 50.3 ms median, 59.4 ms mean. At 5 % loss a lost UDP packet waits the full 1 s resend: 125 ms per lookup on average, 50–351 ms across runs; TCP and QUIC retransmit sooner, 56–117 ms and 54–73 ms Solid: median · light: mean over every lookup · grey line: lowest to highest run mean · reused connection, small answer plain DNS over TCP + TLS over QUIC 200 ms round trip, 1 % loss UDP 200 ms → mean 217 ms TCP 200 ms → mean 217 ms DoT 200 ms → mean 210 ms DoH, HTTP/2 201 ms → mean 212 ms DoH, HTTP/3 201 ms → mean 211 ms DoQ 200 ms → mean 209 ms Run means 200–267 ms on every transport: the order is noise. 50 ms round trip, 5 % loss UDP 50.2 ms → mean 125 ms TCP 50.3 ms → mean 70.8 ms DoT 50.4 ms → mean 78.7 ms DoH, HTTP/2 50.5 ms → mean 96.1 ms DoH, HTTP/3 50.5 ms → mean 59.2 ms DoQ 50.3 ms → mean 59.4 ms Run means: UDP 50–351 ms · TCP + TLS 56–117 ms · QUIC 54–73 ms. The median is the round trip on every transport. The average is the retransmission timer: a stub's fixed UDP timeout against TCP's and QUIC's timers, which adapt to the measured round trip. At 1 % loss, 30 lookups a run see 0–2 losses, too few to order the transports.
Same measurement as the first figure, reused connections, with random loss in each direction. Solid: median of the 10 run medians; light: mean over all 300 and 400 lookups of the 10 runs, where the lost ones show; grey line: the lowest to the highest of the 10 run means, so bars whose lines overlap swap places from run to run. The UDP client resends after 1 s without an answer; TCP and QUIC retransmit on their own timers.
Small answer on a reused connection with packet loss, median and mean over all lookups. 200 ms round trip, 1 % loss: UDP 200 ms median, 217 ms mean, TCP 200 ms median, 217 ms mean, DoT 200 ms median, 210 ms mean, DoH, HTTP/2 201 ms median, 212 ms mean, DoH, HTTP/3 201 ms median, 211 ms mean, DoQ 200 ms median, 209 ms mean. 50 ms round trip, 5 % loss: UDP 50.2 ms median, 125 ms mean, TCP 50.3 ms median, 70.8 ms mean, DoT 50.4 ms median, 78.7 ms mean, DoH, HTTP/2 50.5 ms median, 96.1 ms mean, DoH, HTTP/3 50.5 ms median, 59.2 ms mean, DoQ 50.3 ms median, 59.4 ms mean. At 5 % loss a lost UDP packet waits the full 1 s resend: 125 ms per lookup on average, 50–351 ms across runs; TCP and QUIC retransmit sooner, 56–117 ms and 54–73 ms Solid: median · light: mean over every lookup · grey line: lowest to highest run mean · reused connection, small answer plain DNS over TCP + TLS over QUIC 200 ms round trip, 1 % loss UDP 200 ms → mean 217 ms TCP 200 ms → mean 217 ms DoT 200 ms → mean 210 ms DoH, HTTP/2 201 ms → mean 212 ms DoH, HTTP/3 201 ms → mean 211 ms DoQ 200 ms → mean 209 ms Run means 200–267 ms on every transport: the order is noise. 50 ms round trip, 5 % loss UDP 50.2 ms → mean 125 ms TCP 50.3 ms → mean 70.8 ms DoT 50.4 ms → mean 78.7 ms DoH, HTTP/2 50.5 ms → mean 96.1 ms DoH, HTTP/3 50.5 ms → mean 59.2 ms DoQ 50.3 ms → mean 59.4 ms Run means: UDP 50–351 ms · TCP + TLS 56–117 ms · QUIC 54–73 ms. The median is the round trip on every transport. The average is the retransmission timer: a stub's fixed UDP timeout against TCP's and QUIC's timers, which adapt to the measured round trip. At 1 % loss, 30 lookups a run see 0–2 losses, too few to order the transports.
Same measurement as the first figure, reused connections, with random loss in each direction. Solid: median of the 10 run medians; light: mean over all 300 and 400 lookups of the 10 runs, where the lost ones show; grey line: the lowest to the highest of the 10 run means, so bars whose lines overlap swap places from run to run. The UDP client resends after 1 s without an answer; TCP and QUIC retransmit on their own timers.

The median is the round trip on every transport and both lossy links; loss shows in the average. At 1 % loss in each direction it costs little: on the 200 ms link the six means are 209–217 ms, and with 30 lookups a run, of which 0–2 are hit, their order changes from run to run. At 5 % in each direction about one UDP lookup in ten loses its question or its answer and waits the full second: 125 ms on average, 50–351 ms across runs, and the slowest 1 % of each run took 1,051 ms. TCP and QUIC resend on timers derived from the measured round trip: DoT averages 78.7 ms (slowest 1 %: 323 ms), DoQ 59.4 ms (143 ms). DoH over HTTP/2 rides the same TCP as DoT and averaged 96.1 ms; each lookup is 6 packets instead of 2, so more of them can be lost, but the two swap places between runs (DoT 57–117 ms, DoH 63–112 ms), so that is a hint, not a result.

New connections suffer more: a lost handshake packet costs TCP a 1 s SYN timeout and QUIC its probe timeout. At 5 % loss a lookup on a new DoT connection averages 332 ms (slowest 1 %: 1,167 ms), on a new DoQ connection 159 ms (396 ms): fewer packets in the handshake, fewer to lose.

Some never finish. CoreDNS does not wait indefinitely for a slow connection: when the handshake and the query were still incomplete about 4 s after the client started, the server closed the connection without an answer (the client sees EOF). That happened to 2 of the new-connection lookups in the whole benchmark, all at 5 % loss (DoH, HTTP/2, new connection, small answer, 50 ms, 5 % loss: 1 of 20; DoT, new connection, large answer, 50 ms, 5 % loss: 1 of 20). Each cell run with such a failure was repeated once, so the numbers above count only completed runs; a real client would have to start over, after already losing those seconds.

Queries per second on one connection

A busy forwarder sends many lookups over one upstream connection. Here the client keeps 100 queries in flight on a single connection for 3 s on the LAN and 10 s on the lossy link and counts verified answers per second:

Queries/s, one connection
100 in flight
LAN200 ms
1 % loss
UDP307,136
301,919–311,323
449
437–455
TCP272,002
268,237–273,713
245
225–270
DoT305,057
300,835–306,624
255
228–286
DoH, HTTP/265,220
64,573–66,328
230
221–260
DoH, HTTP/3105,665
103,428–106,429
436
422–460
DoQ161,516
157,121–165,496
460
433–476

On the LAN this measures software, the server on two cores. DoT and plain TCP pipeline: the client writes queries back to back and CoreDNS answers them in order on the one connection, 305,057 a second for DoT. DoQ opens one QUIC stream per query (161,516 a second); DoH pays for HTTP on top: 65,220 a second over HTTP/2 and 105,665 over HTTP/3. UDP from one socket reached 307,136.

On the lossy 200 ms link it measures how loss on one connection affects the other 99 queries. On TCP, a lost segment holds back everything behind it until it is retransmitted (head-of-line blocking): 255 queries a second for DoT. QUIC streams are independent, so a lost packet only delays the queries in it: 460 for DoQ. UDP: 449, since only the lost query itself waits for its 1 s resend. With 100 in flight on a 200 ms round trip, 500 a second is the ceiling for any of them.

Idle connections

Keeping a connection open makes every later lookup one round trip. How long does the server let it stay open? Each cell opened 100 connections, sent one query on each and left them idle for 15 s:

Held idle 15 sServer closed it afterStill usableServer RSS growth per connectionBytes in 15 s
TCP9.9 s0 of 1000 KB
0 to 11
104 B
DoT9.9 s0 of 10014 KB
6 to 37
232 B
DoH, HTTP/29.9 s0 of 1005 KB
0 to 14
347 B
DoH, HTTP/310.0 s0 of 10028 KB
20 to 49
452 B
DoQ10.0 s0 of 1006 KB
-5 to 22
402 B

CoreDNS closes every idle connection, on all five connection-based transports, after about 10 s. A client that wants a warm connection must either send something more often than that, or reconnect, paying the handshake of the bytes section again. RFC 7858 suggests that DoT clients keep connections open, and RFC 7828’s edns-tcp-keepalive option lets a server announce a longer timeout; the client here did not ask for it, so these are the server’s defaults. While open, a connection costs the server little memory: CoreDNS’s resident memory grew by 14 KB per held DoT connection and 28 KB per HTTP/3 connection (median, 100 held). It is a coarse measure, since Go’s runtime takes and returns memory in large steps, as the min–max spread shows.

What this does not show

What the numbers say

Reproduce it

The harness is a Go client (dq), a Corefile, a zone and a driver script. It builds one image, starts CoreDNS in the client’s network namespace, and runs every cell as a fresh client process:

./setup.sh                  # throwaway CA + certificate, DNSSEC-signed zone
docker build -t dqb .       # Go build of the client
./up.sh 4-7 2-3             # client cores, server cores
docker exec dns-net tc qdisc replace dev lo root netem delay 25ms limit 100000   # the 50 ms link
docker exec dns-net dq -test lat -tr doq -q small -mode cold -n 20 -settle 300ms

Each run prints one JSON line: latency percentiles, handshake time, bytes and packets per query, UDP resends and truncations, and the check result, answers sent, verified and failed.

Questions? Let's Chat :)

protocols