Skip to content

Instantly share code, notes, and snippets.

@haraldmartin
Forked from peterc/domainavailable
Created February 13, 2009 13:53
Show Gist options
  • Save haraldmartin/63903 to your computer and use it in GitHub Desktop.
Save haraldmartin/63903 to your computer and use it in GitHub Desktop.
#!/bin/sh
# 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
for d in $@;
do
if nslookup $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
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment