Skip to content

Instantly share code, notes, and snippets.

@hotheadhacker
Last active September 23, 2022 17:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hotheadhacker/873519dea910b70bfc0137c527583056 to your computer and use it in GitHub Desktop.
Save hotheadhacker/873519dea910b70bfc0137c527583056 to your computer and use it in GitHub Desktop.
#!/bin/bash
# dependency: apt install whois
if [ "$#" == "0" ]; then
echo "You need tu supply at least one argument!"
exit 1
fi
echo "starting..."
DOMAINS=( '.link' '.ly' '.com' '.co.uk' '.net' '.info' '.mobi' \
'.org' '.tel' '.biz' '.tv' '.cc' '.eu' '.ru' \
'.in' '.it' '.sk' '.com.au' )
ELEMENTS=${#DOMAINS[@]}
while (( "$#" )); do
for (( i=0;i<$ELEMENTS;i++)); do
whois $1${DOMAINS[${i}]} | egrep -q \
'^No match|^NOT FOUND|^Not fo|AVAILABLE|^No Data Fou|has not been regi|No entri|Not Found|available'
if [ $? -eq 0 ]; then
echo "$1${DOMAINS[${i}]} : available"
fi
done
shift
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment