#!/usr/bin/perl use strict; use warnings; use DNS::BL; use Getopt::Std; use vars qw/$opt_c $opt_q $opt_v $opt_h/; getopts('c:qvh'); if ($opt_h) { print <parse("connect $opt_c mode bulk"); die "DNS::BL error in connect: [$r[0]] - $r[1]\n" if $r[0] != &DNS::BL::DNSBL_OK; $|++ if $opt_v; while (<>) { chomp; next unless m/^\d/; my ($net, $rest) = split(/\s+/, $_, 2); $rest =~ s!^\$ - !!; @r = $bl->parse ( qq{add ip $net text "$rest" code 127.0.0.2 without checking} ); warn "DNS::BL error in add of $net: [$r[0]] - $r[1]\n" if $r[0] != &DNS::BL::DNSBL_OK; print "." if $opt_v; } @r = $bl->parse('commit'); die "DNS::BL error in commit: [$r[0]] - $r[1]\n" if $r[0] != &DNS::BL::DNSBL_OK;