|
NAMENet::DNS::Paranoid - paranoid dns resolver SYNOPSIS my $dns = Net::DNS::Paranoid->new();
$dns->blocked_hosts([
'mixi.jp',
qr{\.dev\.example\.com$},
]);
$dns->whitelisted_hosts([
'twitter.com',
]);
my ($addrs, $errmsg) = $dns->resolve('mixi.jp');
if ($addrs) {
print @$addrs, $/;
} else {
die $errmsg;
}
DESCRIPTIONThis is a wrapper module for Net::DNS. This module detects IP address / host names for internal servers. METHODS
USE WITH FurlYou can use Net::DNS::Paranoid with Furl! use Furl::HTTP;
use Net::DNS::Paranoid;
my $resolver = Net::DNS::Paranoid->new();
my $furl = Furl->new(
inet_aton => sub {
my ($host, $errmsg) = $resolver->resolve($_[0], time(), $_[1]);
die $errmsg unless $host;
Socket::inet_aton($host->[0]);
}
);
USE WITH LWPI shipped LWPx::ParanoidHandler to wrap this module. Please use it. THANKS TOMost of code was taken from LWPx::ParanoidAgent. AUTHORTokuhiro Matsuno < tokuhirom @A gmail DOT. com> LICENSECopyright (C) Tokuhiro Matsuno This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|