--- /dev/null
+#!/bin/sh
+if [ $# -lt 2 ]
+then
+ cat << END
+Usage $0 <hostname> <blacklist>
+Where
+ hostname - host to check on blacklist
+ blacklist - DNSBL blacklist (e.g. "zen.spamhaus.org")
+END
+ exit 255
+fi
+
+ip=$(dig a "$1" +short)
+if [ -n "$ip" ]
+then
+ bl=$(dig a "$(printf "%s." "$ip" | tac -s.)$2" +short)
+ [ -n "$bl" ] && { echo "$ip is blacklisted."; exit 1; } || echo "$ip is not blacklisted."
+fi