Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# pip install ripe.atlas.sagan
# pip install dnspython
import json
from ripe.atlas.sagan import DnsResult
import base64
import dns.message
import urllib
import time
f = urllib.urlopen('' % int(time.time()))
contents = json.load(f)
for content in contents:
dns_result = DnsResult.get(content)
dnsmsg = dns.message.from_wire(base64.b64decode(str(dns_result.responses[0].abuf)))
# print str(dnsmsg)
# print str(dns_result),
print dns.rcode.to_text(dnsmsg.rcode()) #, " ", dnsmsg.answer[0].ttl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.