logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Net::DNS::Resolver::Mock - Mock a DNS Resolver object for testing

Authors

       Marc Bradshaw, <marc@marcbradshaw.net>

Bugs

       Please report bugs via the github tracker.

       https://github.com/marcbradshaw/Net-DNS-Resolver-Mock/issues

Dependencies

         Net::DNS::Resolver
         Net::DNS::Packet
         Net::DNS::Question
         Net::DNS::ZoneFile

Description

       A subclass of Net::DNS::Resolver which parses a zonefile for it's data source. Primarily for use in
       testing.

Licence

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

perl v5.36.0                                       2023-02-19                      Net::DNS::Resolver::Mock(3pm)

Name

       Net::DNS::Resolver::Mock - Mock a DNS Resolver object for testing

Public Methods

       zonefile_read ( $FileName )
           Reads specified file for zone data

       zonefile_parse ( $String )
           Reads the zone data from the supplied string

       die_on ( $Name, $Type, $Error )
           Die with $Error for a query of $Name and $Type

       enable_debug ()
           Once  set,  the  resolver  will  write  any  lookups received to STDERR and will be available via the
           following methods

       disble_debug ()
           Disable debugging

       clear_debug ()
           Clear the debugging list

       get_debug ()
           Returns a list of debugging entries

Synopsis

           use Net::DNS::Resolver::Mock;

           my $Resolver = Net::DNS::Resolver::Mock-new();

           $Resolver->zonefile_read( $FileName );
           # or
           $Resolver->zonefile_parse( $String );

See Also