PowerDNS Web Control Panel
Features:
- Get aggregate statistics of all PowerDNS instances, split out by authoritative and recursive servers
- Centrally & individually purge caches of possibly outdated data
- Centrally & individually search log files for troubleshooting purposes
- Monitor patch levels of all servers
- Centrally & individually deploy versions of the software
- Centrally & individually start, restart and stop instances
- View configuration details
- View and edit zone contents
- Python 2.6 or Python 2.7
- PowerDNS Authoritative 3.4.2 or newer
- PowerDNS Recursor 3.7.1 or newer
- Graphite
- PostgreSQL 8.3 or newer, or MySQL 5.5 or newer, or SQLite 3
- Cron
- Chrome 33+
- Firefox 24.3+
- Internet Explorer 9+
- Safari 7+
How it all hangs together:
- PowerDNS Authoritative Server and PowerDNS Recursor both publish data, and accept commands, via a JSON-powered, RESTful interface. This interface is not specific to 'pdnscontrol', and can be used by everyone. Commands allow for full zone editing, removal etc.
- We provide a Flask-based webapp through which you can query, manipulate and configure your PowerDNS instances through the JSON interface
- A separate program, pdnsmgrd, can stop, start and restart your PowerDNS instances remotely. It can also proxy API requests to multiple servers, and provides SSL encryption
- A separate program, pdns2graphite, stores all metrics in graphite. The webapp meanwhile refers to graphite graphs in its user interface
- pdns2graphite can query the webapp for configuration details
Flask-based web app.
Make sure you have MySQL, PostgreSQL and Python development libraries available, possibly like this:
sudo apt-get install libpq-dev libmysqlclient-dev python-dev
(SQLite drivers come with Python, so there's no extra library to install.)
Then:
virtualenv venv-pdnscontrol
. ./venv-pdnscontrol/bin/activate
pip install -r requirements.txt
Note that the middle 'activate' command creates a special working environment, which must remain active for the 'pip install' and the 'python install.py' below!
# reenter virtualenv if needed:
. ./venv-pdnscontrol/bin/activate
cp instance/pdnscontrol.conf.example instance/pdnscontrol.conf
editor instance/pdnscontrol.conf
python install.py
. ./venv-pdnscontrol/bin/activate
python debug.py
Don't forget to enable the webserver and API features on your PowerDNS installations (experimental-webserver, experimental-webserver-address, experimental-webserver-password, experimental-json-interface for Recursor, experimental-json-interface and webserver-address for Authoritative). The 'experimental-' prefix denotes that the API might still change, but if it does, pdnscontrol will change with it.
We recommend using gunicorn and nginx or Apache as a reverse proxy.
Example gunicorn command line (assuming you've installed pdnscontrol into /opt/pdnscontrol
and a dedicated system user named pdnscontrol
has been created):
/opt/pdnscontrol/pdnscontrol/venv-pdnscontrol/bin/gunicorn --chdir /opt/pdnscontrol/pdnscontrol/ -u pdnscontrol -w 5 -b :8000 --log-level debug --error-logfile /dev/stderr pdnscontrol:app
User-contributed documentation about running pdnscontrol under uWSGI + nginx. (We recommend using gunicorn + nginx or Apache for production deployments.)
uWSGI Sample configuration:
[uwsgi]
plugins = python27
virtualenv = /opt/pdnscontrol/venv-pdnscontrol
chdir = /opt/pdnscontrol
master = true
harakiri = 30
sharedarea = 4
processes = 1
socket = /run/%n.socket
uid=uwsgi
gid=uwsgi
chown-socket = nginx
#location of log files
logto = /var/log/uwsgi/%n.log
wsgi-file = /opt/pdnscontrol/instance/pdnscontrol.wsgi
nginx Sample configuration:
server {
...
location /pdnscontrol/ {
include uwsgi_params;
uwsgi_pass unix:/run/pdnscontrol.socket;
uwsgi_param UWSGI_SCHEME https;
uwsgi_param SCRIPT_NAME /pdnscontrol;
uwsgi_modifier1 30;
}
}
See the instructions in Dockerfile
on how to get a minimal Docker container with PowerDNS Authoritative Server and pdnscontrol.
To update built templates, you also need to have other software installed. See pdnscontrol/README.md for details.
If you update your checkout you might, but should not, have to run:
./manage.py assets build
Feeds PowerDNS stats into your Graphite installation.
Lives in pdns2graphite
. Look at pdns2graphite/README.markdown for documentation.
Runs system-wide commands that affect the pdns binaries/processes. Also proxies the PowerDNS JSON interface for consumption over SSL.
Lives in pdnsmgrd
. Look at pdnsmgrd/README.markdown for documentation.
The current code is known to run on these platforms:
- CentOS 6 (Python 2.7)
- Debian wheezy (Python 2.7)