Chapter 10. Migrating to PowerDNS

Table of Contents

1. Zone2sql

Before migrating to PowerDNS a few things should be considered.

PowerDNS does not operate as a 'slave' or 'master' server with all backends

Only the Generic SQL, OpenDBX and BIND backends have the ability to act as master or slave.

To migrate, the zone2sql tool is provided.

Additionally, the PowerDNS source comes with a number of diagnostic tools, which can be helpful in verifying proper PowerDNS operation, versus incumbent nameservers. See Chapter 26, Tools to analyse DNS traffic for more details.

1. Zone2sql

Zone2sql parses Bind named.conf files and zone files and outputs SQL on standard out, which can then be fed to your database.

Zone2sql understands the Bind master file extension '$GENERATE' and will also honour '$ORIGIN' and '$TTL'.

For backends supporting slave operation (currently only the Generic PostgreSQL, Generic MySQL and BIND backend), there is also an option to keep slave zones as slaves, and not convert them to native operation.

zone2sql can generate SQL for the Generic PostgreSQL, Generic MySQL and Oracle backends. The following commands are available:

--bare

Output in a bare format, suitable for further parsing. The output is formatted as follows:

		  domain_id<TAB>'qname'<TAB>'qtype'<TAB>'content'<TAB>prio<TAB>ttl
		

--gmysql

Output in format suitable for the default configuration of the Generic MySQL backend.

--gpgsql

Output in format suitable for the default configuration of the Generic PostgreSQL backend.

--help

List options.

--named-conf=...

Parse this named.conf to find locations of zones.

--on-error-resume-next

Ignore missing files during parsing. Dangerous.

--oracle

Output in format suitable for the default configuration of the Generic Oracle backend.

--slave

Maintain slave status of zones listed in named.conf as being slaves. The default behaviour is to convert all zones to native operation.

--transactions

For Oracle and PostgreSQL output, wrap each domain in a transaction for higher speed and integrity.

--verbose

Be verbose during conversion.

--zone=...

Parse only this zone file. Conflicts with --named-conf parameter.

--zone-name=...

When parsing a single zone without $ORIGIN statement, set this as the zone name.