Mail Blacklist Check

Icinga/Nagios spam blacklist check, written in python

Build Status Coverage Status

Nagios RBL / DNSBL Check

A Python-based Nagios/Icinga plugin to check whether a host is listed on any known DNS-based spam blacklists.


The plugin requires Python version 2.6 or higher. If you are using a system with more than one version of Python installed, edit the first line of the script to point to the locally-installed version of Python you wish to use. On RHEL systems, for example, this might look like:

#! /usr/bin/env python26

The Python library for IPv4/IPv6 manipulation is required (included in Python 3.3 and later). You can install it using pip:

pip install ipaddress

Or download it using a package manager, it's usually referred as python-ipaddress


You can run the plugin using either a hostname (which will be resolved to an IP address) or an IP address:

./ -w  -c  -h 
./ -w  -c  -a 
./ -w  -c  -a 

For example, to test whether hostname is listed on any known blacklist, with a Warning level of 1 blacklist and a Critical level of 3 blacklists, do:

./ -w 1 -c 3 -h

To test the plugin, check or ::FFFF:7F00:2 which should always come back as "listed" on every known blacklist. For example:

 ./ -w 1 -c 3 -a
 ./ -w 1 -c 3 -a ::FFFF:7F00:2

Known Blacklists

A list of known blacklists included in the script is located on this Wiki page:

If you know of other DNS-based blacklists that should be considered for inclusion, please open an "Enhancement" issue.



Licensed under the GPL v3. Enjoy.