Home>

I am using bash on Ubuntu.

#! /bin /bash
for letter1 in {g, o}; do
    for letter2 in {a..z}; do
        for letter3 in {a..z}; do
            name= "$ letter1 $ letter2 $ letter3.ru"
            found= $ (whois $ name | grep domain | awk {'print $ 2'})
            if [-n "$ found"]
            then
                echo "$ name is taken"
            else
                echo "$ name is free"
            fi
        done
    done
done

After a while, all domains begin to be identified as free.

  • Answer # 1

    Because whois has a limit on the number of allowed requests per unit of time. If you add a delay to the inner loop, then the script should execute correctly, albeit slowly.