# Measure your DNS resolvers before picking one

Published 2026-06-21 · DNS, networking, dig · https://home.tigran.manukyan.dev/notes/measuring-dns-resolvers.html

**TL;DR:** Public DNS resolver speed depends on your ISP's routing. Benchmark 1.1.1.1, 8.8.8.8 and 9.9.9.9 from your own network with dig and random uncached names, and compare median and worst-case latency.

Every "fastest DNS" list was measured from somebody else's network. Anycast routing depends on your ISP's peering, so the resolver that is 5 ms away for them can be 60 ms away for you.

## A quick loop

```
for r in 1.1.1.1 8.8.8.8 9.9.9.9; do
  printf '%-10s' "$r"
  for i in 1 2 3 4 5; do
    dig @"$r" "example$RANDOM.com" +tries=1 +time=2 | awk '/Query time/{printf "%5s ms", $4}'
  done
  echo
done
```

The random name skips the resolver's cache, so you measure the full lookup, not a cache hit. Run it at a few times of day. Evening numbers are usually the honest ones.

## What to look at

Look at the median and the worst result, not the best one. A resolver that holds steady at 8 ms beats one that swings between 3 and 90 ms.
