[Unbound-users] Can python module handle an answer of DNS query?
christopherolah.co at gmail.com
Tue Sep 6 00:15:03 UTC 2011
You can do this in ldns, but may find it easier to do in ldnsx (
http://oldwww.xelerance.com/ldnsx/html/). Using the convenience function
get_rrs() we can do:
ip_addr = ldnsx.get_rrs("example.com","A").ip()
Though you'll get an exception if there aren't any A records.
Alternatively, you could not use convenience functions and do:
res = ldnsx.resolver()
pkt = res.query("example.com","A")
ans = pkt.answer()
ip_addr = ans.ip()
On Mon, Sep 5, 2011 at 3:07 PM, Rishat <rishat at nixnotes.ru> wrote:
> Having python module i want to record queries and answers to MySQL
> database. From example1,2 i know how to get queries like "example.com" but
> don't yet know which python variable can get me answer of IP address list
> from respond. Is it possible with python module to do this?
> Sorry for my English and thanks in advance.
> BR Rishat
> Unbound-users mailing list
> Unbound-users at unbound.net
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Unbound-users