5 Usage $0 <hostname> <blacklist>
7 hostname - host to check on blacklist
8 blacklist - DNSBL blacklist (e.g. "zen.spamhaus.org")
13 ip
=$(dig a "$1" +short)
16 bl
=$(dig a "$(printf "%s." "$ip" | tac -s.)$2" +short)
17 [ -n "$bl" ] && { echo "$ip is blacklisted.
"; exit 1; } || echo "$ip is not blacklisted.
"