How to find available & short domain names with any extension

Written by Saïd

I found this script while cleaning my folders, a very efficient way to find available three-letters domains with any extension, I thought I would be interesting to share it. I'm not the author of this script - I found it on HN a while back and I am unable to find the original post. The way it works is that is it automates the name server lookup command for the the domains using the nslookup tool and return those for which it gets an NXDOMAIN error (Non-existent Internet Domain Name).

Create a .sh file "domainsearch" by copying/pasting the following into your terminal in linux:

cat > domainsearch.sh << "EOF"	
#!/usr/bin/env bash
array=( a b c d e f g h i j k l m n o p q r s t u v w x y z )
for a in "${array[@]}"
do
	for b in "${array[@]}"
	do
		for c in "${array[@]}"
		do
			domain="$a$b$c.eu" #change the domain extension to fit your search
			echo $domain
			nslookup $domain|grep NXDOMAIN >> availabledomain.txt
		done
	done
done
EOF

Edit the script to fit your needs by adding more "do" loops and more variables in "domain" to find more than three-letters domains or change the extension or a different one.

Start the script :

bash domainsearch.sh

The example above is looking for available three-letters domains with a .eu extension. This will create and update "availabledomain.txt" listing available domains in the current folder.