Subject: | feature request: recurse caching? |
Date: | Fri, 26 Feb 2016 10:23:50 -0600 |
To: | bug-Net-DNS [...] rt.cpan.org |
From: | Felipe Gasper <felipe [...] felipegasper.com> |
Is there a way to cache DNS lookups with Net::DNS::Resolver::Recurse?
Presently this doesn’t seem to be a feature of the module, and the
following:
-------------
package My::DnsRoots::Resolver;
use strict;
use warnings;
use base 'Net::DNS::Resolver::Recurse';
sub send {
my ($self) = shift;
$self->{'_cache'} ||= {};
return $self->{'_cache'}{"@_"} ||= $self->SUPER::send(@_);
}
*query_dorecursion = \&send;
1;
--------------
… doesn’t seem to improve the performance beyond the “vanilla” version
of the Recurse module. When I watch what the module is actually doing,
it’ll still query “.com” multiple times on successive queries.
Thank you!
-Felipe Gasper
Houston, TX