Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import dns
- import dns.message
- import dns.name
- import dns.query
- import dns.rdatatype
- ns = "8.8.8.8"
- q = dns.message.make_query(
- dns.name.from_text("www.metebalci.com"),
- dns.rdatatype.A)
- # enable EDNS and set DO bit
- q.want_dnssec()
- ans = dns.query.udp(q, ns)
- for rrset in ans.answer:
- for rr in rrset:
- # lets print also the qtype of each rr
- print('%s %s' % (
- dns.rdatatype.to_text(rrset.rdtype),
- rr.to_text()))
Add Comment
Please, Sign In to add comment