Net::D...ranoid(3pm)
π Net::DNS::Paranoid β the manual, but make it cute π
okay bestie, so this is a User Contributed Perl Documentation page, manual section 3pm, and the module is Net::DNS::Paranoid. buckle up, it's giving β¨paranoidβ¨ but in a good way π«Ά
π NAME π
Net::DNS::Paranoid β a 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;
}
like. it's literally right there. copy it, bestie π§
πΈ DESCRIPTION πΈ
This is a wrapper module for Net::DNS. no cap.
And what does it do?? It detects IP address / host names for internal servers. that's the whole vibe. it's the friend who goes "girl, that address is giving internal, we're not going there" ππ«
π METHODS π
my $dns = Net::DNS::Paranoid->new(%args)
Create new instance with following parameters, bestie:
timeoutβ DNS lookup timeout, in secs. Default: 15 sec. so you got 15 seconds before it's like "okay I'm out" β°blocked_hosts: ArrayRef[Str|RegExp|Code]β List of blocked hosts, and you can write them as a string, a regexp, or a coderef. choose your fighter π₯whitelisted_hosts: ArrayRef[Str|RegExp|Code]β List of white listed hosts, again as string, regexp or coderef. yes same three options, she's consistent πresolver: Net::DNS::Resolverβ a DNS resolver object, and it has the same interface asNet::DNS::Resolver. drop yours in, she won't even notice π¦
my ($addrs, $err) = $dns->resolve($name[, $start_time[, $timeout]])
Resolve a host name using DNS π. If it's a bad host, then it returns $addrs as undef, and $err is the reason in string. so like, it tells you why it's a no π
$start_timeis a time to start your operation. The timeout value was counted from it. Default value istime(). β±οΈ$timeoutis a timeout value. Default value is"$dns-"timeout>. yes that's literally what the original says, don't @ me π
π₯ USE WITH Furl π₯
You can use Net::DNS::Paranoid with Furl! obsessed, honestly.
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 LWP π
I shipped LWPx::ParanoidHandler to wrap this module. Please use it. like, genuinely, please π«Ά
π THANKS TO π
Most of the code was taken from LWPx::ParanoidAgent. giving credit where credit is due, periodt π
β AUTHOR β
Tokuhiro Matsuno < tokuhirom @A gmail DOT. com> β icon, legend, the moment π
π LICENSE π
Copyright (C) Tokuhiro Matsuno
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
fr fr, that's the whole page. no notes. slay π β¨
and that's a wrap bestie β this was rendered from perl v5.42.0, dated 2025-07-25, and the page signs off as Net::D...ranoid(3pm) (yes the header truncates it, she's mysterious like that π). bye, ily, go block some hosts π¦π
π¦ where this page comes from
- fedora 43: perl-Net-DNS-Paranoid 0.09-5.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms