You can use any manual DNS tool, such as “host” or “dig”. You simply check if a DNS entry of type A exist in a respective DNS zone of the BlockList. For example for SpamHaus you check the *.zen.spamhaus.org zone. The checked IP address must be written reversely.
Example: To check IP 188.8.131.52, run the following command:
$ host 184.108.40.206.zen.spamhaus.org 220.127.116.11.zen.spamhaus.org has address 127.0.0.4
Here the IP is listed in the Block List, because it has a DNS entry.Here the query returned the address 127.0.0.4 – this has a special meaning. What do the 127.0.0.* Return Codes mean?
Source of the table: http://www.spamhaus.org/faq/answers.lasso?section=DNSBL Usage#200
If the IP is not listed you get the following response:
$ host 18.104.22.168.zen.spamhaus.org
Host 22.214.171.124.zen.spamhaus.org not found: 3(NXDOMAIN)
The IP can be listed in several lists. In that case you get something like this:
$ host 126.96.36.199.zen.spamhaus.org 188.8.131.52.zen.spamhaus.org has address 127.0.0.4 184.108.40.206.zen.spamhaus.org has address 127.0.0.11
You can also get a description or link to further info why was the server blocked, by querying the TXT DNS record of the domain:
$ host -t TXT 220.127.116.11.zen.spamhaus.org 18.104.22.168.zen.spamhaus.org descriptive text "http://www.spamhaus.org/query/bl?ip=22.214.171.124"