"A DNS Blacklist, or DNSBL, is a means by which an Internet site may publish a list of IP addresses that some people may want to avoid and in a format which can be easily queried by computer programs and the Internet. The technology is built on top of the Internet Domain Name System, or DNS. DNSBLs are chiefly used to publish lists of addresses linked to spamming. Most mail server software can be configured to reject or flag messages which have been sent from a site listed on one or more such lists." -http://en.wikipedia.org/wiki/DNSBL
To install apache DNSBL you must first have Apache 2.2 with the mod_access.so module installed.
The module that this document will walk you through installing is called mod_access_dnsbl and it's homepage can be found here, in particular, the file that you will need is here.
It is a requirement of mod_access_dnsbl that the mod_dnsbl_lookup module be installed first, which can be found here.
These files can be downloaded with the following commands:
# wget http://www.apacheconsultancy.com/modules/mod_access_dnsbl/mod_access_dnsbl-0.01.tar.gz # wget http://www.sysdesign.ca/archive/mod_dnsbl_lookup-0.91.tar.gz
It is recommended that you move these files into a sub-directory of /tmp, this can be achieved with the following commands
# mkdir /tmp/apachednsblinstall # mv ./mod_access_dnsbl-0.01.tar.gz /tmp/apachednsblinstall/ # mv ./mod_dnsbl_lookup-0.91.tar.gz /tmp/apachednsblinstall/ # cd /tmp/apachednsblinstall
Now you must extract the files with the following commands
# tar xzvf mod_access_dnsbl-0.01.tar.gz # tar xzvf mod_dnsbl_lookup-0.91.tar.gz
Move into the newly created mod_dnsbl_lookup directory:
# cd mod_dnsbl_lookup-0.91
Compile and install the module
# ./autogen.sh # ./configure # make # make install
(for configuration options of this module, refer to /tmp/apachednsblinstall/mod_dnsbl_lookup-0.91/README)
Proceed to the mod_access_dnsbl directory with the following command:
# cd ../mod_access_dnsbl-0.01
Install the mod_access_dnsbl module with the following command (NOTE: You will need to have the apxs tool installed: http://httpd.apache.org/docs/2.2/programs/apxs.html)
# apxs -cia mod_access_dnsbl.c
(for configuration options of this module, refer to /tmp/apachednsblinstall/mod_access_dnsbl-0.01/README)
Ensure that the necessary lines in your httpd.conf file have been updated to load the extra modules, they should look something like this:
LoadModule dnsbl_lookup_module modules/mod_dnsbl_lookup.so LoadModule access_dnsbl_module modules/mod_access_dnsbl.so
Restart Apache 2.x
# /etc/init.d/apachectl restart
Your new Apache DNSBL should now be up and running!