Re: named zone files to tinydns data

Andrew Edelstein <[email protected]> Thu, 12 Aug 2010 00:41:33 -0500
Newsgroups gmane.network.djbdns
Message-ID <[email protected]>
On 8/11/2010 11:54 PM, Andrew Edelstein wrote:
> 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