Skip to content

Instantly share code, notes, and snippets.

@dedeibel
Last active September 27, 2021 20:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dedeibel/ea042f50b239632753ac035958145427 to your computer and use it in GitHub Desktop.
Save dedeibel/ea042f50b239632753ac035958145427 to your computer and use it in GitHub Desktop.
Compare some DNS response times
#!/bin/bash
DOM=scalzi.com
if [[ -n "$1" ]]; then
DOM="$1"
fi
echo $DOM
# parallel -j 10 -N 2 --tagstring '{2} ({1})' "dig @{1} a "${DOM}" | egrep time" \
parallel -j 10 -N 2 --tagstring '{2} ({1})' "dig @{1} a "${DOM}" +noauthority +noadditional | grep -Po 'A.*(\.[^.]+){3}|(?:time: )(.*)' | tac | paste -sd '\t'" \
::: \
9.9.9.9 quad9 \
149.112.112.112 quad9_secondary \
9.9.9.11 quad9_ecs \
9.9.9.10 quad9_unfiltered \
2620:fe::fe quad9_IPv6 \
8.8.8.8 google \
1.1.1.1 cloudflare \
2606:4700:4700::64 cloudflare_IPv6 \
84.200.69.80 dns.watch \
82.145.9.8 1und1 \
| column -t \
| sort -h
@dedeibel
Copy link
Author

dedeibel commented Sep 26, 2021

dns-bench github.com
github.com
cloudflare        (1.1.1.1)             time:  16  msec  A  140.82.121.4
cloudflare_IPv6   (2606:4700:4700::64)  time:  16  msec  A  140.82.121.4
dns.watch         (84.200.69.80)        time:  12  msec  A  140.82.121.4
google            (8.8.8.8)             time:  28  msec  A  140.82.121.4
quad9             (9.9.9.9)             time:  28  msec  A  140.82.121.4
quad9_ecs         (9.9.9.11)            time:  20  msec  A  140.82.121.3
quad9_IPv6        (2620:fe::fe)         time:  24  msec  A  140.82.121.4
quad9_secondary   (149.112.112.112)     time:  24  msec  A  140.82.121.4
quad9_unfiltered  (9.9.9.10)            time:  24  msec  A  140.82.121.3
1und1             (82.145.9.8)          time:  12  msec  A  140.82.121.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment