Discussion:
named zone files to tinydns data
George Georgalis
2010-08-12 03:32:53 UTC
Permalink
Hi All -

I'm looking for a script to convert a hellish set of bind zones to
a tinydns data file.

Anyone have an offering or suggestion?

George
Andrew Edelstein
2010-08-12 04:54:19 UTC
Permalink
Post by George Georgalis
Hi All -
I'm looking for a script to convert a hellish set of bind zones to
a tinydns data file.
Anyone have an offering or suggestion?
Easiest way? Set up an instance of axfrdns to do a zone transfer from
your bind instance. Axfrdns will pull the data and dump it into your
tinydns $root/data file.
Andrew Edelstein
2010-08-12 05:41:33 UTC
Permalink
Post by Andrew Edelstein
Easiest way? Set up an instance of axfrdns to do a zone transfer from
your bind instance. Axfrdns will pull the data and dump it into your
tinydns $root/data file.
(I blame the fact that it's late and I'm tired).
Of course I meant, use tcpclient to run axfr-get to fetch the zone from
your bind instance. It will dump the zone to a file in the correct
format to be used in your tinydns data file.

I use the following to axfr the zones for which I am secondary. This
pulls the list of zones to be fetched from a separate text file and
dumps the data for each zone each into it's own file. When it's done, it
runs make in the tinydns data root to concatenate all my zones into the
data dir, the compile data.cdb.

#!/bin/sh

service=/service/tinydns/root
savedir=${service}/zones
server=X.X.X.X

for domain in `cat ${service}/domains`; do
tcpclient -R ${server} 53 axfr-get ${domain} ${savedir}/${domain} \
/tmp/$domain
done

cd ${service}
make 2>&1 > /dev/null


My $service/Makefile:

DOMAINS = zones/*

data.cdb: data
/usr/local/bin/tinydns-data
data: $(DOMAINS)
cat $(DOMAINS) > data
Chris Pugh
2010-08-12 08:25:55 UTC
Permalink
Post by George Georgalis
Hi All -
I'm looking for a script to convert a hellish set of bind zones to
a tinydns data file.
Anyone have an offering or suggestion?
George
Also look under the section,

Data generation and conversion

here,

http://tinydns.org

Best,


Chris.

Loading...