Net::DN...r::Mock(3)
β¨ NAME β¨
okay bestie, welcome to Net::DN...r::Mock(3) β the User Contributed Perl Documentation page that's literally all about Net::DNS::Resolver::Mock β mock a DNS Resolver object for testing. That's the vibe: a resolver object that's faking it for your tests, and honestly? iconic π
β¨
πΈ DESCRIPTION πΈ
This is a subclass of Net::DNS::Resolver which parses a zonefile for its data source. Primarily for use in testing. That's the whole main-character move: zonefile in, test-friendly resolver energy out π¦π
π SYNOPSIS π
Here's the group-chat demo, bestie β pick your fave: read a file, or parse a string. Both are below, no cap β¨
use Net::DNS::Resolver::Mock;
my $Resolver = Net::DNS::Resolver::Mock-new();
$Resolver->zonefile_read( $FileName );
# or
$Resolver->zonefile_parse( $String );
yes, that dash in Net::DNS::Resolver::Mock-new(); is exactly what the page says β I'm just transcribing, don't come for me π
π PUBLIC METHODS π
zonefile_read ( $FileName )
Reads specified file for zone data. File name goes in, zone data comes out β slay π
zonefile_parse ( $String )
Reads the zone data from the supplied string. String-based zone data? Obsessed, honestly π
die_on ( $Name, $Type, $Error )
Die with $Error for a query of $Name and $Type. Very dramatic, very on-brand π
enable_debug ()
Once set, the resolver will write any lookups received to STDERR and will be available via the following methods. Debug mode: activated π₯
disble_debug ()
Disable debugging. Yep, it's spelled disble_debug on the page β we preserve the vibe, periodt π
clear_debug ()
Clear the debugging list. Fresh start energy β¨
get_debug ()
Returns a list of debugging entries. Gimme the receipts π
π§ DEPENDENCIES π§
Net::DNS::ResolverNet::DNS::PacketNet::DNS::QuestionNet::DNS::ZoneFile
π BUGS π
Please report bugs via the github tracker.
https://github.com/marcbradshaw/Net-DNS-Resolver-Mock/issues
π«Ά AUTHORS π«Ά
Marc Bradshaw, <marc@marcbradshaw.net> β shoutout to the author, fr fr π«Ά
π COPYRIGHT π
Copyright (c) 2017, Marc Bradshaw.
π LICENCE π
This library is free software; you may redistribute it and/or modify it under the same terms as Perl itself.
okay that's the whole page, bestie. cute sign-off vibes: perl v5.42.0, dated 2023-02-17, and it's literally Net::DN...r::Mock(3) β periodt. πππ¦
π¦ where this page comes from
- opensuse-leap 16.0: perl-Net-DNS-Resolver-Mock 1.20230216-bp160.1.11 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms