Skip to content
אצלי
Go back

dnsbench: which DNS resolver is fastest on your connection, and which CDN it sends you to

Captura da interface de terminal do dnsbench com o ranking de 21 resolvers DNS medidos em uma conexão real, com colunas de score, latência, jitter, perda, penalidade de edge de CDN e selos de DNSSEC e filtragem

Also available in Portuguese: dnsbench: qual DNS é mais rápido na sua conexão, e para qual CDN ele te manda.

Every public DNS ranking answers the same question: which resolver is fastest, on average, as seen from datacenters around the world. My question is different: which one is fastest from my link, on my ISP, right now, and does it then send me to the right CDN edge?

Almost nobody measures that second part. A resolver that wins by 2 ms on lookup and loses by 90 ms on edge selection has lost, even while leading the table. That is why I wrote dnsbench.

What it is

A single static binary, with no runtime dependencies, no telemetry and no traffic beyond the measurement itself. It has a CLI and a full-screen TUI (--tui).

It is written in V, a language I covered in the introduction to V and in the from Bash to V guide, both in Portuguese. The documents in docs/ were written before the code and describe the finished tool. When code and document disagree, the code is the bug.

What it measures

Nine probes, picked with --probes: cached lookups (warm), tcp, forced cold cache (cold), CDN edge penalty (ecs), fresh DoT handshake versus a reused connection (dot-fresh and dot-warm), doh, dnssec (which resolvers actually validate) and filter (a measured ad-filtering verdict). The transports are UDP, TCP, DoT and DoH. DoQ waits for QUIC in V.

Terminal showing the dnsbench 0.1.0 TUI at the end of a full battery on network AS27699 (Telefônica Brasil), with 21 providers. The table has the columns SCORE, p50, p95, JIT, LOSS, EDGE, MIS, DoT and FLAGS. AdGuard leads with 76.6 and a p50 of 8.4 ms, followed by Quad9 (unfiltered), Quad9 (ECS) and NextDNS (public). Further down are the lower-ranked providers, such as DNS4EU with an EDGE of +200.1 ms, and, set apart at the bottom, the local resolvers 127.0.0.1 and 127.0.0.53. The footer lists the keyboard shortcuts

This is the full battery on my connection. The EDGE column is the CDN penalty. Local resolvers sit apart at the bottom, labelled as cache and left out of the comparison. In the flags on the right, +DNSSEC and -ads are measured by the probes. The ones starting with ~, like ~nolog, are just the provider’s own claim: dnsbench repeats it, it does not verify it.

Usage

dnsbench --tui --probes warm,cold,ecs,dot-warm,dnssec,filter
dnsbench --format json
dnsbench --watch 15m --history ~/.local/share/dnsbench/runs.jsonl --only quad9,cloudflare

The dnsbench TUI in the middle of a run, with the progress bar at 50 of 912 queries and 6 seconds elapsed. The table lists the providers that have no score yet, grouped under "not ranked", with the latency columns empty and only the declared flags, such as ~nolog and ~nofilter, filled in

The table fills in while the run happens. s sorts, tab switches the probe behind the latency columns, / searches, enter opens a provider’s detail view and e exports. With p I cycle the weight profile and the ranking changes without measuring anything again, which is the honest way to show how much of a result is network and how much is weighting.

Design choices

It also does not change your system’s DNS. It measures and reports, and the decision is yours.

Installation

Static binaries (amd64 and arm64) are on the releases page, with SHA256SUMS.

If you prefer to build from source, you need V 0.5.2 or newer:

git clone https://github.com/Esl1h/DNSbench && cd DNSbench
make build
make install

The current version is v0.2.1, MIT licensed. The full guide is docs/USAGE.md and the code is at github.com/Esl1h/DNSbench.


Share this post on:

Previous Post
ykoxide: a minha caixa de ferramentas da YubiKey virou um binário em Rust
Next Post
dnsbench: qual DNS é mais rápido na sua conexão, e para qual CDN ele te manda