You can interface to the DBL through host
or dig
, since it runs as a DNS service. This page of the FAQ shows example queries: http://www.spamhaus.org/faq/section/Spamhaus%20DBL#277
$ host example.com.dbl.spamhaus.org
Host example.com.dbl.spamhaus.org not found: 3(NXDOMAIN)
$ host dbltest.com.dbl.spamhaus.org
dbltest.com.dbl.spamhaus.org has address 127.0.1.2
IP address lookups are done similarly, with the numbers in the IP address in reverse order (1.2.3.4
becomes 4.3.2.1.zen.spamhaus.org
). This is documented at the bottom of the FAQ for DNSBL (http://www.spamhaus.org/faq/section/DNSBL%20Usage#252).
$ host 130.119.180.199.zen.spamhaus.org 130.119.180.199.zen.spamhaus.org has address 127.0.0.2 130.119.180.199.zen.spamhaus.org has address 127.0.0.11
A listed domain or address results in results of the form 127.0.0.*, while clean domains/addresses return a "not found" status.