Skip to content

Instantly share code, notes, and snippets.

@strizhechenko
Created November 3, 2016 08:04
Show Gist options
  • Save strizhechenko/2fcbf666f0ee99ed591d6d1731cecc11 to your computer and use it in GitHub Desktop.
Save strizhechenko/2fcbf666f0ee99ed591d6d1731cecc11 to your computer and use it in GitHub Desktop.
""" domain generator """
from re import sub
from sys import argv
from random import shuffle
from string import ascii_lowercase
zones = [
'com', 'net', 'ru', 'org', 'uk', 'en', 'ss', 'cn',
]
x = list(ascii_lowercase) + ['1', '2', '3', '4', '.', '.', '.']
for i in xrange(int(argv[1])):
shuffle(x)
print sub(r'^\.|\.$', '', "".join(x).replace('..', '.').replace('..', '.')) + '.' + zones[i % len(zones)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment