Friday, November 28, 2008

How to Find Domain Names with whois_check.sh



The idea to write a shell script is often the result of having to do repeated tasks. Imagine having to check hundreds of domain names by typing "whois domain.com" each time. It would take much longer than writing a simple script.

Using whois to Check for Available Domain Names

Suppose you want to find a good domain name, but you want to see if all of the domain suffixes are available? For example, you want a good .com domain, but you also want the .net, and .org. Not only that, but you might want to use blogspot.com, or wordpress.com for your blog.

You can always check a domain availability by using the whois command, e.g.

$ whois google.com


Obviously, google.com is not available, so whois will display information about the company that registered the domain name. If the domain is not taken, then whois will usually return "No match", or "NOT FOUND". You have to keep trying a domain name until you find one that is available. This can be time-consuming to do manually.

Here is a simple shell script to run a whois query on a list of domains.

First, you will need to generate a list of domains to test. Here is an example file:


$ cat test.txt
unixperformance
unixinsight
unixexpert
unixexpertese
unixstrategies
abczzzzz


For details on how to create a large test file see: mktestfile.sh

Then simply run the script using the .txt file you created as a parameter:


$ ./whois_check.sh test.txt
===============================
unixperformance.net
unixperformance.org
unixperformance.info
unixperformance.blogspot.com
unixperformance.wordpress.com
====== 5 unixperformance =====
===============================
unixinsight.com
unixinsight.net
unixinsight.org
unixinsight.info
unixinsight.blogspot.com
unixinsight.wordpress.com
====== 6 unixinsight =====
===============================
unixexpert.blogspot.com
unixexpert.wordpress.com
====== 2 unixexpert =====
===============================
unixexpertese.com
unixexpertese.net
unixexpertese.org
unixexpertese.info
unixexpertese.blogspot.com
unixexpertese.wordpress.com
====== 6 unixexpertese =====
sleeping 60 seconds...
===============================
unixstrategies.com
unixstrategies.net
unixstrategies.org
unixstrategies.info
unixstrategies.blogspot.com
unixstrategies.wordpress.com
====== 6 unixstrategies =====
===============================
abczzzzz.com
abczzzzz.net
abczzzzz.org
abczzzzz.info
abczzzzz.blogspot.com
abczzzzz.wordpress.com
====== 6 abczzzzz =====


The Script

whois_check -- HTML format

http://www.systemnotes.org/download/shell/whois_check.sh