AnyEvent::DNS questions
Marc Lehmann
schmorp at schmorp.de
Mon Mar 21 19:07:52 CET 2011
On Mon, Mar 21, 2011 at 06:45:32PM +0100, "Brane F. Gračnar" <brane.gracnar at planet9.si> wrote:
> Is there a way to get TTL value of dns entry in resolve callback?
Not at the moment - looking at the code, it seems I simply forgot to put it
into the result record.
Unfortunately, this is now hard to change without breaking the API.
> What is the correct way to support /etc/hosts in anyevent resolver?
You can't at the moment, as /etc/hosts does not have the necessary
information to do lookups (no dns domains but host aliases with different
semantics, only addresses, no other info).
Note also that modules such as AnyEvent::HTTP rely on correct DNS operation,
so you can't add hosts into the resolver without breaking it.
The only viable point where one could add hosts lookups is in the
AnyEvent::Socket::resolve_sockaddr function (the closest equivalent to
gethostbyname etc.) - it could assume that entries in /etc/hosts are like
dns records with a or aaaa types only and no other records for that host,
in a kind of pre-processing step.
--
The choice of a Deliantra, the free code+content MORPG
-----==- _GNU_ http://www.deliantra.net
----==-- _ generation
---==---(_)__ __ ____ __ Marc Lehmann
--==---/ / _ \/ // /\ \/ / schmorp at schmorp.de
-=====/_/_//_/\_,_/ /_/\_\
More information about the anyevent
mailing list