- Timestamp:
- 12/29/17 11:41:22 (7 years ago)
- Location:
- trunk/dnsbl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dnsbl/dnsbl.cgi
r63 r64 25 25 use CGI::Simple; 26 26 use HTML::Template; 27 use Net::DNS; 27 28 28 29 use DNSBL; … … 102 103 $webvar{ip} =~ s/\s*$//; 103 104 $page->param(ip => $webvar{ip}); 105 106 ##fixme 107 # at some point this may need to be tweaked for Net::DNS's 1.x calling convention when they drop support for the older one 108 #my @ptr = rr($webvar{ip}); 109 #$page->param(revinfo => join(',',@ptr)); 110 my $res = new Net::DNS::Resolver; 111 $res->tcp_timeout(2); # make me adjustable! 112 $res->udp_timeout(2); # make me adjustable! 113 my $query = $res->query($webvar{ip}, "PTR"); 114 if ($query) { 115 my @rdata; 116 foreach my $rr ($query->answer) { 117 my ($host,$ttl,$class,$type,$data) = 118 ($rr->string =~ /^([0-9a-zA-Z_.-]+)\s+(\d+)\s+([A-Za-z]+)\s+([A-Za-z]+)\s+(.+)$/s); 119 push @rdata, $data; 120 } 121 $page->param(revinfo => join(', ',@rdata)); 122 } else { 123 $page->param(revinfo => "DNS error: ".$res->errorstring); 124 } 125 104 126 my $count = $dnsbl->ipexists($webvar{ip}); 105 127 $page->param(nreports => $count) if $count; -
trunk/dnsbl/templates/report.tmpl
r52 r64 12 12 <td>(reported <TMPL_VAR NAME=nreports> time(s))</TMPL_IF></td> 13 13 <td><a href="<TMPL_VAR NAME=dnsblsiteroot>">Back</a></td></tr> 14 <tr><td colspan="3"><TMPL_VAR NAME=revinfo></td></tr> 15 14 16 <form action="dnsbl.cgi"> 15 17 <input type=hidden name=page value=dbreport>
Note:
See TracChangeset
for help on using the changeset viewer.