3 ms·
DNS can work very well over TCP and TLS. It avoids most head-of-line blocking problems, because responses are usually small (a few KB), and they can be returned
by fanf2 9y ago
DNS can work very well over TCP and TLS. It avoids most head-of-line blocking problems, because responses are usually small (a few KB), and they can be returned out-of-order. It's still relatively new for servers to implement DNS-over-TCP well (i.e. handling pipelined queries concurrently, and returning responses out-of-order) - you need BIND 9.11 or `dnsdist`. I did some brief testing yesterday, and in most cases TCP is as fast as UDP or faster. I was using a client based on `adns` which keeps one persistent TCP connection open.
Unbound 1.6.0 TCP 8s
Unbound 1.6.0 UDP 0.4s
BIND 9.11 TCP 0.5s
BIND 9.11 UDP 0.5s
BIND 9.10 TCP 3s
BIND 9.10 UDP 0.5s
1.1.1.1 TCP 0.5s
1.1.1.1 UDP 0.4s
8.8.8.8 TCP 5s # drops connection after 60 queries
8.8.8.8 UDP 220s # it hates me
9.9.9.9 TCP 1s
9.9.9.9 UDP 3s
64.6.64.6 TCP 0.5s
64.6.64.6 UDP 0.5s
https://www.ietf.org/mail-archive/web/dns-privacy/current/msg01935.html https://www.ietf.org/mail-archive/web/dns-privacy/current/ms...
- gnode 9y agoI'm aware that this is the case once the connection is established. What I was referring to was the latency of TCP and TLS connection establishment, involving multiple round trips. Maintaining a persistent connection introduces the problem of requiring the DNS server maintain state for each client.