-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdnssec-check.py
26 lines (20 loc) · 952 Bytes
/
dnssec-check.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env python
#
# A simple program that will check the DNSSEC status of multiple domains entered on
# the command line using the REST API to SIDN Labs free DNSSEC Portfolio Checker found at:
# http://portfolio.sidnlabs.nl/form
# Information about the API can be found further down on that page
#
import sys
import urllib2
# Check that the program was called with command-line arguments and if so, check the domains
if len(sys.argv) > 1:
for domain in sys.argv[1:]:
results = urllib2.urlopen('http://portfolio.sidnlabs.nl/check/%s' % domain).read().split(',')
# Check the second field in the results to see if the domain was a valid domain
if results[1] == 'nodata':
print "%s - domain not found" % (domain)
else:
print "%s - %s" % (results[2], domain)
else:
print "Usage: dnssec-check.py <domain> <domain> <domain>\n(for as many domains as you wish to check)"