3 # usage: curl --silent https://www.spamhaus.org/drop/drop.txt | $0 > /path/to/spamhaus-drop.rpz.local
7 # name: "drop.spamhaus.org.rpz.local."
8 # zonefile: "/path/tp/spamhaus-drop.rpz.local"
10 # rpz-log-name: "spamhaus-drop"
14 use vars qw{$o1 $o2 $o3 $o4 $m};
16 # trailing dots required
17 my $origin = 'drop.spamhaus.org.rpz.local.';
18 my $mname = 'localhost.';
19 my $rname = 'root.localhost.';
22 my $rpz_action = '.'; # return NXDOMAIN
23 #my $rpz_action = '*.'; # return NODATA
24 #my $rpz_action = 'rpz-drop.'; # drop the query
26 print "$origin SOA $mname $rname 1 43200 7200 2419200 3600\n";
27 print "$origin NS $ns\n";
29 if(($o1, $o2, $o3, $o4, $m) = m{(\d+)\.(\d+)\.(\d+)\.(\d+)/(\d+)}) {
30 print "$m.$o4.$o3.$o2.$o1.rpz-ip.$origin CNAME $rpz_action\n";
36 # add a testpoint: ask for "dns.google"
37 # print "32.8.8.8.8.rpz-ip.$origin CNAME $rpz_action\n";