Monday, February 14, 2005

SPAM: Checking if an ip address is blacklisted

Feet up! - dev/python/Blacklist-checking.html: "How do you check if an ip address is blacklisted"
It's sort of easy, you reverse the address (say it was 1.2.3.4), and append the blacklist's address (say blacklist.example.net), and then do a dns lookup (of 4.3.2.1.blacklist.example.net). If the address is not found, chances are the blacklist hasn't heard of them, otherwise they're probably scum.
The code is in Python, but any one should understand the idea.
(Also note the unit starting at the "if __name__ ..." statement.)

[]