There were some occasions to post this in a few threads.
So now I put it in a place.
Feel free to recommend DNS providers I should add (or remove).
Or anything else I suppose.
Example run
$ dnsdig
Test common resolvers by calculating average response times of 3 queries.
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
DNS Primary Secondary
AdGuard 94.140.14.14 94.140.15.15
CleanBrowsing 185.228.168.9 185.228.169.9
Cloudflare 1.1.1.1 1.0.0.1
Comodo 8.26.56.26 8.20.247.20
Control-D 76.76.2.2 76.76.10.2
dns0.eu 193.110.81.0 185.253.5.0
DNSFilter 103.247.36.36 103.247.37.37
Dyn/Oracle 216.146.35.35 216.146.36.36
FlashStart 185.236.104.104 185.236.105.105
Gcore 95.85.95.85 2.56.220.2
Google 8.8.8.8 8.8.4.4
Level3/Lumen 209.244.0.3 209.244.0.4
NextDNS 45.90.28.105 45.90.30.105
OpenDNS/Cisco 208.67.222.222 208.67.220.220
Quad9 9.9.9.9 149.112.112.112
SafeDNS 195.46.39.39 195.46.39.40
UltraDNS/Vercara 64.6.64.6 64.6.65.6
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Do you wish to flush the DNS cache (y/N)? y
Current DNS 127.0.0.53
Avg time: 3.33333 ms
FlashStart 185.236.104.104
Avg time: 8.66667 ms
Cloudflare 1.1.1.1
Avg time: 17.6667 ms
SafeDNS 195.46.39.39
Avg time: 18.3333 ms
Control-D 76.76.2.2
Avg time: 28.3333 ms
Quad9 9.9.9.9
Avg time: 28.3333 ms
DNSFilter 103.247.36.36
Avg time: 29.3333 ms
NextDNS 45.90.28.105
Avg time: 29.3333 ms
Level3/Lumen 209.244.0.3
Avg time: 30 ms
UltraDNS/Vercara 64.6.64.6
Avg time: 36 ms
AdGuard 94.140.14.14
Avg time: 47 ms
OpenDNS/Cisco 208.67.222.222
Avg time: 50.6667 ms
Google 8.8.8.8
Avg time: 56 ms
Comodo 8.26.56.26
Avg time: 79.3333 ms
CleanBrowsing 185.228.168.9
Avg time: 94.3333 ms
Gcore 95.85.95.85
Avg time: 103.333 ms
dns0.eu 193.110.81.0
Avg time: 212 ms
Dyn/Oracle 216.146.35.35
Avg time: 241.667 ms
Note
As with many of my scripts .. this can be run remotely, with no need to download, as well:
bash <(curl -s https://gitlab.com/cscs/dnsdig/-/raw/main/dnsdig)