Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages


home | help
surblhost(1)			 USER COMMANDS			  surblhost(1)

       surblhost - check if hostnames are blacklisted by

       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 identi-
       fying 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	suffi-
	      cient  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	 simi-
	      larly  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	surbl-
	      host.  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	black-

       -r --recursive
	      Recursively  checks  all	subdomains for a given host.  Example:
	      If you submit to surblhost with this op-
	      tion,  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  op-
	      tions works around this.

       -f --skip-whitelist
	      Skip  checking hostnames against the whitelists.	You should al-
	      most never use this option, as the whitelist is designed to  re-
	      duce  the	 number	of DNS lookups for most	common hostnames.  See

       -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	 some- 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  re-
	      turned IP-addresses are in the same format as given by the surbl
	      guidelines at

       --test Tests against a permanent	 testpoint,  which  should  always  be

	      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

	      Same  as	--whitelist=file,  but	adds  the  contents   to   the

       Surblhost  returns  0 when no of	the hostnames are blacklisted.	It re-
       turns 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.

version	0.8			 April 9, 2007			  surblhost(1)


Want to link to this manual page? Use this URL:

home | help