↑ ↓ select, Enter open, Esc close

Check if a server IP is on the Spamhaus blacklist

Adjust the values, the command updates live
user@server
dig +short $(echo 203.0.113.10 | awk -F. '{print $4"."$3"."$2"."$1}').zen.spamhaus.org

Reverses the IPv4 address and looks it up as a name in the zen.spamhaus.org zone. No output means not listed, an answer in the 127.0.0.x range indicates a listing, and the last number reveals the list (for example 2 for SBL, 4 for XBL). Listed IPs are rejected outright by many mail servers.

Note: Spamhaus does not answer queries sent through large public resolvers and returns 127.255.255.254 instead. The lookup must go through your own resolver.

Also searched as

  • is my server ip blacklisted
  • emails rejected because of spamhaus
  • check ip against rbl

Related one-liners

All in DNS

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.