Skip to content

Instantly share code, notes, and snippets.

@yevbar
Created December 18, 2019 06:45
Show Gist options
  • Save yevbar/7ea104c5ed7a028f2de2ca29fcc59e69 to your computer and use it in GitHub Desktop.
Save yevbar/7ea104c5ed7a028f2de2ca29fcc59e69 to your computer and use it in GitHub Desktop.
Given a TLD will search for all single letter domans that are _not_ registered
from string import ascii_lowercase
import subprocess
import sys
from time import sleep
tld = sys.argv[1] # ie python main.py capital
for c in ascii_lowercase:
output = subprocess.check_output("whois {}.{}".format(c, tld), shell=True)
if "Domain not found" in str(output):
print("The domain {}.{} is available".format(c, tld))
sleep(0.25)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment