Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages

Manual Reference Pages  -  SURBLHOST (1)


surblhost - check if hostnames are blacklisted by


Return Values
Example: Using With Scripts


surblhost [ options ] [ host(s) ]


surblhost will check if the given hostnames are blacklisted by Blacklisting means that global spam mail contains links to the given hostnames, and should therefore be avoided.

Although is usually used in mail transfer agents for identifying spam, you can use it for a lot of other purposes.


- Read hostnames from standard input, separated by newlines.
  Explicitly checks each and every entry in the pre-compiled and user-submitted whitelist against the SURBL lists.

This is good to check if the whitelist is indeed OK, especially when you compile your own.

When you set up a system to use your own whitelist, it is sufficient to run this command every once in a while -- you should *not* run it every time you check a host.

-h --help Print help text.
  Do not use the default as hostname suffix when doing DNS A record lookups. That means you have to specify your hostnames in the form, or similarly if you want to use other lookup providers than This is the same as using --surbl=’’.
  Print the two-level TLDs that are used for recognizing domains such as
  Prints the predefined whitelist that is hardcoded into surblhost. This list is derived from the SpamAssassin whitelist at

and is pretty safe to hard-code. The point of the whitelist is to reduce the number of DNS lookups needed for common hostnames.

-q --quiet
  Quiet output; useful when you just want to check the exit code of the program to determine if the given host(s) are blacklisted.
-r --recursive
  Recursively checks all subdomains for a given host. Example: If you submit to surblhost with this option, the following domains will be checked for blacklisting:,, Note that the guidelines says they will only list, but this option has been implemented because some TLD countrycodes are a bit tricky. This is the situation with e.g. domains. If you want to check, then using the -s option will not work very well, as it will check "" instead of "". Using the recursive options works around this.
-f --skip-whitelist
  Skip checking hostnames against the whitelists. You should almost never use this option, as the whitelist is designed to reduce the number of DNS lookups for most common hostnames. See --print-whitelist.
-s --strip-sub
  Strips subdomains from the hostnames given on the commandline, i.e. ‘surblhost -s’ will only check if is blacklisted. Two-level TLDs are recognized, so if you check and use this option, then only will be looked up.
  Set the surbl suffix yourself. The default value is, but you can use other provides to check against blacklists at your will. You just have to be sure that the returned IP-addresses are in the same format as given by the surbl guidelines at
--test Tests against a permanent testpoint, which should always be blacklisted.
  Read two-level TLDs from given file. You should put one entry per line. An example of a two-level TLD is "".
  Same as --tlds=file, but adds the contents of file to the list.
-v --verbose
  Give verbose output. This is recommended to give a feel of what is actually being done.
-V --version
  Show program version and exit.
  Reads whitelist from given file. You should put one entry per line.
  Same as --whitelist=file, but adds the contents to the whitelist.


Surblhost returns 0 when no of the hostnames are blacklisted. It returns 1 for errors, and 2 when one or more sites are blacklisted.


Here is a complete BASH script that uses the exit code from surblhost to check the status of given hostnames:

# Copyright (C) 2006, 2007 Christian Stigen Larsen
# This script is placed in the public domain.

if test "$#" == "0" ; then
echo "usage: lookup [ hostname(s) ]"
echo "looks up if hosts are blocked by"
exit 1

while test ! -z "${1}" ; do
echo -n "checking ${1} ... "
surblhost -q -r 2>/dev/null ${1}

if test "$?" == "2"; then
echo "blocked"
echo "not blocked"


echo ""
echo "for more information, see"
exit 0


This is still an early release, so there should be some code bugs. Be sure to report anything to the author below. If you have suggestions or patches, the author will be very happy to hear from you.


Christian Stigen Larsen <> --


surblhost is distributed under the GNU General Public License v2.
Search for    or go to Top of page |  Section 1 |  Main Index

version 0.8 SURBLHOST (1) April 9, 2007

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.