View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Michael Robinton > Net-DNSBL-Monitor-0.12 > Net::DNSBL::Monitor



Annotate this POD


Open  0
View/Report Bugs
Module Version: 0.12   Source  


Net::DNSBL::Monitor - Monitor DNSBL response


  use Net::DNSBL::Monitor qw(

  $text = plaintxt(\%config,\%dnsblcnts);
  $html = htmltxt(\%config,\%dnsblnts);
  $text = plainresp(\%responses);
  $html = htmlresp(\$config,\%responses);


Net::DNSBL::Monitor is the Perl module that can be used to check when ranges of IP addresses have been blacklisted. Net::DNSBL::Monitor generates a statistical report for the DNSBL's interrogated and provides an individual report for each IP address found in a DNSBL. The module is used to implement the reporting script dnsblmon.


With the addition of a few elements, the configuration file for dnsblmon shares a common format with the Mail::SpamCannibal script, and Net::DNSBL::Statistics config file, facilitating common maintenance of DNSBL's for your MTA installation.

The sample configuration file monitor.conf.sample is heavily commented with the details for each configuration element.

A useful list of DNSBL zones for the config file (put together by "Andrey V. Stolyarov" <>) maybe found in the contrib directory zones4config.file.


dnsblmon responds to the following system signals:

PERL MODULE DESCRIPTION - Script Implementation ^

Net::DNSBL::Monitor provides most of the functions that implement dnsblmon which is a script that collects statistics and responses for a list of IP address interrogated against a list of DNSBL's

dnsblmon usage ^

How to use dnsblmon

Syntax: dnsblmon path/to/config.file or dnsblmon -t path/to/config.file dnsblmon -w path/to/config.file

        dnsblmon path/to/config.file -r -s
        dnsblmon path/to/config.file -s -r

        dnsblmon path/to/config.file \
                -r path/outfile1 \
                -s path/outfile2

Normally dnsblmon prints an IP report sorted by "comment" and IP of the DNSBL's interrogated with their reply results for each IP address.

The 'comment' field may contain html markup text.

  i.e.  commenta



With the (-s) switch, dnsblmon prints a sorted list (by count) of the DNSBL's interrogated with their reply count, percentage of the total count, and any comments from the DNSBL's 'comment' key field in the config file.

The 'comment' field may contain html markup text.

  44 100.0%  TOTAL IP's interrogated
  41  93.2%  UNION of all results
  34  77.3% comment

The -t switch will print a start and stop time to STDOUT

  # start: Fri Jan  4 17:46:44 2008
  # stop : Fri Jan  4 17:58:21 2008

The -w switch will put the output into an HTML table without the <table> statement </table>., a commment as above and with an <a href="...">dnsbl name</a> statement replacing the dnsbl name if the 'url' key is present in the config file.

The -r and -s switchs are position dependent output designators.

  -r    REPORT output designator
  -s    STATISTICS output designator

  as follows:

  -r -s would produce the report on STDOUT and the statistics
        on STDERR.
  -s -r would produce the statistics on STDOUT and the 
        report on STDERR.

  -s outfile1 -r outfile2 would write the statistics and report
        to outfile1 and outfile2 respectively.

Other combinations are possible. Switches are order dependent but not positionally dependent with respect to other switches

dnsblmon input file format ^

The input file format for dnsblmon consists of an address element block in the form used by NetAddr::IP followed by a 'comment field'. The report generated will be sorted on the 'comment field', then by IP address.

  i.e.          input format       single host IP belonging to XYZ    A class C belonging to ABC hosting


Monitor Web Page HOWTO ^

Read the contrib/HOWTO document that describes the scripts used with 'cron' to auto generate web pages for the statistics reports




Michael Robinton,


Copyright 2008-2014, Michael Robinton. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.


Mail::SpamCannibal, Net::DNS::Codes, Net::DNS::ToolKit, Net::DNSBL::MultiDaemon NetAddr::IP

syntax highlighting: