pdns  4.5.1
About: PowerDNS daemon - a high performance authoritative nameserver.
  Fossies Dox: pdns-4.5.1.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  


PowerDNS is a very versatile nameserver that can answer questions from different backends. To implement your own backend, see the documentation for the DNSBackend class.

Copyright and License

PowerDNS is (C) 2001-2008 PowerDNS.COM BV. It is distributed according to the terms of the General Public License version 2.

High level overview

The Distributor contains a configurable number of PacketHandler instances, each in its own thread, for connection pooling. PacketHandler instances are recycled of they let escape an PDNSException.

The PacketHandler implements the RFC1034 algorithm and converts question packets into DNSBackend queries.

A DNSBackend is an entity that returns DNSResourceRecord objects in return to explicit questions for domains with a specified QType

PowerDNS uses the UeberBackend, which hosts DNSBackends. By default it has no DNSBackends within itself, those are loaded by setting –load=

This way DNSBackend implementations can be kept completely separate, but most aren't.

If one or more DNSBackends are loaded, the UeberBackend fields the queries to all of them until one answers.

TCP Operations

The TCP operation runs within a single thread called tcpreceiver(), that also queries the PacketHandler.


On its own, this setup is not suitable for high performance operations. A single DNS query can turn into many DNSBackend questions, each taking many milliseconds to complete. This is why the qthread() first checks the PacketCache to see if an answer is known to a packet asking this question. If so, the entire Distributor is shunted, and the answer is sent back directly, within a few microseconds.


Configuration details are available via the ArgvMap instance arg. Statistics are created by making calls to the StatBag object called S. These statistics are made available via the UeberBackend on the same socket that is used for dynamic module commands.


The main() of PowerDNS can be found in receiver.cc - start reading there for further insights into the operation of the nameserver