GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Net::DNS::Paranoid(3) User Contributed Perl Documentation Net::DNS::Paranoid(3)

Net::DNS::Paranoid - paranoid dns resolver

    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;
    }

This is a wrapper module for Net::DNS.

This module detects IP address / host names for internal servers.

Create new instance with following parameters:
DNS lookup timeout in secs.

Default: 15 sec.

List of blocked hosts in string, regexp or coderef.
List of white listed hosts in string, regexp or coderef.
DNS resolver object, have same interface as Net::DNS::Resolver.
Resolve a host name using DNS. If it's bad host, then returns $addrs as undef, and $err is the reason in string.

$start_time is a time to start your operation. Timeout value was counted from it. Default value is time().

$timeout is a timeout value. Default value is "$dns-"timeout>.

You 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]);
        }
    );

I shipped LWPx::ParanoidHandler to wrap this module. Please use it.

Most of code was taken from LWPx::ParanoidAgent.

Tokuhiro Matsuno < tokuhirom @A gmail DOT. com>

Copyright (C) Tokuhiro Matsuno

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

2024-07-25 perl v5.40.2

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.