Last active
August 29, 2015 14:06
-
-
Save jsarenik/cbaa9f694e9cf3faaa7f to your computer and use it in GitHub Desktop.
Test responsiveness of all TLD nameservers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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