check_extended_dns/check_extended_dns.py

18 lines
508 B
Python
Raw Normal View History

2015-02-01 13:29:22 +02:00
#!/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]