]> git.ipfire.org Git - thirdparty/pdns.git/blob - pdns/docs/powerdns-technical.sgml
Initial revision
[thirdparty/pdns.git] / pdns / docs / powerdns-technical.sgml
1 <!doctype linuxdoc system>
2
3 <article>
4
5 <!-- Title information -->
6 <title>PowerDNS technical overview</title>
7 <author>PowerDNS BV (bert hubert &lt;bert@trilab.com&gt;) &nl;
8 Trilab BV</author>
9 <date>v1.1 $Date: 2002/11/27 15:18:35 $</date>
10 <abstract>
11 This document contains a technical description of PowerDNS.
12 </abstract>
13 <toc>
14 <sect>PowerDNS is a next generation authoritative nameserver
15 <p>
16 DNS is among the most mission-critical parts of the internet. While in
17 essence very simple, current implementations are complicated applications
18 with source code often spanning dozens of megabytes.
19
20 The growth of the number of domains means that there is a growing need for a
21 lean and mean nameserver that is capable of serving millions of users with
22 millions of domains.
23
24 The operation of PowerDNS consists of three different parts:
25 <itemize>
26 <item>Internet Interface
27 <item>Logical Engine
28 <item>Query Backend
29 </itemize>
30
31 The Internet Interface receives a question, and hands it to the Logical
32 Engine. This Logical Engine then splits up the question into the
33 sub-queries, which are handed to the Query Backend, which in turn sends
34 queries to any number of data sources. The answer is then transferred back by
35 the Logical Engine to the Internet Interface, which sends out the packet
36 containing the requested data.
37
38 <descrip>
39 <tag>The Internet Interface</tag>
40 PowerDNS supports receiving queries over UDP and TCP. When a question is
41 received, relevant parts of the packet containing the question are compared
42 to queries received earlier.
43
44 <tag>The Logical Engine</tag>
45 A DNS query cannot be translated directly into a backend query. A question
46 might be 'What is the IP Address of www.site.com'. In order to answer this
47 question, some separate steps need to be performed:
48
49 <itemize>
50 <item>Is this nameserver Authoritative for this domain, or any of its parent
51 domains?
52 <item>Do we have a Canonical Name for www.site.com?
53 <item>Does www.site.com exist?
54 <item>Do we have an IP address for it?
55 <item>If we don't, do we know who does?
56 <item>Possibly send IP addresses for the nameservers who do know
57 </itemize>
58
59 This algorithm is described at length in RFC 1034.
60
61 <tag>The Query Backend</tag>
62 A real life nameserver may have many data sources. Several customer
63 databases might exist, as well as standard Zone files. The Query Backend
64 fields questions to any number of backends, in a prescribed order. This
65 allows for maximum flexibility.
66 </descrip>
67
68 <sect>Simplicity brings reliability
69 <p>
70
71 By building on top of existing databases, PowerDNS is as trustworthy as your
72 favorite database. Data storage and retrieval is a well solved problem. A
73 nameserver should not reinvent it. We support almost all industry standard
74 databases and also do custom backend development to graft PowerDNS on an
75 existing database or schema.
76
77 Due to the completely from scratch implementation without an existing
78 installed base to appease, PowerDNS has remained very lean and mean.
79
80 Monitoring is at the root of reliability, so the PowerDNS runtime can be
81 queried by external scripts. This enables the operator to be informed of any
82 problems at an early stage. Some sample scripts for the popular MRTG program
83 are supplied.
84
85 <sect>Incredible performance
86 <p>
87 Because of the many steps of the algorithm prescribed by RFC 1034, just
88 hooking on a database to a nameserver is not a recipe for great performance.
89 Steps need to be taken to streamline the process.
90
91 PowerDNS does so in two ways:
92 <descrip>
93 <tag>Reordering the steps of the algorithm</tag>
94 It is often possible to skip some of the steps in the algorithm initially,
95 and only perform the other steps when it is really needed, which is often
96 not the case.
97 <tag>The PacketCache</tag>
98 The PacketCache is quite revolutionary in that it caches entire query
99 packets for short amounts of time. This PacketCache is consulted before
100 running the RFC 1034 Algorithm in the Logical Engine. In production, it has
101 been confirmed that even a 1 minute cache can achieve a 80% hitrate and
102 thereby prevent 4 out of 5 database queries from ever happening.
103 </descrip>
104
105 Benchmarking has shown that PowerDNS should be able to reach in the order of
106 20.000 queries/second on a reasonably fast database. When using direct
107 tables like those supported by Berkeley DB, 50.000 should be achievable.
108
109 The use of POSIX Threads also allows PowerDNS to use a large number of
110 processors efficiently on architectures that support it.
111 <sect>Complete security
112 <p>
113 PowerDNS is written in highly portable C++ using the ISO Standard C++
114 Library (STL). This Library comes with dynamic string classes which all but
115 erase the possibility of the much feared buffer overflows that have been
116 hitting other nameservers.
117
118 The very modular design of PowerDNS also makes for strict internal
119 interfaces which can prevent any undesired action from having deleterious
120 effects.
121
122 Due to the use of modern tools and libraries, PowerDNS consists of only 7000
123 lines of source. This is very well auditable in a reasonable period of time
124 and can be regarded as a trusted computing base.
125
126 Because the database is most often external, it is highly useful to grant
127 PowerDNS read-only access to that database. Even a successful compromise can
128 than not easily be exploited, because the database refuses to accept updates
129 from the nameserver.
130
131 <sect>Special Functions
132 <p>
133 Besides doing lookups in well known databases such as Oracle, Microsoft SQL
134 Server, MySQL, PostgreSQL and Sybase, there are special purpose backends
135 available.
136
137 <sect1>Very Large Zone support
138 <p>
139 For customers with very large zones and a lots of secondaries, a special
140 module has been developed to meet the following goals:
141 <itemize>
142 <item>Absolute 100% robustness
143 <item>Incremental updates
144 <item>Near realtime updates
145 <item>Idempotent update packets
146 <item>Instantaneous zone reloading
147 </itemize>
148
149 In short, this means that updates are broadcast from a central point. These
150 updates can be broadcast as many times as desired because there is no harm
151 in applying them more than once. Each of these updates is applied within
152 seconds.
153
154 It does not use a relational database but instead relies on any of the
155 well known table engines that are available, with a strong slant towards
156 Berkeley DB.
157 <sect1>Global Redirection
158 <p>
159 With the aid of a comprehensive map of IP addresses, it is possible to do
160 smart routing of customers to servers geographically near them. While not
161 providing pin-point accuracy, it is broadly effective and very fast.
162
163 <sect1>DNS based loadbalancing and failover
164 <p>
165 Because of the efficiency of PowerDNS, it is feasible to use very low TTLs
166 on answers. This in turn makes it possible to perform DNS based
167 loadbalancing and failover. This can be very robust because the DNS
168 infrastructure itself is redundant, whereas regular loadbalancing agents are
169 themselves a single point of failure.
170
171 <sect1>CORBA backend
172 <p>
173 By allowing questions to be asked over this industry standard protocol,
174 it becomes trivially easy to integrate PowerDNS with existing middleware
175 applications and/or customer databases.
176
177 <sect>Standards compliance
178 <p>
179 PowerDNS is committed to being fully standards compliant. Current supported
180 standards include RFC 1034, RFC 1035 and RFC 2181.
181
182 <sect>Availability
183 <p>
184 PowerDNS is available immediately for use. It comes with completely
185 documented source and a license that allows the end-user to improve and or
186 change the source.
187
188 Licensing is possible on a per-CPU or on a per-Domain basis.
189
190 PowerDNS is a fully supported product with different levels of support
191 available.
192 </article>
193