da51753f22
just getting started
18 lines
508 B
Python
Executable File
18 lines
508 B
Python
Executable File
#!/usr/bin/python
|
|
|
|
import pythonwhois
|
|
import argparse
|
|
import sys
|
|
|
|
parser = argparse.ArgumentParser(description='Check whois and dns information.')
|
|
parser.add_argument('--domain', nargs=1, required=True, help='the domain name')
|
|
parser.add_argument('--nameserver', nargs='*', help='a space delimited list of nameservers')
|
|
|
|
args = parser.parse_args()
|
|
|
|
try:
|
|
domain = pythonwhois.get_whois(args.domain[0])
|
|
|
|
except:
|
|
#something happened, raise an erro
|
|
print "3 Unexpected error: ", sys.exc_info()[0] |