Created
January 13, 2011 23:31
-
-
Save oogali/778840 to your computer and use it in GitHub Desktop.
A way to search for "cute" domains, without blowing through WHOIS usage limits
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 characters
#!/bin/sh | |
# "Cute" domain search -- < oogali AT gmail.com > | |
# | |
# Example: | |
# [oogali@illusion ~]$ ./cute-domain-search am 2 | |
# IL.AM IS AVAILABLE | |
# LE.AM IS AVAILABLE | |
# LY.AM IS AVAILABLE | |
# OG.AM IS AVAILABLE | |
# OL.AM IS AVAILABLE | |
# QT.AM IS AVAILABLE | |
# ST.AM IS AVAILABLE | |
# TI.AM IS AVAILABLE | |
# | |
# And yes, it pains me that the documentation is more lines than the | |
# actual script itself | |
if [ $# -ne 2 ]; then | |
echo "$0 <tld> <# of letters>" | |
exit 1 | |
fi | |
tld=${1} | |
letters=${2} | |
rs=`dig ${tld} @a.root-servers.net ns +noadditional +noquestion +nostats +nocomments | grep "^${tld}" | awk '{ print $5 }' | head -1` | |
for domain in `egrep "^[A-Za-z]{${letters}}${tld}\$" /usr/share/dict/words | tr '[A-Z]' '[a-z]' | sort | uniq | sed "s/${tld}\$//"` ; do | |
dig ${domain}.${tld} ns @${rs} | grep -q 'NXDOMAIN' && echo "${domain}.${tld} is available" | tr '[a-z]' '[A-Z]' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment