Setup rbldnsd to run from bootup. If your system uses SysVinit style
startup scripts, create an init script for rbldnsd, or use the one that
comes with rbldnsd in the debian directory of the source. I prefer this simpler
init script ripped off from Red Hat's gpm init script.
#!/bin/bash
#
# chkconfig: 2345 85 15
# description: rbldnsd is a DNS server designed for dnsbls.
# processname: rbldnsd
# pidfile: /var/run/rbldnsd.pid
# source function library
. /etc/init.d/functions
[ -e /etc/sysconfig/rbldnsd ] && . /etc/sysconfig/rbldnsd
RETVAL=0
start() {
echo -n $"Starting rbldnsd service: "
daemon /usr/local/sbin/rbldnsd $OPTIONS
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/rbldnsd
}
stop() {
echo -n $"Shutting down rbldnsd service: "
killproc rbldnsd
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/rbldnsd
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
stop
start
RETVAL=$?
;;
condrestart)
if [ -f /var/lock/subsys/rbldnsd ]; then
stop
start
RETVAL=$?
fi
;;
status)
status rbldnsd
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
exit 1
esac
exit $RETVAL
If you use this script, setup /etc/sysconfig/rbldnsd with options such as:
OPTIONS="-u dnsbl -r /var/dnsbl/njabl -t 21600 -c 60 \
-l querylog -p /var/run/rbldnsd.pid -b 127.0.0.1/530 \
dnsbl.njabl.org:ip4set:dnsbl.njabl.org.auto \
dnsbl.njabl.org:generic:dnsbl.njabl.org.generic \
dnsbl.njabl.org:ip4set:dnsbl.njabl.org.data"
If you use the rbldnsd.init script that comes with rbldnsd, you should have
either /etc/default/rbldnsd or /etc/sysconfig/rbldnsd that looks kind of
like:
RBLDNSD="njabl -udnsbl -r/var/dnsbl/njabl -t21600 -c60 \
-lquerylog -b127.0.0.1/530 \
dnsbl.njabl.org:ip4set:dnsbl.njabl.org.auto \
dnsbl.njabl.org:generic:dnsbl.njabl.org.generic \
dnsbl.njabl.org:ip4set:dnsbl.njabl.org.data \
"
With this setup, /var/dnsbl/njabl/querylog will be a log of all queries
handled by rbldnsd. If you have no need for this log, remove the option.
For debugging purposes, while testing your setup, you may want to make it -l
+querylog to turn off log write buffering. The -b 127.0.0.1/530 tells
rbldnsd to listen on the IP address 127.0.0.1, UDP port 530. This is so
you can run rbldnsd on the same system/IP as an existing DNS server
(bind in this example). If you're setting up rbldnsd to answer queries for
other systems on your network, replace 127.0.0.1/530 with your server's IP
address and rbldnsd will run on port 53 as a DNS server normally would.
The -b option has become mandatory in recent rbldnsd versions. In the
past, rbldnsd would listen on all addresses and the port was set with the
-P argument.