Net::DNS::Lite(3pm)
π Net::DNS::Lite π
okay bestie, so this is Net::DNS::Lite β a pure-perl DNS resolver with support for timeout. yeah. it's giving "small but does the job" and honestly? we're obsessed. π
β¨ NAME β¨
Net::DNS::Lite β a pure-perl DNS resolver with support for timeout. no cap, that's literally the whole pitch. π
πΈ SYNOPSIS πΈ
use Net::DNS::Lite qw(inet_aton);
# drop-in replacement for Socket::inet_aton
$Net::DNS::Lite::TIMEOUT = 5; # global timeout variable
my $addr = inet_aton("www.google.com");
# or per-query timeout
my $addr = inet_aton("www.google.com", $timeout_in_seconds);
look at her go β¨ you literally just use it and start resolving. main character energy, fr fr.
π¦ DESCRIPTION π¦
So like, this module gives you a replacement function for Socket::inet_aton, but with support for timeouts. that's the whole thing. that's the vibe. π«Ά
ngl the "with support for timeouts" part is the moment. Socket::inet_aton will just sit there vibing forever if DNS is being weird, and this one won't. iconic behavior tbh. π
π CONFIGURATION VARIABLES π
these are the global package variables you can poke at. go off. β¨
π $Net::DNS::Lite::TIMEOUT
maximum time (in seconds) inet_aton will block (default: 10).
like, she'll wait, but she has boundaries. 10 seconds by default, and then she's out. π
π $Net::DNS::Lite::CACHE
if set, Net::DNS::Lite will cache the DNS responses internally using the supplied cache object. The cache object should support get, set, and remove functions (default: none).
so you hand her a cache object and she remembers stuff. the object needs get, set, and remove β that's the whole shopping list. no extra methods required, we're low maintenance. π§ default is none, meaning no caching at all, which is also valid. live your truth.
β $Net::DNS::Lite::CACHE_TTL
maximum ttl of the cached entries (in seconds). Only has effect when $Net::DNS::Lite::CACHE is set.
basically: this one only does anything if you already set $Net::DNS::Lite::CACHE. otherwise she's just sitting there, pretty and unused. π iykyk.
π AUTHOR π
Kazuho Oku
The module is based on the excellent AnyEvent::DNS by mlehmann.
shoutout to mlehmann for the excellent AnyEvent::DNS, and shoutout to Kazuho Oku for this whole thing. we stan both π
π LICENSE π
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See <http://www.perl.com/perl/misc/Artistic.html>
like, go forth and remix, bestie. it's Perl-licensed. π
okay that's the whole page!! this was documented for perl v5.30.0 back on 2020-04-23, so if you're reading this from the future β hi, ily, the vibes are still immaculate. πΈβ¨ bye bestie!! π«Άπ
π¦ where this page comes from
- debian bookworm: libnet-dns-lite-perl 0.12-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libnet-dns-lite-perl 0.12-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libnet-dns-lite-perl 0.12-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libnet-dns-lite-perl 0.12-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libnet-dns-lite-perl 0.12-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libnet-dns-lite-perl 0.12-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms