Skip to content

RBLDNS Export

Marco Favero edited this page Oct 10, 2017 · 20 revisions

Ok, you have installed the RBL system and you have populated the lists. Now, you want to export them in RBLDNS formatted files. You must know what RBLDNSD is, and how the zone files work.

Well, go to contrib/rbldns and run exportdns.php with -f <file zone header> -t <list name>

By default we provide a conf.default header file. You can customize it using also these special words:

  • {rblname}: is replaced by the DNSBL name (long name of -t flag)
  • {rbltype}: is replaced by the list type (human readable version of $bl in $tables of config.php)
  • {year}: the current year
  • {date822}: the RFC822 formatted date
  • {rblname64}: the encripted base64 {rblname}
  • {hostname}: the hostname of server
  • {unixtimestamp}: the current unix timestamp

The default.conf provides a description field TXT with a URI for the result lookup (lookup.php). The lookup.php needs two GET parameters:

  • the object to query
  • the base64 encrypted long name of the list.

Hint: don't change this configuration if you don't really know what you want.

You can export the list via crontab. For instance:

# Run export of DNSBL every 30 minutes`
*/30 * * * * root cd /usr/local/RBL/contrib/rbldns/myrbl; ../exportdns.php -f ../conf.default -t whiteip
*/30 * * * * root cd /usr/local/RBL/contrib/rbldns/myrbl; ../exportdns.php -f ../conf.default -t spamip

But if you run a systemd OS you better like to install systemd scripts (see systemd folder, and run install.sh). An example of systemd service is like this /usr/lib/systemd/system/[email protected]:

[Unit]
Description = RBLDNS Exporter for %i list
AssertPathExists=/usr/local/RBL/contrib/rbldns/yourbl
After = syslog.target

[Service]
WorkingDirectory=/usr/local/RBL/contrib/rbldns/yourbl
Type = simple
Restart=always
RestartSec=1800s
ExecStart = /usr/local/RBL/contrib/rbldns/exportdns.php -f ../conf.default -t %i

[Install]
WantedBy=multi-user.target

Enable an instance %i for each list name. For example systemctl enable [email protected] systemct start [email protected]

Probably you would store these files in a Rsync server folder to let them available to the RBLDNS host through Rsync: rsync.conf

read only = yes
list = false
uid = nobody
gid = nobody
hosts allow = IP1, IP2
hosts deny = *
log file = /var/log/rsyncd.log
pid file = /run/rsyncd.pid

# Module configuration
[yourbl]
comment = Welcome ~ rbl.example.com for Your DNSBL DNSWL
path = /usr/local/RBL/contrib/rbldns/yourbl

Sorry, currently I have only tested the export of IP lists. The export of networks or domains already works, or it will work with some arrangement.

Clone this wiki locally