You can do this in ldns, but may find it easier to do in ldnsx (<a href="http://oldwww.xelerance.com/ldnsx/html/">http://oldwww.xelerance.com/ldnsx/html/</a>). Using the convenience function get_rrs() we can do:<br><br>import ldnsx<br>
ip_addr = ldnsx.get_rrs("<a href="http://example.com">example.com</a>","A")[0].ip()<br><br>Though you'll get an exception if there aren't any A records.<br><br>Alternatively, you could not use convenience functions and do:<br>
<br>import ldnsx<br>res = ldnsx.resolver()<br>pkt = res.query("<a href="http://example.com">example.com</a>","A")<br>ans = pkt.answer()<br>ip_addr = ans[0].ip()<br><br>Christopher<br><br><div class="gmail_quote">
On Mon, Sep 5, 2011 at 3:07 PM, Rishat <span dir="ltr"><<a href="mailto:rishat@nixnotes.ru">rishat@nixnotes.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<u></u>


  
  

<div>
Hello<br>
<br>
Having python module i want to record queries and answers to MySQL database. From example1,2 i know how to get queries like "<a href="http://example.com" target="_blank">example.com</a>" 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?<br>

<br>
Sorry for my English and thanks in advance.<br>
<br>
BR Rishat<br>
<table cellpadding="0" cellspacing="0" width="100%">
<tbody><tr>
<td>
<br>
<br>
<br>
</td>
</tr>
</tbody></table>
</div>

<br>_______________________________________________<br>
Unbound-users mailing list<br>
<a href="mailto:Unbound-users@unbound.net">Unbound-users@unbound.net</a><br>
<a href="http://unbound.nlnetlabs.nl/mailman/listinfo/unbound-users" target="_blank">http://unbound.nlnetlabs.nl/mailman/listinfo/unbound-users</a><br></blockquote></div><br>