What is mod_setenvdnsbl
The mod_setenvdnsbl is an Apache module that looks up DNSBL requests for target IP address and set those results to environment variables. With this module, you can control access permission of black listed hosts.
Download files
- mod_setenvdnsbl-0.1.tgz
- 4686 Bytes
How to install
- Download and extract
mod_setenvdnsbl-0.1.tgz
. - Edit Makefile to change APXS variable to your apxs's path.
- Do
make
to build. - Do
make install
to install.
Reference
SetEnvIfDNSBL directive
- Description
- Sets variables based on DNSBL result of target host
- Syntax
SetEnvIfDNSBL attribute dns-suffix [!|*]env-variable[=value] [[!|*]env-variable[=value]] ...
- Context
- server config, virtual host, directory, .htaccess
- Override
- FileInfo
The SetEnvIfDNSBL directive sets variables based on DNSBL result of the attribute. The attribute can be one of following three things:
- An HTTP request header field whose value is an IP address. For example: Client-IP, X-Forwarded-For.
-
One of the following aspects of the request:
remote_addr
- The IP address of the client requesting.
server_addr
- The IP address of the server on which received the request.
- The name of environment variables which are set by SetEnvIf directive.
The rest of the arguments the name of variables to set, and optionally how to set the value. These take the form of
varname
, or!varname
, orvarname=value
, or*varname
In the first three forms, the SetEnvIfDNSBL directive will work like the SetEnvIfDirective when the target IP address is listed on DNSBL (the result of DNSBL request was one of local loopback addresses, 127.0.0.0/24). The fourth, this directive will set the result of DNSBL request when the result is not NXDOMAIN.
Example
SetEnvIfDNSBL remote_host bsb.spamlookup.net IS_SPAM SetEnvIfDNSBL remote_host list.dsbl.org *DNSBLRESULT
Note
This directive generates a DNS request, so it may be a bottleneck of the response. You should write this directive on limited contexts, for example <Files> directive and <Location> directive.
コメントする