Hi!
It makes sense to implement second plugin using AnyEvent::DNS to see how
it fit into resolver API.
Also, I think it probably doesn't make sense to use resolver in case user
already provided IP (v4/v6) in $address.
And I'm not sure about special handling of 'localhost':
- IP for localhost is usually defined in /etc/hosts, and it might be IPv6
one or be like 127.0.0.2
- in my experience it's very annoying when library see 'localhost' and
make some "smart" decision based on this - like when DBD::MySQL (or
libmysqlclient.so, not sure) switch to using UNIX sockets instead of TCP
- Net::DNS::Native is better than AnyEvent::DNS because it also support
host names defined in /etc/hosts, append search domain defined in
/etc/resolv.conf, etc. - but we can partially compensate for this by
switching to using (blocking) system resolver for host names which
doesn't contain dot/domain… this will also solve issue with non-standard
address for 'localhost', and it won't be actually blocking in most
cases, but it probably should be implemented in plugin for
AnyEvent::DNS, not in resolver API
--
WBR, Alex.