Skip to content
A PowerDNS web interface with advanced features
Python HTML Other
Branch: master
Clone or download
Pull request Compare This branch is 8 commits behind ngoduykhanh:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


A PowerDNS web interface with advanced features.

Build Status Language grade: Python Language grade: JavaScript


  • Multiple domain management
  • Domain template
  • User management
  • User access management based on domain
  • User activity logging
  • Support Local DB / SAML / LDAP / Active Directory user authentication
  • Support Google / Github / OpenID OAuth
  • Support Two-factor authentication (TOTP)
  • Dashboard and pdns service statistics
  • DynDNS 2 protocol support
  • Edit IPv6 PTRs using IPv6 addresses directly (no more editing of literal addresses!)
  • limited API for manipulating zones and records

Running PowerDNS-Admin

There are several ways to run PowerDNS-Admin. Following is a simple way to start PowerDNS-Admin with docker in development environment which has PowerDNS-Admin, PowerDNS server and MySQL Back-End Database.

Step 1: Changing configuration

The configuration file for development environment is located at configs/, you can override some configs by editing the .env file.

Step 2: Build docker images

$ docker-compose build

Step 3: Start docker containers

$ docker-compose up

You can now access PowerDNS-Admin at url http://localhost:9191

NOTE: For other methods to run PowerDNS-Admin, please take look at WIKI pages.



Running tests

NOTE: Tests will create __pycache__ folders which will be owned by root, which might be issue during rebuild

thus (e.g. invalid tar headers message) when such situation occurs, you need to remove those folders as root

  1. Build images
  docker-compose -f docker-compose-test.yml build
  1. Run tests
  docker-compose -f docker-compose-test.yml up
  1. Rerun tests
  docker-compose -f docker-compose-test.yml down

To teardown previous environment

  docker-compose -f docker-compose-test.yml up

To run tests again

API Usage

  1. run docker image docker-compose up, go to UI http://localhost:9191, at http://localhost:9191/swagger is swagger API specification
  2. click to register user, type e.g. user: admin and password: admin
  3. login to UI in settings enable allow domain creation for users,
    now you can create and manage domains with admin account and also ordinary users
  4. Encode your user and password to base64, in our example we have user admin and password admin so in linux cmd line we type:
someuser@somehost:~$echo -n 'admin:admin'|base64

we use generated output in basic authentication, we authenticate as user, with basic authentication, we can create/delete/get zone and create/delete/get/update apikeys

creating domain:

curl -L -vvv -H 'Content-Type: application/json' -H 'Authorization: Basic YWRtaW46YWRtaW4=' -X POST http://localhost:9191/api/v1/pdnsadmin/zones --data '{"name": "", "kind": "NATIVE", "nameservers": [""]}'

creating apikey which has Administrator role, apikey can have also User role, when creating such apikey you have to specify also domain for which apikey is valid:

curl -L -vvv -H 'Content-Type: application/json' -H 'Authorization: Basic YWRtaW46YWRtaW4=' -X POST http://localhost:9191/api/v1/pdnsadmin/apikeys --data '{"description": "masterkey","domains":[], "role": "Administrator"}'

call above will return response like this:

[{"description": "samekey", "domains": [], "role": {"name": "Administrator", "id": 1}, "id": 2, "plain_key": "aGCthP3KLAeyjZI"}]

we take plain_key and base64 encode it, this is the only time we can get API key in plain text and save it somewhere:

someuser@somehost:~$echo -n 'aGCthP3KLAeyjZI'|base64

We can use apikey for all calls specified in our API specification (it tries to follow powerdns API 1:1, only tsigkeys endpoints are not yet implemented), don't forget to specify Content-Type!

getting powerdns configuration:

curl -L -vvv -H 'Content-Type: application/json' -H 'X-API-KEY: YUdDdGhQM0tMQWV5alpJ' -X GET http://localhost:9191/api/v1/servers/localhost/config

creating and updating records:

curl -X PATCH -H 'Content-Type: application/json' --data '{"rrsets": [{"name": "","type": "A","ttl": 86400,"changetype": "REPLACE","records": [ {"content": "", "disabled": false} ]},{"name": "","type": "AAAA","ttl": 86400,"changetype": "REPLACE","records": [ {"content": "2001:db8::6", "disabled": false} ]}]}' -H 'X-API-Key: YUdDdGhQM0tMQWV5alpJ'

getting domain:

curl -L -vvv -H 'Content-Type: application/json' -H 'X-API-KEY: YUdDdGhQM0tMQWV5alpJ' -X GET http://localhost:9191/api/v1/servers/localhost/zones/

list zone records:

curl -H 'Content-Type: application/json' -H 'X-API-Key: YUdDdGhQM0tMQWV5alpJ' http://localhost:9191/api/v1/servers/localhost/zones/

add new record:

curl -H 'Content-Type: application/json' -X PATCH --data '{"rrsets": [ {"name": "", "type": "A", "ttl": 86400, "changetype": "REPLACE", "records": [ {"content": "", "disabled": false } ] } ] }' -H 'X-API-Key: YUdDdGhQM0tMQWV5alpJ' http://localhost:9191/api/v1/servers/localhost/zones/ | jq .

update record:

curl -H 'Content-Type: application/json' -X PATCH --data '{"rrsets": [ {"name": "", "type": "A", "ttl": 86400, "changetype": "REPLACE", "records": [ {"content": "", "disabled": false, "name": "", "ttl": 86400, "type": "A"}]}]}' -H 'X-API-Key: YUdDdGhQM0tMQWV5alpJ' http://localhost:9191/api/v1/servers/localhost/zones/ | jq .

delete record:

curl -H 'Content-Type: application/json' -X PATCH --data '{"rrsets": [ {"name": "", "type": "A", "ttl": 86400, "changetype": "DELETE"}]}' -H 'X-API-Key: YUdDdGhQM0tMQWV5alpJ' http://localhost:9191/api/v1/servers/localhost/zones/ | jq

Generate ER diagram

apt-get install python-dev graphviz libgraphviz-dev pkg-config
pip install graphviz mysqlclient ERAlchemy
docker-compose up -d
source .env
eralchemy -i 'mysql://${PDA_DB_USER}:${PDA_DB_PASSWORD}@'$(docker inspect powerdns-admin-mysql|jq -jr '.[0].NetworkSettings.Networks.powerdnsadmin_default.IPAddress')':3306/powerdns_admin' -o /tmp/output.pdf
You can’t perform that action at this time.