[rbldnsd] Converting Bind Zone Format to rbldnsd Format

Michael Tokarev mjt at corpit.ru
Sun May 20 19:57:43 MSD 2007


[rbldnsd mailinglist CC'd, hope you don't mind]

Sebastian Ganschow wrote:
> Dear Michael,
> 
> we are searching for a method to convert a BIND zone file into the ip4set
> Format. We've seen that rbldnsd can dump into BIND zone files. But is the other
> direction also possible?
> Do you know any existing tool which can be used for this conversion.

The thing is that it is definitely NOT possible to convert a BIND zone file
(called "master zone format") into ip4set.  At least "any" BIND zone.

Because BIND zones supposed to contain anything ever possible to see in
DNS, while ip4set is a very specific - it doesn't even related to DNS to
start with.

So to answer to your question - it all really depends on the format (subset
of master zone) you're dealing with.  For every particular case of a
reasonable subset it is possible to perform such a conversion, with some
ad-hoc scripting.

There was one or two examples of a perl scripts to convert specific formats
to ip4set - for former osirusoft.com and wirehub.nl zones - but since now
both are history, I removed the scripts from the distribution.

In any way, all what you need is to figure out with what exactly you're
dealing with, find out where's the IP addresses (and possible shortcuts
like listing of /24 as *.a.b.c etc), and convert that to a list of IP
addresses.  Depending on the complexeties of input, it may be outright
trivial sed(1) expression or 10..20-lines perl script.

But it's definitely much more easier to start with the original data,
maintained as a list of IP addresses, instead of trying to convert
BIND data back into that list.

BTW, if you're talking about MAPS+ data, there were several scripts
posted to rbldnsd list.  I myself never saw their data so I can't
comment whenever those scripts are correct or not.

/mjt


More information about the rbldnsd mailing list