Guest User

Untitled

a guest
Jul 17th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. import dns
  2. import dns.message
  3. import dns.name
  4. import dns.query
  5. import dns.rdatatype
  6.  
  7. ns = "8.8.8.8"
  8.  
  9. q = dns.message.make_query(
  10. dns.name.from_text("www.metebalci.com"),
  11. dns.rdatatype.A)
  12.  
  13. # enable EDNS and set DO bit
  14. q.want_dnssec()
  15.  
  16. ans = dns.query.udp(q, ns)
  17.  
  18. for rrset in ans.answer:
  19. for rr in rrset:
  20. # lets print also the qtype of each rr
  21. print('%s %s' % (
  22. dns.rdatatype.to_text(rrset.rdtype),
  23. rr.to_text()))
Add Comment
Please, Sign In to add comment