Created
September 3, 2012 19:27
-
-
Save safarista/3612643 to your computer and use it in GitHub Desktop.
Fast domain availability checker using bash
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 | |
# domainavailable | |
# Fast, domain name checker to use from the shell | |
# Use globs for real fun: | |
# domainavailable blah{1..3}.{com,net,org,co.uk} | |
# Inspired by foca / giles: | |
# http://gilesbowkett.blogspot.com/2009/02/simple-bash-domain-availability.html | |
trap 'exit 1' INT TERM EXIT | |
for d in $@; | |
do | |
if host $d | grep "NXDOMAIN" >&/dev/null; then | |
if whois $d | grep -E "(No match for|NOT FOUND)" >&/dev/null; then | |
echo "$d AVAILABLE"; | |
else | |
echo "$d taken"; | |
fi | |
else | |
echo "$d taken"; | |
fi | |
sleep 0.1; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment