Skip to content

Instantly share code, notes, and snippets.

@dotiful
Last active February 2, 2019 19:34
Show Gist options
  • Save dotiful/984a76abdcbb9fc360a50093e1338feb to your computer and use it in GitHub Desktop.
Save dotiful/984a76abdcbb9fc360a50093e1338feb to your computer and use it in GitHub Desktop.
Testing DNS Speeds
#!/usr/bin/env bash
for domain in twitter.com tosbourn.com i.ua; do \
google_dns=$(dig @8.8.8.8 ${domain} | awk '/msec/{print $4}')
cloudflare_dns=$(dig @1.1.1.1 ${domain} | awk '/msec/{print $4}')
open_dns=$(dig @208.67.222.222 ${domain} | awk '/msec/{print $4}')
printf "${domain}\tCloudFlare DNS ${cloudflare_dns}ms\tGoogle DNS ${google_dns}ms\tOpenDNS ${open_dns}ms\n"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment