Skip to content

Instantly share code, notes, and snippets.

@jsarenik
Last active August 29, 2015 14:06
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 jsarenik/cbaa9f694e9cf3faaa7f to your computer and use it in GitHub Desktop.
Save jsarenik/cbaa9f694e9cf3faaa7f to your computer and use it in GitHub Desktop.
Test responsiveness of all TLD nameservers
#!/bin/bash
set -m
test "$1" = "-n" && { opt=+norecurse; shift; }
DOMAIN=${1:-'apiary.io'}
TLD=${DOMAIN##*.}
dig -t NS +noadditional ${TLD}. @a.root-servers.net \
| grep "^${TLD}." \
| while read one two three four five
do
addr=$five; str="Testing ${addr}... "
if
dig +time=1 $opt ${DOMAIN}. @$addr >/dev/null 2>&1
then
echo $str OK
else
echo $str TIME OUT
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment