Wednesday, May 25, 2011

26 x 26 x 2 - #!/bin/bashing Your Way to a Good Domain

The state of the domain world is pretty grim.  There's some helpful sites such as impossibility.org (props to chaosmachine of HN), bustaname.com and namestation.com but the real problem is not search methods but the search space itself.

Here's a quick little bash script I threw together to search through
permuatations of [a-z][a-z]name.com and name[a-z][a-z].com.  Feel free to adapt this script for your own needs. Happy Hacking.


#!/bin/bash

# All-permissive Copying License
#
# Copyright 2011 Babo Labs, LLC - http://babolabs.com/
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice and
# this notice are preserved.

verbose=0;
word=$1;

while getopts v: OPT; do
    case "$OPT" in
        v)
            echo "VERBOSE MODE"
            verbose=1;
            word=$2;
            ;;
    esac
done
echo "Finding all permutations of [a-z][a-z]$word.com"

for fl in `echo {a..z}`;
do
    for sl in `echo {a..z}`; 
    do
        whois $fl$sl$word'.com' | grep "No match" > /dev/null;
        if [ "$?" -eq "0" ]; then
            echo $fl$sl$word'.com': **AVAILABLE**;
        else
            if [ $verbose -eq 1 ]; then
                echo $fl$sl$word'.com': NO;
            fi
        fi
    done
    for sl in `echo {a..z}`; 
    do
        whois $word$fl$sl'.com' | grep "No match" > /dev/null;
        if [ "$?" -eq "0" ]; then
            echo $word$fl$sl'.com': **AVAILABLE**;
        else
            if [ $verbose -eq 1 ]; then
                echo $fl$sl$word'.com': NO;
            fi
        fi
    done
done

Best of luck in your own domain search.

sabalaba & mek

2 comments:

  1. Thanks. I was working on a script to do something similar the other day and this saves me a bunch of time.

    ReplyDelete
  2. Glad you liked it, feel free to share your modifications.

    ReplyDelete