++ed by:
RSCHABER JETEVE ALEXBYK MARIOROY KARJALA

22 PAUSE users
17 non-PAUSE users.

Marc A. Lehmann

NAME

EV::DNS - perl interface to libevent's evdns module

SYNOPSIS

 use EV::DNS;

   EV::DNS::resolve_reverse +(Socket::inet_aton "129.13.162.95"), 0, sub {
      my ($result, $type, $ttl, @ptrs) = @_;
      warn "resolves to @ptrs";
   };

   EV::DNS::resolve_ipv4 "www.goof.com", 0, sub {
      my ($result, $type, $ttl, @ptrs) = @_;
      warn "resolves to " . Socket::inet_ntoa $ptrs[0]
         if @ptrs;
   };

DESCRIPTION

This module provides an interface to libevent's evdns module, see (http://monkey.org/~provos/libevent/).

FUNCTIONAL INTERFACE

TODO

EV::DNS::init

Called automatically when the module is firts used. Uses resolv.conf and/or some obscure win32 ibterface to initialise the nameservers and other parameters.

EV::DNS::shutdown $fail_requests = 1

Shuts the DNS client down.

$str = EV::DNS::err_to_string $errnum
EV::DNS::nameserver_add $adress_as_unteger

Use unpack "N", Socket::inet_aton "address".

$count = EV::DNS::count_nameservers
int EV::DNS::clear_nameservers_and_suspend
int EV::DNS::resume
int EV::DNS::nameserver_ip_add $address
int EV::DNS::resolve_ipv4 $hostname, $flags, $cb->($result, $type, $ttl, @addrs);
int EV::DNS::resolve_ipv6 $hostname, $flags, $cb->($result, $type, $ttl, @addrs);

resolve ipv6 crashes your program in libevent versions up and including at leats 1.3e.

int EV::DNS::resolve_reverse $4_or_6_bytes, $flagsm $cb->($result, $type, $ttl, @domains)
int EV::DNS::set_option $optionname, $value, $flags
   EV::DNS::set_option "ndots:", "4"
int EV::DNS::resolv_conf_parse $flags, $filename
int EV::DNS::config_windows_nameservers
EV::DNS::search_clear
EV::DNS::search_add $domain
EV::DNS::search_ndots_set $ndots

SEE ALSO

AUTHOR

 Marc Lehmann <schmorp@schmorp.de>
 http://home.schmorp.de/