[rbldnsd] RBLDNSD and MySQL?

Michael Tokarev mjt at tls.msk.ru
Tue Mar 23 17:04:21 MSK 2004


Armando Ortiz wrote:
> Does anyone know if a fork of this project exists to make the rbldnsd
> check a MySQL database for IP information to either exclude or reject
> connections?

I don't know about any forks of rbldnsd code so far ;)

> I have a MySQL database that contains quite a few records and I cron
> scripts every 3 hours to update my blocklists.  These IP's get inserted
> either via spamtraps or by my own hand and I'd rather see this process
> automated as much as possible and in more real-time than anything else.

What do you have in mind - do you want rbldnsd to perform sql query of
mysql db for every dns query?  Or do you want rbldnsd to load the data
directly off mysql db instead of the text file as it currently does?
For the former, i don't think this is quite a good idea (for high
load anyway - it may work well enouth if your server gets a few
queries/sec only and your DB is able to handle the load), because of
performance issues.  For the latter, there's no real need to -
generating a text file from sql db and making it available to
rbldnsd is just simple, you save almost nothing by providing
"direct" rbldnsd=>sql interface for reloads, but introduce
complexity and inter-service dependance (you have to link
rbldnsd with mysql libs at least), and making the whole stuff
less general (others will want to query pgsql, others - mssql
or oracle and so on).

In order to speed up the "data propagation", there are several
choices, some of which should work right now (depending on your
setup and the amount of data you have):

  - perform db dumps and reloads more often than once every
    3 hours.  Many public DNSBLs like e.g. DSBL.org, CBL etc,
    performs data generation quite often (every 5 minutes for
    DSBL).  Possibility of such a solution depends on your
    schema and amount of data you have.

  - do not use DNS-based blocklist, but query the SQL DB directly.
    Many nowadays MTAs available for *nix allows to use mysql,
    and all are able to use text files.

  - there is a possibility exists ofcource to implement a dns
    server that operates out of SQL DB, and even more, several
    such servers already available (maradns if memory serves
    me right, bind9 has some bindings for sql databases and
    so on).  Rbldnsd is not able to use any external database,
    it's primary goal was effectiveness with large amount of
    data and large number of queries (currently, for DSBL.org
    only (which have 12 public nameservers), an average number
    of queries per sec is 500..800, which will be quite difficult
    for an SQL DB).

/mjt


More information about the rbldnsd mailing list