I am using dnspython to get the 'A' record and return the result (IP address for a given domain).
I have this simple testing python script:
import dns.resolver
def resolveDNS():
domain = "google.com"
resolver = dns.resolver.Resolver();
answer = resolver.query(domain , "A")
return answer
resultDNS = resolveDNS()
print resultDNS
However, the output is:
<dns.resolver.Answer object at 0x0000000004F56C50>
I need to get the result as a string. If it is an array of strings, how to return it?
for item in resultDNS: print item
? I think that would give u a fair idea whats inside the returned object and how its elements can be accessed. – Barrelhouse