You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

16 lines
476 B

#!/usr/bin/env python3
import DNSLG
import sys
resolver = DNSLG.Resolver.Resolver(["127.0.0.1", "8.8.8.8"], maximum=2)
for name in sys.argv[1:]:
result = resolver.query(name, "ANY")
print(result.answer)
print("From %s: " % result.nameserver)
rrsets = result.answer # There is also additional, authority, etc
for rrset in rrsets:
print("%s/%s ->" % (rrset.name, rrset.rdtype))
for rr in rrset:
print("\t%s" % rr)
print("")