I am learning how to use the python dns object. Quick question as I see many examples show methods of using the dns.resolver method with the DNS record type(CNAME, NS, etc). Is there a way to use this dns object to query a DNS name and pull it's resolution with the record type. Similar to what DIG supplies in the answer section.
Thanks,
Jim
You can get the type with rdatatype
>>> import dns.resolver
>>> answer = dns.resolver.query('google.com')
>>> rdt = dns.rdatatype.to_text(answer.rdtype)
>>> print(rdt)
A