You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 45 Next »

DNS Blocklists

DNS Blocklists are a common form of network-accessible database used in spam detection. They're also referred to as "DNSBLs", "DNS Blacklists" and "RBLs". (The latter usage is incorrect; see ["RBL"].)

SpamAssassin includes support for many of the bigger DNSBLs, with optimal scores (or at least, optimal as determined by the GeneticAlgorithm).

Support for these is built-in, and shipped in the default configuration.

All of the free BL services are enabled by default. However, note that if you're using mail-abuse.org, and you're installing SpamAssassin for site-wide use, you must license their services; mail-abuse.org is now only free for personal use.

Note that SpamAssassin still works very well without using these two services, however.

Live accuracy figures for most of the DNSBLs used in SpamAssassin, based on the Oct 2003 mail feed for one user, can be found [http://taint.org/2003/11/07/184247a_mail.html here].

Other places to find out about DNS blacklists / blocklists:

Note that it's extremely important to compare false positive rates (nonspam messages marked as spam), as well as spam hit-rates, when evaluating any anti-spam system, include DNS blocklists. (For example, a blocklist that returned a match for every single mail would 'catch all the spam', but would also mark every nonspam mail too.) Some of the above pages omit this information, so take with a pinch of salt.

[http://www.blocklisting.com/faq.html news.admin.net-abuse.blocklisting] is a newsgroup devoted to discussion of subjects related to the use, administration, and effects of blocklists in ameliorating the problem of unsolicited bulk email and other unwanted or abusive network traffic. It is also accessible through [http://groups.google.com/groups?group=news.admin.net-abuse.blocklisting groups.google.com].


Comments:

Q: This documentation doesn't seem to cover how to configure dns-blocklists. It says "Support for these is built-in" but I can't believe that all free BL's is called each time a mail is beeing checked. There must be a way to configure which to use.

A: SpamAssassin ships with support for a number of the best DNSBLs. See the [http://spamassassin.apache.org/doc/Mail_SpamAssassin_Conf.html Mail::SpamAssassin::Conf] documentation page, and the rules file [http://old.spamassassin.org/full/2.6x/dist/rules/20_dnsbl_tests.cf 20_dnsbl_tests.cf], for details and examples of how to add additional DNSBL lookup rules. Note that you want to be using SpamAssassin version 2.63 or 3.0.0-pre2, for the same reason that you wouldn't use an out-of-date virus scanner.

Q: The dns-blocklists just don't appear to be used. What is going wrong?

A: First, make sure Net::DNS for perl is installed. Without this the blocklists will not be used.

A: Second, do some tests with Net::DNS to make sure it is resolving names (see the Net::DNS site for examples). A common mistake for client machines (such as Mandrake 9.2) is to have 127.0.0.1 in the </etc/resolv.conf> file – Net::DNS does not check multiple nameservers it appears, so you need to comment this line out for Net::DNS to work. (Anybody with a better solution, other than running a local nameserver?)

A: Third, if your email gateway is behind a firewall make sure that SpamAssassin is resolving the gateway to it's external address. If SpamAssassin resolves the gateway to an private IP or can't resolve the name at all, it may mark the sending system as a trusted relay. As a result, some or all of the spammer's systems will not be checked against the DNSBL. (I'm not aware of anyway to specify 'last trusted relay' in SA).

Q. Wouldn't it be a good idea to run a local nameserver anyway? So, you can run caching-nameserver to cache blocklist query results.

  1. Yes! A very quick simple solution is "dnscache" from djbdns: http://cr.yp.to/djbdns/install.html

You can probably find a package for your favorite *nix. In FreeBSD you can either "pkg_add -r djbdns" or "cd /usr/ports/dns/djbdns && make install clean".

Q: Does anybody know of a good way to use the cluecentral.net country lists? I'd like to penalize certain countries from which I get a lot of spam and almost no real mail. I can't seem to get it working with multiple countries: http://www.cluecentral.net/rbl/showcountries.php

  • No labels