rblcheck.sh – check local IPs for RBL listing

by Reed on July 30, 2010

First release of rblcheck.sh, a multi-IP, multi-DNSBL checker.

This is used to alert you when your server is listed on a blacklist; otherwise you can be unaware until users start to complain that their emails are bouncing.

The script checks every external IP active on the server to see if it is listed in the given RBLs.

We suggest you run it daily at least; by default the standard output will go to email via cron or you can make special arrangements. The simplest way to install the script is to drop it in /etc/cron.daily or /etc/cron.hourly – remember to chmod 755.

The list of RBLs defaults to Spamcop, Spamhaus and SORBS (enough for most people) but can easily be changed or extended via a config file. You can also alter the list of IPs to check via a config file.

Note that this script is actually cPanel independent, and should run on any Linux machine.

Download rblcheck.sh [3287 downloads] sh
  • ASU Service

    Nice script … works well. Thanks!

    Are we permitted to modify it and give it to others? Of course leaving credit to you in the file.

    • You are permitted to use the scripts on this site however you like, and make whatever changes you’d like, as long as you maintain attribution.

      As a matter of courtesy, though, we’d appreciate it if you could send us a copy of any improvements you make to our scripts so that we can share the improved version with everyone else who uses them 🙂

  • ASU Service

    You bet Reed. I assume you have access to my email address associated with these posts. Send me an email letting me know where I can email the files to.

    Did you just add the license tab? If not, my apologies for not seeing it before posting.

    As for the script … I have modified it to write the output to a file and email the file contents to me. The email address and output filename is configurable. I also created an external dnsblacklists file with a TON of RBL’s in it. I’ll include that when I send it.

  • Florin

    i try to configure that script and i have an error:

    ./rblcheck.sh: line 61: syntax error near unexpected token `case’
    ./rblcheck.sh: line 61: ` case “$ip” in’

    can you help me whith this issue?

    • Check that you haven’t corrupted the file and that you are running it with sh. Maybe try “bash” instead of “sh”.

  • Mezbaur Rahman

    many thanks for the rblcheck script. It works fine for me.

  • Joe Shedler

    I just noticed this….
    for ip in $ips
    # Skip private IPs
    case “$ip” in
    10.*) continue;; ;; # allow SpamCop test IP
    127.*) continue;;
    192.168.*) continue;;
    169.254.*) continue;;

    it looks like you missed the class b internal IP ranges. – –

    other than that, nice job. I used it 7 years after you wrote it :p

Previous post:

Next post: