From b405bba0c0ea2136d0e21bce5eef0b0fce59787f Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 1 Mar 2015 05:54:19 +0400 Subject: Cut down on some DNS queries --- modules/inspect.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'modules/inspect.pl') diff --git a/modules/inspect.pl b/modules/inspect.pl index af1c06a..afaba44 100644 --- a/modules/inspect.pl +++ b/modules/inspect.pl @@ -6,6 +6,7 @@ use feature qw(say); use Data::Dumper; #use List::Util qw(first); use String::Interpolate qw(interpolate); +use Carp qw(cluck); %::ignored = (); sub new @@ -31,7 +32,9 @@ sub inspect { $rev = sprintf("%d.%d.%d.%d.", hex($4), hex($3), hex($2), hex($1)); } } - else { + if ( (!defined($rev)) && ($event->{type} eq 'join') ) { +# Only doing DNS lookups for join events will mean that DNSBL will break if we try to do it on something other than joins, +# But it also means we cut back on the DNS lookups by a metric shitton $iaddr = gethostbyname($event->{host}) if ($event->{host} !~ /\//); $rev = join('.', reverse(unpack('C4', $iaddr))).'.' if (defined $iaddr); } -- cgit v1.2.3