Skip to content

Instantly share code, notes, and snippets.

@JburkeRSAC
Created October 16, 2019 20:02
Show Gist options
  • Select an option

  • Save JburkeRSAC/0854b139c0f1df26c95fe71e3ba77610 to your computer and use it in GitHub Desktop.

Select an option

Save JburkeRSAC/0854b139c0f1df26c95fe71e3ba77610 to your computer and use it in GitHub Desktop.
import pythonwhois
import sys
def is_registered(site):
details = pythonwhois.get_whois(site)
return not details['raw'][0].startswith('No match for')
fileName = sys.argv[1]
lineList = [line.rstrip('\n') for line in open(fileName)]
for name in lineList:
site = '{}'.format(name)
print('{}: {}'.format(site, is_registered(site)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment