Nov 2, 2012

Linux: Bash script to check availability of domain names in differnet TLDs

If you want to check whether your desired domain name is available or not in different extensions, it’s tiresome to search it for each and every tld. There are also limits of performing query to whois on websites, where they will not allow you unlimited whois information queries. It’s better to have your own script which will tell you the availibility of domain name in different extensions, right from your terminal.

Below script will check your domain name for TLDs .com, .net, .org, .info, .us, .co, .tel, .tv, .biz, .cc, .ru, .eu, .in, .it, .sk,, .sh, .re and .dk
But you can add other TLDs also if you want.

First create a file, e.g., and give it proper permission to execute.

chmod 744

Now, copy below code to this newly created file


if [ "$#" == "0" ]; then
    echo "You need to supply at least one domain name!" 
    exit 1

DOMAINS=( '.com' '.net' '.info' '.us' '.co' \ 
'.org' '.tel' '.biz' '.tv' '.cc' '.eu' '.ru' \ 
'.in' '.it' '.sk' '' '.sh' '.re' '.dk' )


while (( "$#" )); do

  for (( i=0;i<$ELEMENTS;i++)); do
      whois $1${DOMAINS[${i}]} | egrep -q '^No match|^NOT FOUND|^Not fo|AVAILABLE|^No Data Fou|has not been regi|No entri'
          if [ $? -eq 0 ]; then
              echo "$1${DOMAINS[${i}]} : available" 



Run this for your desired name to check,

./ kalpesh

You’ll get output will all the TLD’s your name is available for! : available : available : available : available : available : available : available : available : available

Have fun!

1 Comment

  • Do you have a script to debug urls lists (domains), and comparing it with ccTLD, ccSLD, sTLD, utld, gSLD, gTLD Domains Hack, etc ?
    (and do you have a script or a list with all domains ccTLD, ccSLD, sTLD, utld, gSLD, gTLD Domains Hack?
    Thanks a lot

Leave a comment


Welcome to my Blog

Kalpesh MehtaHelping Magento developers in their day-to-day development problems since 2011. Most of the problems and solutions here are my own experiences while working on different projects. Enjoy the blog and don't forget to throw comments and likes/+1's/tweets on posts you like. Thanks for visiting!




Magento top 50 contributors

Magento top 50 contributors