🌐 Howto migrate from tinydns to powerdns

Here is a quick way to use powerdns itself to migrate from tinydns to powerdns.

Here is how you can use powerdns itself to migrate from tinydns to powerdns:

  • Make copy of the data.cdb file from tinydns
  • Run powerdns with the tinydns backend:
pdns_server \
  --no-config --daemon=no \
  --local-port=5300 \
  --launch=tinydns --socket-dir=/tmp \
  --tinydns-dbfile=data.cdb
  • List all the zones inside the tinydns cdb file and save the list to a file:
pdnsutil \
  --config-dir=~/tinydns/conf \
  list-all-zones > /tmp/zone-list
  • Extract and save all DNS records for each domain:
mkdir /tmp/zones/
for z in cat ../zones;
do
  pdnsutil --config-dir=~/tinydns/conf \
    list-zone $z > /tmp/zones/$z;
done
  • Import the zones back into powerdns setup with any other backend:
cd /tmp/zones/
for zone in `ls -1`; do
   pdnsutil load-zone $zone $zone;
done