Black Lists are used in the context of email to define the IP addresses or netblocks of well known sources of SPAM. DNSBL defines a method of using standard DNS zone files to store such IP addresses. Standard DNS A RR queries are used to interrogate the black list which is organised as a reverse mapping zone file. DNSBL is now the subject of RFC 5782 which has INFORMATIONAL status.
Assuming the blacklist is held at the domain name blacklist.example.com, the process works as follows:
The following shows a black list zone file fragment:
$TTL 2d # default RR TTL $ORIGIN blacklist.example.com. IN SOA ns1.example.com. hostmaster.example.com.( 2003080800 ; se = serial number 3h ; ref = refresh 15m ; ret = update retry 3w ; ex = expiry 3h ; min = minimum ) IN NS ns1.example.com. IN NS ns2.example.com. # black list records - using origin substitution rule # order not important other than for local usage reasons # by convention this address should be listed to allow for external testing 188.8.131.52 IN A 127.0.0.2 # black list RRs 184.108.40.206 IN A 127.0.0.2 # or some specific result code address IN TXT "Optional - Some explanation for black listing" # the above entries expand to 220.127.116.11.blacklist.example.com ... 18.104.22.168 IN A 127.0.0.2 # generic list ...
Note: An A RR for the address 127.0.0.2, by convention, should always be present in any DNSBL system to allow for external testing and confirmation of operation - bear in mind, however, that spammers may also use this knowledge to mount DoS attacks on the DNSBL.
There is no standard, or even consensus, usage of the address returned by the DNS A RR query other that it lies in the netblock 127/8 (127.0.0.0 - 127.255.255.255). In most cases email software which uses DNSBL access will return a failing code if any address is returned (the IP is in the list). When reviewing a number of DNSBL web sites to obtain the value of return codes they were not easily identifiable. The following is the meaning of the returned address when using the SORBS black list:
127.0.0.2 - Open HTTP Proxy Server (http.dnsbl.sorbs.net) 127.0.0.3 - Open SOCKS Proxy Server (socks.dnsbl.sorbs.net) 127.0.0.4 - Open Proxy Server not listed in the SOCKS or HTTP lists. (misc.dnsbl.sorbs.net) 127.0.0.5 - Open SMTP relay server (smtp.dnsbl.sorbs.net) 127.0.0.6 - Hosts sending spam/UCE/UBE to SORBS, netblocks of spam supporting service providers (list.spam.dnsbl.sorbs.net) 127.0.0.7 - Web servers email vulnerabilities (e.g. FormMail scripts) (web.dnsbl.sorbs.net) 127.0.0.8 - Hosts demanding not to be tested by SORBS (block.dnsbl.sorbs.net) 127.0.0.9 - Networks hijacked from original owners (zombie.dnsbl.sorbs.net) 127.0.0.10 - Dynamic IP Address ranges (dul.dnsbl.sorbs.net) 127.0.0.11 - Domain names with bad A or MX RRs (badconf.rhsbl.sorbs.net) 127.0.0.12 - Domain names with no emai originating (nomail.rhsbl.sorbs.net)
While the terminology - DNSBL - defines the above to be a black list there is nothing to stop it being used as, say, a white list to speed up handling of incoming mail by using the SMTP Agent's IP addresses. Always assuming your favorite mail software will support such a concept and format. Further by prepending domain names or full email addresses such a white list may be even more useful. For example assume the following zone file fragment for whitelist.example.com (or even vhost.whitelist.example.com for virtual hosted sites)
$TTL 2d # default RR TTL $ORIGIN whitelist.example.com. ... # white list records - using origin substitution rule # order not important other than for local usage reasons # normal whitelist RRs # by convention this address should be listed to allow for external testing 22.214.171.124 IN A 127.0.0.2 # black list RRs 126.96.36.199 IN A 127.0.0.2 # or some specific result code address IN TXT "Optional - Some explanation for white listing" # the above entries expand to 188.8.131.52.blacklist.example.com ... 184.108.40.206 IN A 127.0.0.2 # generic list ... # name based RRs for white listing friend.com IN A 127.0.0.1 # all domain email addresses # expands to friend.com.whitelist.example.com joe.my.my IN A 127.0.0.2 # single address # expands to joe.my.my.whitelist.example.com ...
In the above example mail addresses of the form email@example.com would require subsitution of @ with . (dot) before being appended to the whitelist domain name to avoid use of @ in the domain name.
DECLUDE maintain a page containing many known DNSBL format black lists.
Problems, comments, suggestions, corrections (including broken links) or something to add? Please take the time from a busy life to 'mail us' (at top of screen), the webmaster (below) or info-support at zytrax. You will have a warm inner glow for the rest of the day.
3 reverse map
4 dns types
5 install bind
8 zone records
12 bind api's
13 dns security
bits & bytes
notes & tips
This work is licensed under a Creative Commons License.
If you are happy it's OK - but your browser is giving a less than optimal experience on our site. You could, at no charge, upgrade to a W3C STANDARDS COMPLIANT browser such as Firefox