Skip to content

Bash script to search for 3-letter domains

Here it is for the .us TLD:

#!/bin/bash

tld=”us”

for k in 0 1 2 3 4 5 6 7 8 9 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; do

whois — “${k}.${tld}” | egrep “Domain Name|Not found”

for l in – 0 1 2 3 4 5 6 7 8 9 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; do

whois — “${k}${l}.${tld}” | egrep “Domain Name|Not found”

for m in 0 1 2 3 4 5 6 7 8 9 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; do

whois — “${k}${l}${m}.${tld}” | egrep “Domain Name|Not found”
done
done
done

And here it is for the .nu TLD:

#!/bin/bash
for k in 0 1 2 3 4 5 6 7 8 9 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; do

whois “${k}.nu” | grep “ASCII”

for l in 0 1 2 3 4 5 6 7 8 9 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; do

whois “${k}${l}.nu” | grep “ASCII”

for m in 0 1 2 3 4 5 6 7 8 9 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; do
whois “${k}${l}${m}.nu” | grep “ASCII”
done
done
done

You’ll note that the expression being greped for is different between the two: there’s no universal method of detecting the existence/non-existence of domains that works for all TLD’s.

Be the first to like.

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*