Created
October 26, 2015 11:51
-
-
Save rquigley/8fbcfac487c0b4529cca to your computer and use it in GitHub Desktop.
Revisions
-
rquigley created this gist
Oct 26, 2015 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ #!/bin/bash set -e set -o pipefail BIN="/usr/bin/whois" DOMAIN=$1 echo "Fetching domain's whois server..." RES=$($BIN $DOMAIN) SERVER=$(echo "$RES" | grep -i whois\ server: | head -1 | awk '{print $NF'}) if [[ $SERVER ]]; then echo "Querying whois server '$SERVER'..." # Avoid rate-limiting sleep 1 $BIN -h $SERVER $DOMAIN else echo "$RES" fi exit 0