Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/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
Add Comment
Please, Sign In to add comment