Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to query DNS records using python

import dns.resolver
name = 'iana.org'
for qtype in 'A', 'AAAA', 'MX', 'NS', 'TXT', 'SOA':
    answer = dns.resolver.query(name,qtype, raise_on_no_answer=False)
    if answer.rrset is not None:
        print(answer.rrset)
Source by 0xbharath.github.io #
 
PREVIOUS NEXT
Tagged: #query #DNS #records #python
ADD COMMENT
Topic
Name
1+6 =