django-powerdns-manager / docs / quickstart.rst

Quick start - Running the example project

This section contains information, about how to use the example Django project, which ships with the distribution package, in order to quickly test the features of django-powerdns-manager.

Warning

The example project has been configured for testing and debugging, therefore it should only be used for such purposes. Please, do not use the example project in production.

The example Django project has been configured to use an SQLite database. Consequently, PowerDNS has to be configured to use the SQLite backend in order to be able to communicate with the managed database. A sample configuration file for PowerDNS is included in the example directory.

The following instructions will guide you run the Django project's application server and also run an instance of PowerDNS for testing purposes.

It is assumed that you have obtained a copy of django-powerdns-manager and have changed to the example directory:

hg clone https://bitbucket.org/gnotaras/django-powerdns-manager
cd django-powerdns-manager/example/

Install required software

The recommended version of PowerDNS is 3.1.

Install the required software by following the operating system specific instructions below.

Red Hat Enterprise Linux, CentOS and Fedora

Install system packages:

yum install pdns pdns-backend-sqlite sqlite python-sqlite2

Debian and Ubuntu

Install system packages:

apt-get install ...

Install Python modules

Note

Current directory is: django-powerdns-manager/example/

It is highly recommended to use the virtualenv utility to create a virtual environment, in which all Python module dependencies can be installed without affecting the system-wide Python library. However, this step is completely optional:

virtualenv --system-site-packages testenv
source testenv/bin/activate

Install the required Python modules in order to be able to run the example django-powerdns-manager project and build this documentation:

pip install -r ../requirements.txt

Populate the database

Note

Current directory is: django-powerdns-manager/example/

First, populate the Django project's database:

python manage.py syncdb

You will be prompted to create a superuser. Create this user and take a note of the username and password as this is what you will use to log into the web based administration interface.

Finally, populate the dedicated django-powerdns-manager database:

python manage.py syncdb --database=powerdns

Start the PowerDNS server

Note

Current directory is: django-powerdns-manager/example/

The example project contains a configuration file for PowerDNS.

First, start the server in the foreground to check that everything is working as expected:

$ pdns_server --local-address=192.168.0.101 --config-dir=`pwd`
Nov 02 11:42:33 Reading random entropy from '/dev/urandom'
Nov 02 11:42:33 This is module gsqlite3 reporting
Nov 02 11:42:33 This is a standalone pdns
Nov 02 11:42:33 Listening on controlsocket in '/var/run/pdns.controlsocket'
Nov 02 11:42:33 UDP server bound to 192.168.0.101:53
Nov 02 11:42:33 TCP server bound to 192.168.0.101:53
Nov 02 11:42:33 PowerDNS 3.1 (C) 2001-2012 PowerDNS.COM BV (Oct 22 2012, 04:10:24, gcc 4.4.6 20120305 (Red Hat 4.4.6-4)) starting up
Nov 02 11:42:33 PowerDNS comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it according to the terms of the GPL version 2.
Nov 02 11:42:33 Creating backend connection for TCP
Nov 02 11:42:33 gsqlite3: connection to 'powerdns.db' successful
Nov 02 11:42:33 gsqlite3: connection to 'powerdns.db' successful
Nov 02 11:42:33 About to create 3 backend threads for UDP
Nov 02 11:42:33 gsqlite3: connection to 'powerdns.db' successful
Nov 02 11:42:33 gsqlite3: connection to 'powerdns.db' successful
Nov 02 11:42:33 gsqlite3: connection to 'powerdns.db' successful
Nov 02 11:42:33 gsqlite3: connection to 'powerdns.db' successful
Nov 02 11:42:33 gsqlite3: connection to 'powerdns.db' successful
Nov 02 11:42:33 gsqlite3: connection to 'powerdns.db' successful
Nov 02 11:42:33 Done launching threads, ready to distribute questions

--local-address=192.168.0.101 is used to make PowerDNS bind on the network interface with IP 192.168.0.101. Set this according to your network configuration or omit this option completely to make PowerDNS bind on all available network interfaces.

The output above indicates that everything is running fine, so stop this process by pressing Ctrl-C and start PowerDNS in the background:

pdns_server --daemon --local-address=192.168.0.101 --config-dir=`pwd`

Note

To kill the background server at any time invoke the command:

killall pdns_server

Start the PowerDNS Manager application server

Note

Current directory is: django-powerdns-manager/example/

Start the internal Django HTTP server:

python manage.py runserver 192.168.0.101:9999

Visit the administration interface

Use your browser to visit:

http://192.168.0.101:9999/admin/

Other notes

After you have finished testing django-powerdns-manager and only if you had used virtualenv, it is now time to deactivate the virtual Python environment. Run the following command:

deactivate
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.