Created
June 2, 2020 21:04
-
-
Save rudolfschmidt/b79b7864bac19cc7148edf6dc978c284 to your computer and use it in GitHub Desktop.
Check Free 3 Letter Domains
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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.de" | |
echo $domain | |
nslookup $domain|grep NXDOMAIN >> free.txt | |
done | |
done | |
done |
You might shorten the script with bash
's built-in brace expansion.
For example:
#!/bin/bash
tld='de'
for name in {a..z}{a..z}{a..z}.$tld
do
dig +short $name soa | grep -qv "^$" || printf "$name\n" | tee -a free.txt
done
EDIT: and, if you wanted to include digits...
tld='de'
for name in {{a..z},{0..9}}{{a..z},{0..9}}{{a..z},{0..9}}.${tld}
do
dig +short $name soa | grep -qv "^$" || printf "$name\n" | tee -a free.txt
done
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
or