Django PowerDNS

Welcome to the PowerDNS app for Django.

This application allows easy administration of PowerDNS records stored in an SQL database by leveraging the standard Django Admin app. You may also use the Django PowerDNS application as part of a larger project to programatically modify your DNS records.


Simply add powerdns to INSTALLED_APPS in your Use South for database migrations.

Customizing resource record types

If you're not using DNSSEC or the other less common record types, you can simplify the user interface even more by specifying a sequence of types the app should use. Simply put this in your

    'A', 'AAAA', 'CNAME', 'HINFO', 'MX', 'NAPTR', 'NS',
    'PTR', 'SOA', 'SRV', 'TXT',

Consult PowerDNS documentation for a list of supported resource record types.

Using a separate database for PowerDNS

If your Django application is using a different database than the one used by PowerDNS, provide the configuration for the DNS database in as a separate entry in DATABASES, for example:

    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'project_db',
        'USER': 'user',
        'PASSWORD': 'secret',
        'HOST': '',
        'PORT': '3306',
        'OPTIONS': {
            "init_command": "SET storage_engine=INNODB",
    'powerdns': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'powerdns',
        'USER': 'pdns',
        'PASSWORD': 'pdns',
        'HOST': '',
        'PORT': '3306',
        'OPTIONS': {
            "init_command": "SET storage_engine=INNODB",

For Django to automatically route powerdns requests to the right database, add this setting to

DATABASE_ROUTERS = ['powerdns.routers.PowerDNSRouter']

You have to sync and migrate the default and the powerdns databases separately. First the default database:

$ python syncdb
$ python migrate

Then the powerdns database:

$ python syncdb --database=powerdns
$ python migrate --database==powerdns powerdns

Note that the powerdns database will maintain its own separate South migration history table. This is especially helpful if your connecting several Django projects to a single PowerDNS database.

Also note that due to South limitations, migrate will create all powerdns tables also in the default database. This is harmless, even though creates some clutter.


Application written by Peter Nixon and Łukasz Langa. NSEC3 code based on George Notaras' work with django-powerdns-manager.