]>
Commit | Line | Data |
---|---|---|
d16e0461 | 1 | PowerDNS manual |
33ccb468 | 2 | |
3 | PowerDNS BV | |
4 | ||
d16e0461 TP |
5 | <pdns@powerdns.com> |
6 | ||
33ccb468 | 7 | |
d16e0461 | 8 | It is a book about a Spanish guy called Manual. You should read it. |
33ccb468 | 9 | -- Dilbert |
d16e0461 TP |
10 | |
11 | ||
12 | ---------------------------------------------------------------------- | |
33ccb468 | 13 | |
14 | Table of Contents | |
33ccb468 | 15 | |
d16e0461 TP |
16 | 1. The PowerDNS dynamic nameserver |
17 | ||
18 | 1.1. Function & design of PDNS | |
19 | ||
20 | 1.2. About this document | |
21 | ||
22 | 1.3. Release notes | |
23 | ||
fc2fb8ea | 24 | 1.3.1. Version 2.9.16 |
d16e0461 | 25 | |
fc2fb8ea | 26 | 1.3.2. Version 2.9.15 |
d16e0461 | 27 | |
fc2fb8ea | 28 | 1.3.3. Version 2.9.14 |
d16e0461 | 29 | |
fc2fb8ea | 30 | 1.3.4. Version 2.9.13 |
d16e0461 | 31 | |
fc2fb8ea | 32 | 1.3.5. Version 2.9.12 |
d16e0461 | 33 | |
fc2fb8ea | 34 | 1.3.6. Version 2.9.11 |
d16e0461 | 35 | |
fc2fb8ea | 36 | 1.3.7. Version 2.9.10 |
d16e0461 | 37 | |
fc2fb8ea | 38 | 1.3.8. Version 2.9.8 |
d16e0461 | 39 | |
fc2fb8ea | 40 | 1.3.9. Version 2.9.7 |
d16e0461 | 41 | |
fc2fb8ea | 42 | 1.3.10. Version 2.9.6 |
d16e0461 | 43 | |
fc2fb8ea | 44 | 1.3.11. Version 2.9.5 |
d16e0461 | 45 | |
fc2fb8ea | 46 | 1.3.12. Version 2.9.4 |
d16e0461 | 47 | |
fc2fb8ea | 48 | 1.3.13. Version 2.9.3a |
d16e0461 | 49 | |
fc2fb8ea | 50 | 1.3.14. Version 2.9.2 |
d16e0461 | 51 | |
fc2fb8ea | 52 | 1.3.15. Version 2.9.1 |
d16e0461 | 53 | |
fc2fb8ea | 54 | 1.3.16. Version 2.9 |
d16e0461 | 55 | |
fc2fb8ea | 56 | 1.3.17. Version 2.8 |
d16e0461 | 57 | |
fc2fb8ea | 58 | 1.3.18. Version 2.7 and 2.7.1 |
d16e0461 | 59 | |
fc2fb8ea | 60 | 1.3.19. Version 2.6.1 |
d16e0461 | 61 | |
fc2fb8ea | 62 | 1.3.20. Version 2.6 |
d16e0461 | 63 | |
fc2fb8ea | 64 | 1.3.21. Version 2.5.1 |
d16e0461 | 65 | |
fc2fb8ea | 66 | 1.3.22. Version 2.5 |
d16e0461 | 67 | |
fc2fb8ea | 68 | 1.3.23. Version 2.4 |
d16e0461 | 69 | |
fc2fb8ea | 70 | 1.3.24. Version 2.3 |
d16e0461 | 71 | |
fc2fb8ea | 72 | 1.3.25. Version 2.2 |
d16e0461 | 73 | |
fc2fb8ea | 74 | 1.3.26. Version 2.1 |
d16e0461 | 75 | |
fc2fb8ea | 76 | 1.3.27. Version 2.0.1 |
d16e0461 | 77 | |
fc2fb8ea | 78 | 1.3.28. Version 2.0 |
d16e0461 | 79 | |
fc2fb8ea | 80 | 1.3.29. Version 2.0 Release Candidate 2 |
d16e0461 | 81 | |
fc2fb8ea | 82 | 1.3.30. Version 2.0 Release Candidate 1 |
d16e0461 | 83 | |
fc2fb8ea | 84 | 1.3.31. Version 1.99.12 Prerelease |
d16e0461 | 85 | |
fc2fb8ea | 86 | 1.3.32. Version 1.99.11 Prerelease |
d16e0461 | 87 | |
fc2fb8ea | 88 | 1.3.33. Version 1.99.10 Prerelease |
d16e0461 | 89 | |
fc2fb8ea | 90 | 1.3.34. Version 1.99.9 Early Access Prerelease |
d16e0461 | 91 | |
fc2fb8ea | 92 | 1.3.35. Version 1.99.8 Early Access Prerelease |
d16e0461 | 93 | |
fc2fb8ea | 94 | 1.3.36. Version 1.99.7 Early Access Prerelease |
d16e0461 | 95 | |
fc2fb8ea | 96 | 1.3.37. Version 1.99.6 Early Access Prerelease |
d16e0461 | 97 | |
fc2fb8ea | 98 | 1.3.38. Version 1.99.5 Early Access Prerelease |
d16e0461 | 99 | |
fc2fb8ea AG |
100 | 1.3.39. Version 1.99.4 Early Access Prerelease |
101 | ||
102 | 1.3.40. Version 1.99.3 Early Access Prerelease | |
103 | ||
104 | 1.3.41. Version 1.99.2 Early Access Prerelease | |
105 | ||
106 | 1.3.42. Version 1.99.1 Early Access Prerelease | |
d16e0461 TP |
107 | |
108 | 1.4. Security | |
109 | ||
110 | 1.5. Acknowledgements | |
111 | ||
112 | 2. Installing on Unix | |
113 | ||
114 | 2.1. Possible problems at this point | |
115 | ||
116 | 2.2. Testing your install | |
117 | ||
118 | 2.2.1. Typical errors | |
119 | ||
120 | 2.3. Running PDNS on unix | |
121 | ||
122 | 3. Installing on Microsoft Windows | |
123 | ||
124 | 3.1. Configuring PDNS on Microsoft Windows | |
125 | ||
126 | 3.2. Running PDNS on Microsoft Windows | |
127 | ||
128 | 4. Configure database connectivity | |
129 | ||
130 | 4.1. Configuring MySQL | |
131 | ||
132 | 4.1.1. Common problems | |
133 | ||
134 | 5. Dynamic resolution using the PipeBackend | |
135 | ||
136 | 5.1. Deploying the PipeBackend with the BindBackend | |
137 | ||
138 | 6. Logging & Monitoring PDNS performance | |
139 | ||
140 | 6.1. Webserver | |
141 | ||
142 | 6.2. Via init.d commands | |
143 | ||
144 | 6.3. Operational logging using syslog | |
145 | ||
146 | 7. Security settings & considerations | |
147 | ||
148 | 7.1. Settings | |
149 | ||
150 | 7.1.1. Running as a less privileged identity | |
151 | ||
152 | 7.1.2. Jailing the process in a chroot | |
153 | ||
154 | 7.2. Considerations | |
155 | ||
156 | 8. Virtual hosting | |
157 | ||
158 | 9. Performance related settings | |
159 | ||
160 | 9.1. Packet Cache | |
161 | ||
162 | 9.2. Query Cache | |
163 | ||
164 | 10. Migrating to PDNS | |
165 | ||
166 | 10.1. Zone2sql | |
167 | ||
168 | 11. Recursion | |
169 | ||
170 | 11.1. Details | |
171 | ||
172 | 12. PowerDNS resolver/recursing nameserver | |
173 | ||
174 | 12.1. pdns_recursor settings | |
175 | ||
176 | 12.1.1. Verisign weirdness | |
177 | ||
178 | 12.2. Details | |
179 | ||
180 | 12.3. Statistics | |
181 | ||
182 | 13. Master/Slave operation & replication | |
183 | ||
184 | 13.1. Native replication | |
185 | ||
186 | 13.2. Slave operation | |
187 | ||
188 | 13.2.1. Supermaster automatic provisioning of | |
189 | slaves | |
33ccb468 | 190 | |
d16e0461 | 191 | 13.3. Master operation |
33ccb468 | 192 | |
d16e0461 | 193 | 14. Fancy records for seamless email and URL integration |
33ccb468 | 194 | |
d16e0461 | 195 | 15. Index of all settings |
33ccb468 | 196 | |
d16e0461 | 197 | 16. Index of all internal metrics |
33ccb468 | 198 | |
d16e0461 | 199 | 16.1. Counters & variables |
33ccb468 | 200 | |
d16e0461 | 201 | 16.1.1. Ring buffers |
33ccb468 | 202 | |
d16e0461 | 203 | 17. Supported record types and their storage |
33ccb468 | 204 | |
d16e0461 | 205 | 18. HOWTO & Frequently Asked Questions |
33ccb468 | 206 | |
d16e0461 | 207 | 18.1. Getting support, free and paid FAQ |
33ccb468 | 208 | |
d16e0461 | 209 | 18.2. Using and Compiling PowerDNS FAQ |
33ccb468 | 210 | |
d16e0461 | 211 | 18.3. Backend developer HOWTO |
33ccb468 | 212 | |
d16e0461 | 213 | 18.4. About PowerDNS.COM BV, 'the company' |
33ccb468 | 214 | |
d16e0461 | 215 | A. Backends in detail |
33ccb468 | 216 | |
d16e0461 | 217 | A.1. PipeBackend |
33ccb468 | 218 | |
d16e0461 | 219 | A.1.1. PipeBackend protocol |
33ccb468 | 220 | |
d16e0461 | 221 | A.2. MySQL backend |
33ccb468 | 222 | |
d16e0461 | 223 | A.2.1. Configuration settings |
33ccb468 | 224 | |
d16e0461 | 225 | A.2.2. Notes |
33ccb468 | 226 | |
d16e0461 | 227 | A.3. Random Backend |
33ccb468 | 228 | |
d16e0461 | 229 | A.4. MySQL PDNS backend |
33ccb468 | 230 | |
d16e0461 | 231 | A.4.1. Notes |
33ccb468 | 232 | |
d16e0461 | 233 | A.5. Generic MySQL and PgSQL backends |
33ccb468 | 234 | |
d16e0461 | 235 | A.5.1. MySQL specifics |
33ccb468 | 236 | |
d16e0461 | 237 | A.5.2. PostgresSQL specifics |
33ccb468 | 238 | |
d16e0461 | 239 | A.5.3. Basic functionality |
33ccb468 | 240 | |
d16e0461 | 241 | A.5.4. Master/slave queries |
33ccb468 | 242 | |
d16e0461 | 243 | A.5.5. Fancy records |
33ccb468 | 244 | |
d16e0461 | 245 | A.5.6. Settings and specifying queries |
33ccb468 | 246 | |
d16e0461 | 247 | A.5.7. Native operation |
33ccb468 | 248 | |
d16e0461 | 249 | A.5.8. Slave operation |
33ccb468 | 250 | |
d16e0461 | 251 | A.5.9. Superslave operation |
33ccb468 | 252 | |
d16e0461 | 253 | A.5.10. Master operation |
33ccb468 | 254 | |
d16e0461 | 255 | A.6. Generic Oracle backend |
33ccb468 | 256 | |
d16e0461 | 257 | A.6.1. Setting up Oracle for use with PowerDNS |
33ccb468 | 258 | |
d16e0461 | 259 | A.7. Generic SQLite backend |
33ccb468 | 260 | |
d16e0461 | 261 | A.7.1. Compiling the SQLite backend |
33ccb468 | 262 | |
d16e0461 | 263 | A.7.2. Setting up the database |
33ccb468 | 264 | |
d16e0461 | 265 | A.7.3. Using the SQLite backend |
33ccb468 | 266 | |
d16e0461 | 267 | A.8. DB2 backend |
33ccb468 | 268 | |
d16e0461 | 269 | A.9. Bind zone file backend |
33ccb468 | 270 | |
d16e0461 | 271 | A.9.1. Operation |
33ccb468 | 272 | |
d16e0461 | 273 | A.9.2. Pdns_control commands |
33ccb468 | 274 | |
d16e0461 | 275 | A.9.3. Performance |
33ccb468 | 276 | |
d16e0461 | 277 | A.9.4. Master/slave configuration |
33ccb468 | 278 | |
d16e0461 | 279 | A.9.5. Commands |
33ccb468 | 280 | |
d16e0461 | 281 | A.10. ODBC backend |
33ccb468 | 282 | |
d16e0461 | 283 | A.11. XDB Backend |
33ccb468 | 284 | |
d16e0461 | 285 | A.12. LDAP backend |
33ccb468 | 286 | |
d16e0461 | 287 | B. PDNS internals |
33ccb468 | 288 | |
d16e0461 | 289 | B.1. Controlsocket |
33ccb468 | 290 | |
d16e0461 | 291 | B.1.1. pdns_control |
33ccb468 | 292 | |
d16e0461 | 293 | B.2. Guardian |
33ccb468 | 294 | |
d16e0461 | 295 | B.3. Modules & Backends |
33ccb468 | 296 | |
d16e0461 | 297 | B.4. How PDNS translates DNS queries into backend queries |
33ccb468 | 298 | |
d16e0461 | 299 | C. Backend writers' guide |
33ccb468 | 300 | |
d16e0461 | 301 | C.1. Simple read-only native backends |
33ccb468 | 302 | |
d16e0461 | 303 | C.1.1. A sample minimal backend |
33ccb468 | 304 | |
d16e0461 | 305 | C.1.2. Interface definition |
33ccb468 | 306 | |
d16e0461 | 307 | C.2. Reporting errors |
33ccb468 | 308 | |
d16e0461 | 309 | C.3. Declaring and reading configuration details |
33ccb468 | 310 | |
d16e0461 | 311 | C.4. Read/write slave-capable backends |
33ccb468 | 312 | |
d16e0461 | 313 | C.4.1. Supermaster/Superslave capability |
33ccb468 | 314 | |
d16e0461 | 315 | C.5. Read/write master-capable backends |
33ccb468 | 316 | |
d16e0461 TP |
317 | D. Compiling PowerDNS |
318 | ||
319 | D.1. Compiling PowerDNS on Unix | |
320 | ||
321 | D.1.1. AIX | |
322 | ||
323 | D.1.2. FreeBSD | |
324 | ||
325 | D.1.3. Linux | |
326 | ||
327 | D.1.4. MacOS X | |
328 | ||
329 | D.1.5. OpenBSD | |
330 | ||
331 | D.1.6. Solaris | |
332 | ||
333 | D.2. Compiling PowerDNS on Windows | |
334 | ||
335 | D.2.1. Assumptions | |
336 | ||
337 | D.2.2. Prequisites | |
338 | ||
339 | D.2.3. Nullsoft Installer | |
340 | ||
341 | D.2.4. Setting up the build-environment | |
342 | ||
343 | D.2.5. Compilation | |
344 | ||
345 | D.2.6. Miscellaneous | |
346 | ||
347 | E. PowerDNS license (GNU General Public License version 2) | |
33ccb468 | 348 | |
349 | List of Tables | |
d16e0461 TP |
350 | |
351 | 17-1. SOA fields | |
352 | ||
353 | A-1. PipeBackend capabilities | |
354 | ||
355 | A-2. MySQL backend capabilities | |
356 | ||
357 | A-3. Random Backend capabilities | |
358 | ||
359 | A-4. MySQL backend capabilities | |
360 | ||
361 | A-5. Generic PgSQL and MySQL backend capabilities | |
362 | ||
363 | A-6. Oracle backend capabilities | |
364 | ||
365 | A-7. Generic SQLite backend capabilities | |
366 | ||
367 | A-8. DB2 backend capabilities | |
368 | ||
369 | A-9. Bind zone file backend capabilities | |
370 | ||
371 | A-10. ODBC backend capabilities | |
372 | ||
373 | A-11. LDAP backend capabilities | |
374 | ||
375 | C-1. DNSResourceRecord class | |
376 | ||
377 | C-2. SOAData struct | |
378 | ||
379 | C-3. DomainInfo struct | |
380 | ||
381 | ---------------------------------------------------------------------- | |
382 | ||
383 | Chapter 1. The PowerDNS dynamic nameserver | |
384 | ||
385 | The PowerDNS daemon is a versatile nameserver which supports a large | |
386 | number of backends. These backends can either be plain zonefiles or be | |
387 | more dynamic in nature. | |
388 | ||
389 | Prime examples of backends include relational databases, but also | |
390 | loadbalancing and failover algorithms. | |
391 | ||
392 | The company is called PowerDNS BV, the nameserver daemon is called PDNS. | |
393 | ||
394 | ---------------------------------------------------------------------- | |
33ccb468 | 395 | |
396 | 1.1. Function & design of PDNS | |
397 | ||
d16e0461 TP |
398 | PDNS is an authoritative only nameserver. It will answer questions about |
399 | domains it knows about, but will not go out on the net to resolve queries | |
400 | about other domains. However, it can use a recursing backend to provide | |
401 | that functionality. | |
33ccb468 | 402 | |
d16e0461 TP |
403 | When PDNS answers a question, it comes out of the database, and can be |
404 | trusted as being authoritative. There is no way to pollute the cache or to | |
405 | confuse the daemon. | |
33ccb468 | 406 | |
d16e0461 TP |
407 | PDNS has been designed to serve both the needs of small installations by |
408 | being easy to setup, as well as for serving very large query volumes on | |
409 | large numbers of domains. | |
33ccb468 | 410 | |
d16e0461 TP |
411 | Another prime goal is security. By the use of language features, the PDNS |
412 | source code is very small (in the order of 10.000 lines) which makes | |
413 | auditing easy. In the same way, library features have been used to | |
414 | mitigate the risks of buffer overflows. | |
33ccb468 | 415 | |
d16e0461 TP |
416 | Finally, PDNS is able to give a lot of statistics on its operation which |
417 | is both helpful in determining the scalability of an installation as well | |
418 | as for spotting problems. | |
419 | ||
420 | ---------------------------------------------------------------------- | |
33ccb468 | 421 | |
422 | 1.2. About this document | |
423 | ||
d16e0461 TP |
424 | If you are reading this document from disk, you may want to check |
425 | http://doc.powerdns.com for updates. The PDF version is available on | |
426 | http://doc.powerdns.com/pdf, a text file is on | |
427 | http://doc.powerdns.com/txt/. | |
428 | ||
429 | ---------------------------------------------------------------------- | |
33ccb468 | 430 | |
431 | 1.3. Release notes | |
432 | ||
d16e0461 TP |
433 | Before proceeding, it is advised to check the release notes for your PDNS |
434 | version, as specified in the name of the distribution file. | |
435 | ||
436 | ---------------------------------------------------------------------- | |
437 | ||
fc2fb8ea AG |
438 | 1.3.1. Version 2.9.16 |
439 | ||
440 | The 'it must still be Friday somewhere' release. Massive number of fixes, | |
441 | portability improvements and the new Geobackend by Mark Bergsma & friends. | |
442 | ||
443 | New: | |
444 | ||
445 | * The Geobackend which makes it possible to send different answers to | |
446 | different IP ranges. Initial documentation can be found in | |
447 | pdns/modules/geobackend/README. | |
448 | ||
449 | * qgen query generation tool. Nearly completely undocumented and hard to | |
450 | build too, it requires Boost. But very spiffy. Use cd pdns; make qgen | |
451 | to build it. | |
452 | ||
453 | Bugfixes: | |
454 | ||
455 | * The most reported bug ever, zone2sql required the inclusion of | |
456 | unistd.h, except on Debian unstable. | |
457 | ||
458 | * PowerDNS tried to listen on its control "pipe" which does not work. | |
459 | Probably harmless, but might have caused some oddities. | |
460 | ||
461 | * The Packet Cache did not always set its TTL immediately, causing some | |
462 | packets to be inserted, even when running with the cache disabled | |
463 | (Mark Bergsma). | |
464 | ||
465 | * Valgrind found some unitialized reads, causing bogus values in the | |
466 | priority field when it was not needed | |
467 | ||
468 | * Valgrind found a bug in MTasker where we used delete instead of | |
469 | delete[]. | |
470 | ||
471 | * SOA serials and other parameters are unsigned. This means that very | |
472 | large SOA serial numbers would be messed up (Michel Stol, Stefano | |
473 | Straus) | |
474 | ||
475 | * PowerDNS left its controlsocket around after exit and reported | |
476 | confusing errors if a socket was already in use. | |
477 | ||
478 | * The recursor proxy did not work on big endian systems like SPARC and | |
479 | some MIPS processors (Remco Post) | |
480 | ||
481 | * We no longer dump core on processing LOC records on UltraSPARC (Andrew | |
482 | Mulholland supplied a testing machine) | |
483 | ||
484 | Improvements: | |
485 | ||
486 | * MySQL can now connect to a specified port again (Chris Anderton) | |
487 | ||
488 | * When running chroot()ed and with master or slave support active, | |
489 | PowerDNS needs to resolve domain names to find slaves. This in turn | |
490 | may require access to certain libraries. Previously, these needed to | |
491 | be available in the chroot directory but by forcing an initial lookup, | |
492 | these libraries are now loaded before the chrooting. | |
493 | ||
494 | * pdns_recursor was very slow after having done a larger number of | |
495 | queries because of the checks to see if a query should be throttled. | |
496 | This is now done using a set which is a lot faster than the previous | |
497 | full sequential scan. | |
498 | ||
499 | * The throttling code may not have throttled as much as was configured. | |
500 | ||
501 | * Yet another big LDAP update. The LDAP backend now loadbalances | |
502 | connections over several hosts (Norbert Sendetzky) | |
503 | ||
504 | * Updated b.root-servers.net address in the recursor | |
505 | ||
506 | ---------------------------------------------------------------------- | |
507 | ||
508 | 1.3.2. Version 2.9.15 | |
509 | ||
510 | This release fixes up some of the shortcomings in 2.9.14, and adds some | |
511 | new features too. | |
512 | ||
513 | Bugfixes: | |
514 | ||
515 | * allow-recursion-override was on by default, it was meant to be off. | |
516 | ||
517 | * Logging was still off in daemon mode, fixed. | |
518 | ||
519 | * debian/rules forgot to build an sqllite package | |
520 | ||
521 | * Recursor accidentally linked in MySQL - this was the result of an | |
522 | experiment with a persistent recursor cache. | |
523 | ||
524 | * The PowerDNS recursor had stability problems. It now sorts nameservers | |
525 | (roughly) by responsiveness. The 'roughly' part upset the sorting | |
526 | algorithm used, the speeds being sorted on changed during sorting. | |
527 | ||
528 | * The recursor now outputs the nameserver average response times in | |
529 | trace mode | |
530 | ||
531 | * LDAP compiles again. | |
532 | ||
533 | Improvements: | |
534 | ||
535 | * zone2sql can now accept - as a filename which causes it to read stdin. | |
536 | This allows the following to work: dig axfr ds9a.nl | zone2sql | |
537 | --gmysql --zone=- | mysql pdns, which is a nice way to import a zone. | |
538 | ||
539 | * zone2sql now ignores duplicate SOA records which are identical - which | |
540 | also makes the above possible. | |
541 | ||
542 | * Remove libpqpp dependencies - since we now use the native C API for | |
543 | PostgreSQL | |
544 | ||
545 | ---------------------------------------------------------------------- | |
546 | ||
547 | 1.3.3. Version 2.9.14 | |
548 | ||
549 | Big release with the fix for the all important 2^30 seconds problem and a | |
550 | lot of other news. | |
551 | ||
552 | * errno problems would cause compilation problems when using LDAP | |
553 | (Norbert Sendetzky) | |
554 | ||
555 | * The Generic SQL backend could cause crashes on PostgreSQL when using | |
556 | pdns_control notify (Georg Bauer) | |
557 | ||
558 | * Debian compatible init.d script (Wichert Akkerman) | |
559 | ||
560 | * If using the master or slave features, pdns had the notion of eternity | |
561 | ending in 2038, except that due to a thinko, eternity ended out to be | |
562 | the 10th of January 2004. This caused a loop to timeout immediately. | |
563 | Many thanks to Jasper Spaans for spotting the bug within five minutes. | |
564 | ||
565 | * Parts of the SOA field were not cannonicalized | |
566 | ||
567 | * The loglevel could in fact cause nothing to be logged (Norbert | |
568 | Sendetzky) | |
569 | ||
570 | Improvements: | |
571 | ||
572 | * The recursor now chooses the fastest nameserver, which causes a big | |
573 | speedup! | |
574 | ||
575 | * LDAP now has different lookup models | |
576 | ||
577 | * Cleanups, better load distribution, better exception handling, | |
578 | zone2ldap improvements | |
579 | ||
580 | * The recursor was somewhat chatty about TCP connections | |
581 | ||
582 | * PostgreSQL now only depends on the C API and not on the deprecated C++ | |
583 | one | |
584 | ||
585 | * PowerDNS can now fully overrule external zones when doing recursion. | |
586 | See Chapter 11. | |
587 | ||
588 | ---------------------------------------------------------------------- | |
589 | ||
590 | 1.3.4. Version 2.9.13 | |
d16e0461 TP |
591 | |
592 | Big news! Windows is back! Our great friend Michel Stol found the time to | |
593 | update the PowerDNS code so it works again under windows. | |
594 | ||
595 | Furthermore, big thanks go out to Dell who quickly repaired my trusty | |
596 | laptop. | |
597 | ||
598 | His changes: | |
599 | ||
600 | * Generic SQLite support added | |
601 | ||
602 | * Removed the ODBC backend, replaced it by the Generic ODBC Backend, | |
603 | which has all the cool configurability of the Generic MySQL and | |
604 | PostgreSQL backends. | |
605 | ||
606 | * The PowerDNS Recursor now runs as a Service. It defaults to running on | |
607 | port 5300, PowerDNS itself is configured to expect the Recursor on | |
608 | port 5300 now. | |
609 | ||
610 | * The PowerDNS Service is now known as 'PowerDNS' to Windows. | |
611 | ||
612 | * The Installer was redone, this time with NSIS2. | |
613 | ||
614 | * General updates and fixes. | |
615 | ||
616 | Other news: | |
617 | ||
618 | Note There appears to be a problem with PowerDNS on Red Hat 7.3 with GCC | |
619 | 2.96 and self-compiled binaries. The symptoms are that PowerDNS works | |
620 | on the foreground but fails as a daemon. We're working on it. | |
621 | ||
622 | If you do note problems, let the list know, if you don't, please do | |
623 | so as well. Tell us if you use the RPM or compiled yourself. | |
624 | ||
625 | It is known that not compiling in MySQL support helps solve the | |
626 | problem, but then you don't have MySQL. | |
627 | ||
628 | There have been a number of reports on MySQL connections being dropped on | |
629 | FreeBSD 4.x, which sometimes causes PowerDNS to give up and reload itself. | |
630 | To combat this, MySQL error messages have been improved in some places in | |
631 | hopes of figuring out what is up. The initial indication is that MySQL | |
632 | itself sometimes terminates the connection and, amazingly, that switching | |
633 | to a Unix domain socket instead of TCP solves the problem. | |
634 | ||
635 | Bug fixes: | |
636 | ||
637 | * allow-axfr-ips did not work for individual IP addresses (bug & fix by | |
638 | Norbert Sendetzky) | |
639 | ||
640 | Improvements: | |
641 | ||
642 | * Opteron support! Thanks to Jeff Davey for providing a shell on an | |
643 | Opteron. The fixes should also help PowerDNS on other platforms with a | |
644 | 64 bit userspace. | |
645 | ||
646 | Btw, the PowerDNS team has a strong desire for an Opteron :-) | |
647 | ||
648 | * pdns_recursor jumbles answers now. This means that you can do poor | |
649 | man's roundrobin by supplying multiple A, MX or AAAA records for a | |
650 | service, and get a random one on top each time. Interestingly, this | |
651 | feature appeared out of nowhere, this change was made to the | |
652 | authoritative code but due to the wonders of code-reuse had an effect | |
653 | on pdns_recursor too. | |
654 | ||
655 | * Big LDAP cleanup. Support for TLS was added. Zone2LDAP also gained the | |
656 | ability to generate ldif files containing a tree or a list of entries. | |
657 | (Norbert Sendetzky) | |
658 | ||
659 | * Zone2sql is now somewhat clearer when reporting malformed line errors | |
660 | - it did not always include the name of the file causing a problem, | |
661 | especially for big installations. Problem noted by Thom May. | |
662 | ||
663 | * pdns_recursor now survives the expiration of all its root records, | |
664 | most often caused by prolonged disconnection from the net. | |
665 | ||
666 | ---------------------------------------------------------------------- | |
667 | ||
fc2fb8ea | 668 | 1.3.5. Version 2.9.12 |
d16e0461 TP |
669 | |
670 | Release rich in features. Work on Verisign oddities, addition of SQLite | |
671 | backend, pdns_recursor maturity. | |
672 | ||
673 | New features: | |
674 | ||
675 | * --version command (requested by Mike Benoit) | |
676 | ||
677 | * delegation-only, a Verisign special. See Section 12.1.1. | |
678 | ||
679 | * Generic SQLite support, by Michel 'Who da man?' Stol. See Section A.7. | |
680 | ||
681 | * init.d script for pdns_recursor | |
682 | ||
683 | * Recursor now actually purges its cache, saving memory. | |
684 | ||
685 | * Slave configuration now no longer falls over when presented with a | |
686 | NULL master | |
687 | ||
688 | * Bindbackend2 now has supermaster support (Mark Bergsma, untested) | |
689 | ||
690 | * Answers are now shuffled! It turns out a few recursors don't do | |
691 | shuffling (pdns_recursor, djbdns), so we do it now. Requested by Jorn | |
692 | Ekkelenkamp of ISP-Services. This means that if you have multiple IP | |
693 | addresses for one host, they will be returned in differing order every | |
694 | once in a while. | |
695 | ||
696 | Bugs: | |
697 | ||
698 | * 0.0.0.0/0 didn't use to work (Norbert Sendetzky) | |
699 | ||
700 | * pdns_recursor would try to resolve IP address which to bind to, | |
701 | potentially causing chicken/egg problem | |
702 | ||
703 | * gpgsql no longer reports as gmysql (Sherwin Daganoto) | |
704 | ||
705 | * SRV would not be parsed right from disk (Christof Meerwald) | |
706 | ||
707 | * An AXFR from a zone hosted on the LDAP backend no longer transmits all | |
708 | the reverse entries too (Norbert Sendetzky) | |
709 | ||
710 | * PostgreSQL backend now does error checking. It would be a bit too | |
711 | trusting before. | |
712 | ||
713 | Improvements, cleanups: | |
714 | ||
715 | * PowerDNS now reports the numerical IP addresses it binds to instead of | |
716 | the, possibly, alphanumeric names the operator passed. | |
33ccb468 | 717 | |
d16e0461 | 718 | * Removed only-soa hackery (noticed by Norbert Sendetzky) |
33ccb468 | 719 | |
d16e0461 | 720 | * Debian packaging fixes (Wichert Akkerman) |
33ccb468 | 721 | |
d16e0461 | 722 | * Some parameter descriptions were improved. |
33ccb468 | 723 | |
d16e0461 TP |
724 | * Cleanups by Norbert: getAuth moved to chopOff, arguments::contains |
725 | massive cleanup, more. | |
33ccb468 | 726 | |
d16e0461 | 727 | ---------------------------------------------------------------------- |
33ccb468 | 728 | |
fc2fb8ea | 729 | 1.3.6. Version 2.9.11 |
33ccb468 | 730 | |
d16e0461 TP |
731 | Yet another iteration, hopefully this will be the last silly release. |
732 | ||
733 | Warning There has been a change in behaviour whereby disable-axfr does | |
734 | what it means now! From now on, setting allow-axfr-ips | |
735 | automatically disables AXFR from unmentioned subnets. | |
736 | ||
737 | This release enables AXFR again, disable-axfr did the opposite of what it | |
738 | claimed. Furthermore, the pdns_recursor now cleans its cache, which should | |
739 | save some memory in the long run. Norbert contributed some small LDAP work | |
740 | which should come in useful in the future. | |
741 | ||
742 | ---------------------------------------------------------------------- | |
743 | ||
fc2fb8ea | 744 | 1.3.7. Version 2.9.10 |
d16e0461 TP |
745 | |
746 | Small bugfixes, LDAP update. Released 3rd of July 2003. Apologies for the | |
747 | long delay, real life keeps interfering. | |
748 | ||
749 | Warning Do not use or try to use 2.9.9, it was a botched release! | |
750 | ||
751 | Warning There has been a change in behaviour whereby disable-axfr does | |
752 | what it means now! From now on, setting allow-axfr-ips | |
753 | automatically disables AXFR from unmentioned subnets. | |
754 | ||
755 | * 2.9.8 was prone to crash on adding additional records. Thanks to | |
756 | excellent debugging by PowerDNS users worldwide, the bug was found | |
757 | quickly and is in fact present in all earlier PowerDNS releases, but | |
758 | for some reason doesn't cause crashes there. | |
759 | ||
760 | * Notifications now jump in front of the queue of domains that need to | |
761 | be checked for changes, giving much greater perceived performance. | |
762 | This is needed if you have tens of thousands of slave domains and your | |
763 | master server is on a high latency link. Thanks to Mark Jeftovic of | |
764 | EasyDNS for suggesting this change and testing it on their platform. | |
765 | ||
766 | * Dean Mills reported that PowerDNS does confusing logging about | |
767 | changing GIDs and UIDs, fixed. Cosmetic only. | |
768 | ||
769 | * pdns_recursor may have logged empty lines for some users, fixed. | |
770 | Solution suggested by Norbert Sendetzky. | |
771 | ||
772 | * LDAP: DNS TTLs were random values (Norbert Sendetzky, Stefan | |
773 | Pfetzing). New ldap-default-ttl option. | |
774 | ||
775 | * LDAP: Now works with OpenLDAP 2.1 (Norbert Sendetzky) | |
776 | ||
777 | * LDAP: error handling for invalid MX records implemented (Norbert | |
778 | Sendetzky) | |
779 | ||
780 | * LDAP: better exception handling (Norbert Sendetzky) | |
781 | ||
782 | * LDAP: code cleanup of lookup() (Norbert Sendetzky) | |
783 | ||
784 | * LDAP: added support for scoped searches (Norbert Sendetzky) | |
785 | ||
786 | ---------------------------------------------------------------------- | |
787 | ||
fc2fb8ea | 788 | 1.3.8. Version 2.9.8 |
d16e0461 TP |
789 | |
790 | Queen's day release! 30th of April 2003. | |
791 | ||
792 | Added support for AIX, fixed negative SOA caching. Some other cleanups. | |
793 | Not a major release but enough reasons to upgrade. | |
794 | ||
795 | Bugs fixed: | |
796 | ||
797 | * Recursor had problems expiring negatively cached entries, which wasted | |
798 | memory and also led to the continued non-existence of hosts that since | |
799 | had come into existence. | |
800 | ||
801 | * The Generic SQL backends did not lowercase the names of records, which | |
802 | led to new records not being found by case sensitive databases | |
803 | (notably PostgreSQL). Found by Volker Goetz. | |
804 | ||
805 | * NS queries for zones for which we did not carry authority, but only | |
806 | had delegation information, had their NS records in the wrong section. | |
807 | Minor detail, but a standards violation on etheless. Spotted by | |
808 | Stephane Bortzmeyer. | |
809 | ||
810 | Improvements: | |
811 | ||
812 | * Removed crypt.h dependency from powerldap.hh, which was a problem on | |
813 | some platforms (Richard Arends) | |
814 | ||
815 | * PowerDNS can't parse so called binary labels which we now detect and | |
816 | ignore, after printing a warning. | |
817 | ||
818 | * Specifying allow-axfr-ips now automatically disables AXFR for all | |
819 | non-mentioned addresses. | |
820 | ||
821 | * A Solaris ready init.d script is now part of the tar.gz (contributed, | |
822 | but I lost by whom). | |
823 | ||
824 | * Added some fixes to PowerDNS can work on AIX (spotted by Markus | |
825 | Heimhilcher). | |
826 | ||
827 | * Norbert Sendetzky contributed zone2ldap. | |
828 | ||
829 | * Everybody's favorite compiler warning from zone2sql.cc was removed! | |
830 | ||
831 | * Recursor now listens on TCP! | |
832 | ||
833 | ---------------------------------------------------------------------- | |
834 | ||
fc2fb8ea | 835 | 1.3.9. Version 2.9.7 |
d16e0461 TP |
836 | |
837 | Released on 2003-03-20. | |
838 | ||
839 | This is a sweeping release in the sense of cleanup. There are some new | |
840 | features but mostly a lot of cleanup going on. Hiding inside is the | |
841 | bind2backend, the next generation of the bind backend. A work in progress. | |
842 | Those of you with overlapping zones, as mentioned in the changelog of | |
843 | 2.9.6, are invited to check it out by replacing launch=bind by | |
844 | launch=bind2 and renaming all bind- parameters to bind2-. Be aware that if | |
845 | you run with many small zones, this backend is faster, but if you run with | |
846 | a few large ones, it is slower. This will improve. | |
847 | ||
848 | Features: | |
849 | ||
850 | * Mark Bergsma contributed query-local-address which allows the operator | |
851 | to select which source address to use. This is useful on servers with | |
852 | multiple source addresses and the operating system selecting an | |
853 | unintended one, leading to remotes denying access. | |
854 | ||
855 | * PowerDNS can now perform AAAA additional processing optionally, turned | |
856 | on by setting do-ipv6-additional-processing. Thanks to Stephane | |
857 | Bortzmeyer for pointing out the need. | |
858 | ||
859 | * Bind2backend, which is almost in compliance with the new IETF | |
860 | AXFR-clarify (some would say 'redefinition') draft. | |
861 | ||
862 | This backend is not ready for primetime but you may want to try it if | |
863 | you currently have overlapping zones and note problems. An overlapping | |
864 | zone would be having "ipv6.powerdns.com" and "powerdns.com" zones on | |
865 | one server. | |
866 | ||
867 | Improvements: | |
868 | ||
869 | * Zone2sql would happily try to read from a directory and not give a | |
870 | useful error about this. | |
871 | ||
872 | * PowerDNS now reports the case where it can't figure out any IP address | |
873 | of slave nameservers for a zone | |
874 | ||
875 | * Removed receiver-threads setting which was experimental and in fact | |
876 | only made things worse. | |
877 | ||
878 | * LDAP backend updates from its author Norbert Sendetzky. Reverse | |
879 | lookups should work now too. | |
880 | ||
881 | * An error message about unparseable packets did not include the | |
882 | originating IP address (fixed by Mark Bergsma) | |
883 | ||
884 | * PowerDNS can now be started via path resolution while running with a | |
885 | guardian. Suggested by Maurice Nonnekes. | |
886 | ||
887 | * pdns_recursor moved to sbin (reported by Norbert Sendetzky) | |
888 | ||
889 | * Retuned some logger errorlevels, a lot of master/slave chatter was | |
890 | logged as 'Error'. Reported by Willem de Groot. | |
891 | ||
892 | Bugs fixed: | |
893 | ||
894 | * zone2sql did not remove trailing dots in SOA records. | |
895 | ||
896 | * ldapbackend did not include utility.hh which caused compilation | |
897 | problems on Solaris (reported by Remco Post) | |
898 | ||
899 | * pdns_control could leave behind remnants in case PowerDNS was not | |
900 | running (reported by dG) | |
901 | ||
902 | * Incoming AXFR did not work on Solaris and other big-endian systems | |
903 | (Willem de Groot helped debugging this long standing problem). | |
904 | ||
905 | * Recursor could crash on convoluted CNAME loops. Thanks to Dan Faerch | |
906 | for delivering coredumps. | |
907 | ||
908 | * Silly 'wuh' debugging output in zone2sql and bindbackend removed | |
909 | (spotted by Ivo van der Wijk) | |
910 | ||
911 | * Recursor neglected to differentiate between negative cache of NXDOMAIN | |
912 | and NOERROR, leading to problems with IPv6 enabled Windows clients. | |
913 | Thanks to Stuart Walsh for reporting this and testing the fix. | |
914 | ||
915 | * PowerDNS set the 'aa' bit on serving NS records in a zone for which it | |
916 | was authoritative. Most implementations drop the 'aa' bit in this case | |
917 | and Stephane Bortzmeyer informed us of this. PowerDNS now also drops | |
918 | the 'aa' bit in this case. | |
919 | ||
920 | * The webserver tended to fail after prolonged operation on FreeBSD, | |
921 | this was due to an uninitialised timeout, other platforms were lucky. | |
922 | Thanks to G.P. de Boer for helping debug this. | |
923 | ||
924 | * getAnswers() in dnspacket.cc could be forced to read bytes beyond the | |
925 | end of the packet, leading to crashes in the PowerDNS recursor. This | |
926 | is an ongoing project that needs more work. Reported by Dan Faerch, | |
927 | with a coredump proving the problem. | |
928 | ||
929 | ---------------------------------------------------------------------- | |
930 | ||
fc2fb8ea | 931 | 1.3.10. Version 2.9.6 |
d16e0461 TP |
932 | |
933 | Two new backends - Generic ODBC (windows only) and LDAP. Furthermore, a | |
934 | few important bugs have been fixed which may have hampered sites seeing a | |
935 | lot of outgoing zonetransfers. Additionally, the pdns recursor now has | |
936 | 'query throttling' which is pretty cool. In short this makes sure that | |
937 | PowerDNS does not send out heaps of queries if a nameserver is unable to | |
938 | provide an answer. Many operators of authoritative setups are all too | |
939 | aware of recursing nameservers that hammer them for zones they don't have, | |
940 | PowerDNS won't do that anymore now, no matter what clients request of it. | |
941 | ||
942 | Warning There is an unresolved issue with the BIND backend and | |
943 | 'overlapping' slave zones. So if you have 'example.com' and also | |
944 | have a separate slave zone called 'external.example.com', things | |
945 | may go wrong badly. Thanks to Christian Laursen for working with | |
946 | us a lot in finding this issue. We hope to resolve it soon. | |
947 | ||
948 | * BIND Backend now honours notifies, code to support this was | |
949 | accidentally left out. Thanks to Christian Laursen for noticing this. | |
950 | ||
951 | * Massive speedup for those of you using the slightly deprecated MBOXFW | |
952 | records. Thanks to Jorn of ISP Services for helping and testing this | |
953 | improvement. | |
954 | ||
955 | * $GENERATE had an off-by-one bug where it would omit the last record to | |
956 | be generated (Christian Laursen) | |
957 | ||
958 | * Simultaneous AXFRs may have been problematic on some backends. Thanks | |
959 | to Jorn of ISP-Services again for helping us resolve this issue. | |
960 | ||
961 | * Added LDAP backend by Norbert Sendetzky, see Section A.12. | |
962 | ||
963 | * Added Generic ODBC backend for Windows by Michel Stol. | |
964 | ||
965 | * Simplified 'out of zone data' detection in incoming AXFR support, | |
966 | hopefully removing a case sensitivity bug there. Thanks again to | |
967 | Christian Laursen for reporting this issue. | |
968 | ||
969 | * $include in-zonefile was broken under some circumstances, losing the | |
970 | last character of a filename. Thanks to Joris Vandalon for noticing | |
971 | this. | |
972 | ||
973 | * The zoneparser was more case-sensitive than BIND, refusing to accept | |
974 | 'in' as well as 'IN'. Thanks to Joris Vandalon for noticing this. | |
975 | ||
976 | ---------------------------------------------------------------------- | |
977 | ||
fc2fb8ea | 978 | 1.3.11. Version 2.9.5 |
d16e0461 TP |
979 | |
980 | Released on 2002-02-03. | |
981 | ||
982 | This version is almost entirely about recursion with major changes to both | |
983 | the pdns recursor, which is renamed to 'pdns_recursor' and to the main | |
984 | PowerDNS binary to make it interact better with the recursing component. | |
985 | ||
986 | Sadly, due to technical reasons, compiling the pdns recursor and pdns | |
987 | authoritative nameserver into one binary is not immediately possible. | |
988 | During the release of 2.9.4 we stated that the recursing nameserver would | |
989 | be integrated in the next release - this won't happen now. | |
990 | ||
991 | However, this turns out to not be that bad at all. The recursor can now be | |
992 | restarted without having to restart the rest of the nameserver, for | |
993 | example. Cooperation between the both halves of PDNS is also almost | |
994 | seamless. As a result, 'non-lazy recursion' has been dropped. See Chapter | |
995 | 11 for more details. | |
996 | ||
997 | Furthermore, the recursor only works on Linux, Windows and Solaris (not | |
998 | entirely). FreeBSD does not support the required functions. If you know | |
999 | any important FreeBSD people, plea with them to support | |
1000 | set/get/swapcontext! Alternatively, FreeBSD coders could read the solution | |
1001 | presented here in figure 5. | |
1002 | ||
1003 | The 'Contributor of the Month' award goes to Mark Bergsma who has | |
1004 | responded to our plea for help with the label compressor and contributed a | |
1005 | wonderfully simple and right fix that allows PDNS to compress just as well | |
1006 | as Other namerervers out there. An honorary mention goes to Ueli Heuer | |
1007 | who, despite having no C++ experience, submitted an excellent SRV record | |
1008 | implementation. | |
1009 | ||
1010 | Excellent work was also performed by Michel Stol, the Windows guy, in | |
1011 | fixing all our non-portable stuff again. Christof Meerwald has also done | |
1012 | wonderful work in porting MTasker to Windows, which was then used by | |
1013 | Michel to get the recursor functioning on Windows. | |
1014 | ||
1015 | Other changes: | |
1016 | ||
1017 | * dnspacket.cc was cleaned up by factoring out common operations | |
1018 | ||
1019 | * Heaps of work on the recursing nameserver. Has now achieved *days* of | |
1020 | uptime! | |
1021 | ||
1022 | * Recursor renamed from syncres to pdns_recursor | |
1023 | ||
1024 | * PowerDNS can now serve records it does not know about. To benefit from | |
1025 | this slightly undocumented feature, add 1024 to the numerical type of | |
1026 | a record and include the record in binary form in your database. Used | |
1027 | internally by the recursing nameserver but you can use it too. | |
1028 | ||
1029 | * PowerDNS now knows about SIG and KEY records *names*. It does not | |
1030 | support them yet but can at least report so now. | |
1031 | ||
1032 | * HINFO records can now be transferred from a master to PowerDNS (thanks | |
1033 | to Ueli Heuer for noticing it didn't work). | |
1034 | ||
1035 | * Yet more UltraSPARC alignment issues fixed (Chris Andrews). | |
1036 | ||
1037 | * Dropped non-lazy recursion, nobody was using it. Lazy recursion became | |
1038 | even more lazy after Dan Bernstein pointed out that additional | |
1039 | processing is not vital, so PowerDNS does its best to do additional | |
1040 | processing on recursive queries, but does not scream murder if it does | |
1041 | not succeed. Due to caching, the next identical query will be | |
1042 | successfully additionally processed. | |
1043 | ||
1044 | * Label compression was improved so we can now fit all . records in 436 | |
1045 | bytes, this used to be 460! (Code & formal proof of correctness by | |
1046 | Mark Bergsma). | |
1047 | ||
1048 | * SRV support (incoming and outgoing), submitted by Ueli Heuer. | |
1049 | ||
1050 | * Generic backends do not support SOA serial autocalculation, it | |
1051 | appears. Could lead to random SOA serials in case of a serial of 0 in | |
1052 | the database. Fixed so that 0 stays zero in that case. Don't set the | |
1053 | SOA serial to 0 when using Generic MySQL or Generic PostgreSQL! | |
1054 | ||
1055 | * J root-server address was updated to its new location. | |
1056 | ||
1057 | * SIGUSR1 now forces the recursor to print out statistics to the log. | |
1058 | ||
1059 | * Meaning of recursor logging was changed a bit - a cache hit is now a | |
1060 | question that was answered with 0 outgoing packets needed. Used to be | |
1061 | a weighted average of internal cache hits. | |
1062 | ||
1063 | * MySQL compilation did not include -lz which causes problems on some | |
1064 | platforms. Thanks to James H. Cloos Jr for reporting this. | |
1065 | ||
1066 | * After a suggestion by Daniel Meyer and Florus Both, the built in | |
1067 | webserver now reports the configuration name when multiple PowerDNS | |
1068 | instances are active. | |
1069 | ||
1070 | * Brad Knowles noticed that zone2sql had problems with the root.zone, | |
1071 | fixed. This also closes some other zone2sql annoyances with converting | |
1072 | single zones. | |
1073 | ||
1074 | ---------------------------------------------------------------------- | |
1075 | ||
fc2fb8ea | 1076 | 1.3.12. Version 2.9.4 |
d16e0461 TP |
1077 | |
1078 | Yet another grand release. Big news is the addition of a recursing | |
1079 | nameserver which has sprung into existence over the past week. It is in | |
1080 | use on several computers already but it is not ready for prime time. | |
1081 | Complete integration with PowerDNS is expected around 2.9.5, for now the | |
1082 | recursor is a separate program. | |
1083 | ||
1084 | In preliminary tests, the recursor appears to be four times faster than | |
1085 | BIND 9 on a naive benchmark starting from a cold cache. BIND 9 managed to | |
1086 | get through to some slower nameservers however, which were given up on by | |
1087 | PowerDNS. We will continue to tune the recursor. See Chapter 12 for | |
1088 | further details. | |
1089 | ||
1090 | The BIND Backend has also been tested (see the bind-domain-status item | |
1091 | below) rather heavily by several parties. After some discussion online, | |
1092 | one of the BIND authors ventured that the newsgroup | |
1093 | comp.protocols.dns.bind may now in fact be an appropriate venue for | |
1094 | discussing PowerDNS. Since this discussion, traffic to the PowerDNS pages | |
1095 | has increased sixfold and shows no signs of slowing down. | |
1096 | ||
1097 | From this, it is apparent that far more people are interested in PowerDNS | |
1098 | than yet know about it. So spread the word! | |
1099 | ||
1100 | In other news, we now have a security page at Section 1.4. Furthermore, | |
1101 | Maurice Nonnekes contributed an OpenBSD port! See his page for more | |
1102 | details! | |
1103 | ||
1104 | New features and improvements: | |
33ccb468 | 1105 | |
1106 | * All SQL queries in the generic backends are now available for | |
d16e0461 TP |
1107 | configuration. (Martin Klebermass/bert hubert). See Section A.5. |
1108 | ||
1109 | * A recursing nameserver! See Chapter 12. | |
1110 | ||
33ccb468 | 1111 | * An incoming AXFR now only starts a backend zone replacement |
d16e0461 TP |
1112 | transaction after the first record arrived successfully, thus making |
1113 | sure no work is done when a remote nameserver is unable/unwilling to | |
1114 | AXFR a zone to us. | |
1115 | ||
1116 | * Zoneparser error messages were improved slightly (thanks to Stef van | |
1117 | Dessel for spotting this shortcoming) | |
1118 | ||
1119 | * XS4ALL's Erik Bos checked how PowerDNS reacted to a BIND installation | |
1120 | with almost 60.000 domains, some of which with >100.000 records, and | |
1121 | he discovered the pdns_control bind-domain-status command became very | |
1122 | slow with larger numbers of domains. Fixed, 60.000 domains are now | |
1123 | listed in under one second. | |
1124 | ||
1125 | * If a remote nameserver disconnects during an incoming AXFR, the update | |
1126 | is now rolled back, unless the AXFR was properly terminated. | |
1127 | ||
33ccb468 | 1128 | * The migration chapter mentioned the use of deprecated backends. |
1129 | ||
1130 | A tremendous number of bugs were discovered and fixed: | |
1131 | ||
1132 | * Zone parser would only accept $include and not $INCLUDE | |
d16e0461 | 1133 | |
33ccb468 | 1134 | * Zone parser had problems with $lines with comments on the end |
d16e0461 TP |
1135 | |
1136 | * Wildcard ANY queries were broken (thanks Colemarcus for spotting this) | |
1137 | ||
33ccb468 | 1138 | * A connection failure with the Generic backends would lead to a |
1139 | powerdns reload (cast of many) | |
d16e0461 | 1140 | |
33ccb468 | 1141 | * Generic backends had some semantic problems with slave support. |
d16e0461 TP |
1142 | Symptoms were oft-repeated notifications and transfers (thanks to Mark |
1143 | Bergsma for helping resolve this). | |
1144 | ||
1145 | * Solaris version compiles again. Thanks to Mohamed Lrhazi for reporting | |
1146 | that it didn't. | |
1147 | ||
1148 | * Some UltraSPARC alignment fixes. Thanks to Mohamed Lrhazi for being | |
1149 | helpful in spotting these. One problem is still outstanding, Mohamed | |
1150 | sent a core dump that tells us where the problem is. Expect the fix to | |
1151 | be in 2.9.5. Volunteers can grep the source for 'UltraSPARC' to find | |
1152 | where the problem is. | |
1153 | ||
1154 | * Our support of IPv6 on FreeBSD had phase of moon dependent bugs, fixed | |
1155 | by Peter van Dijk. | |
1156 | ||
1157 | * Some crashes of and by pdns_control were fixed, thanks to Mark Bergsma | |
1158 | for helping resolve these. | |
1159 | ||
1160 | * Outgoing AXFR in pdns installations with multiple loaded backends was | |
1161 | broken (thanks to Stuart Walsh for reporting this). | |
1162 | ||
33ccb468 | 1163 | * A failed BIND Backend incoming AXFR would block the zone until it |
1164 | succeeded again. | |
d16e0461 TP |
1165 | |
1166 | * Generic PostgreSQL backend wouldn't compile with newer libpq++, fixed | |
1167 | by Julien Lemoine/SpeedBlue. | |
1168 | ||
33ccb468 | 1169 | * Potential bug (not observed) when listening on multiple interfaces |
1170 | fixed. | |
d16e0461 | 1171 | |
33ccb468 | 1172 | * Some typos in manpages fixed (reported by Marco Davids). |
33ccb468 | 1173 | |
d16e0461 | 1174 | ---------------------------------------------------------------------- |
33ccb468 | 1175 | |
fc2fb8ea | 1176 | 1.3.13. Version 2.9.3a |
33ccb468 | 1177 | |
d16e0461 | 1178 | Note 2.9.3a is identical to 2.9.3 except that zone2sql does work |
33ccb468 | 1179 | |
d16e0461 TP |
1180 | Broad range of huge improvements. We now have an all-static .rpm and .deb |
1181 | for Linux users and a a link to an OpenBSD port. Major news is that work | |
1182 | on the Bind backend has progressed to the point that we've just retired | |
1183 | our last Bind server and replaced it with PowerDNS in Bind mode! This | |
1184 | server is operating a number of master and slave setups so it should | |
1185 | stress the Bind backend somewhat. | |
33ccb468 | 1186 | |
1187 | This version is rapidly approaching the point where it is a | |
d16e0461 TP |
1188 | better-Bind-than-Bind and nearly a drop-in replacement for authoritative |
1189 | setups. PowerDNS is now equipped with a powerful master/slave apparatus | |
1190 | that offers a lot of insight and control to the user, even when operating | |
1191 | from Bind zonefiles and a Bind configuration. Observe. | |
33ccb468 | 1192 | |
1193 | After the SOA of ds9a.nl was raised: | |
33ccb468 | 1194 | |
d16e0461 TP |
1195 | pdns[17495]: All slave domains are fresh |
1196 | pdns[17495]: 1 domain for which we are master needs notifications | |
1197 | pdns[17495]: Queued notification of domain 'ds9a.nl' to 195.193.163.3 | |
1198 | pdns[17495]: Queued notification of domain 'ds9a.nl' to 213.156.2.1 | |
1199 | pdns[17520]: AXFR of domain 'ds9a.nl' initiated by 195.193.163.3 | |
1200 | pdns[17520]: AXFR of domain 'ds9a.nl' to 195.193.163.3 finished | |
1201 | pdns[17521]: AXFR of domain 'ds9a.nl' initiated by 213.156.2.1 | |
1202 | pdns[17521]: AXFR of domain 'ds9a.nl' to 213.156.2.1 finished | |
1203 | pdns[17495]: Removed from notification list: 'ds9a.nl' to 195.193.163.3 (was acknowledged) | |
1204 | pdns[17495]: Removed from notification list: 'ds9a.nl' to 213.156.2.1 (was acknowledged) | |
1205 | pdns[17495]: No master domains need notifications | |
1206 | ||
33ccb468 | 1207 | |
1208 | If however our slaves would ignore us, as some are prone to do, we can | |
1209 | send some additional notifications: | |
33ccb468 | 1210 | |
d16e0461 TP |
1211 | $ sudo pdns_control notify ds9a.nl |
1212 | Added to queue | |
1213 | pdns[17492]: Notification request for domain 'ds9a.nl' received | |
1214 | pdns[17492]: Queued notification of domain 'ds9a.nl' to 195.193.163.3 | |
1215 | pdns[17492]: Queued notification of domain 'ds9a.nl' to 213.156.2.1 | |
1216 | pdns[17495]: Removed from notification list: 'ds9a.nl' to 195.193.163.3 (was acknowledged) | |
1217 | pdns[17495]: Removed from notification list: 'ds9a.nl' to 213.156.2.1 (was acknowledged) | |
1218 | ||
33ccb468 | 1219 | |
1220 | Conversely, if PowerDNS needs to be reminded to retrieve a zone from a | |
1221 | master, a command is provided: | |
33ccb468 | 1222 | |
d16e0461 TP |
1223 | $ sudo pdns_control retrieve forfun.net |
1224 | Added retrieval request for 'forfun.net' from master 212.187.98.67 | |
1225 | pdns[17495]: AXFR started for 'forfun.net', transaction started | |
1226 | pdns[17495]: Zone 'forfun.net' (/var/cache/bind/forfun.net) reloaded | |
1227 | pdns[17495]: AXFR done for 'forfun.net', zone committed | |
1228 | ||
1229 | ||
1230 | Also, you can force PowerDNS to reload a zone from disk immediately with | |
1231 | pdns_control bind-reload-now. All this happens 'live', per your | |
1232 | instructions. Without instructions, the right things also happen, but the | |
1233 | operator is in charge. | |
1234 | ||
1235 | For more about all this coolness, see Section B.1.1 and Section A.9.2. | |
1236 | ||
1237 | Warning Again some changes in compilation instructions. The hybrid pgmysql | |
1238 | backend has been split up into 'gmysql' and 'gpgsql', sharing a | |
1239 | common base within the PowerDNS server itself. This means that you | |
1240 | can no longer compile --with-modules="pgmysql" --enable-mysql | |
1241 | --enable-pgsql but that you should now use: --with-modules="gmysql | |
1242 | gpgsql". The old launch-names remain available. | |
1243 | ||
1244 | If you launch the Generic PgSQL backend as gpgsql2, all parameters | |
1245 | will have gpsql2 as a prefix, for example pgsql2-dbname. If | |
1246 | launched as gpsql, the regular names are in effect. | |
1247 | ||
1248 | Warning The pdns_control protocol was changed which means that older | |
1249 | pdns_controls cannot talk to 2.9.3. The other way around is broken | |
1250 | too. This may lead to problems with automatic upgrade scripts, so | |
1251 | pay attention if your daemon is truly restarted. | |
1252 | ||
1253 | Also make sure no old pdns_control command is around to confuse | |
1254 | things. | |
33ccb468 | 1255 | |
1256 | Improvements: | |
1257 | ||
1258 | * Bind backend can now deal with missing files and try to find them | |
1259 | later. | |
d16e0461 TP |
1260 | |
1261 | * Bind backend is now explicitly master capable and triggers the sending | |
1262 | of notifications. | |
1263 | ||
1264 | * General robustness improvements in Bind backend - many errors are now | |
1265 | non-fatal. | |
1266 | ||
33ccb468 | 1267 | * Accessability, Serviceability. New pdns_server commands like |
1268 | bind-list-rejects (lists zones that could not be loaded, and the | |
d16e0461 TP |
1269 | reason why), bind-reload-now (reload a zone from disk NOW), rediscover |
1270 | (reread named.conf NOW). More is coming up. | |
1271 | ||
33ccb468 | 1272 | * Added support for retrieving RP (Responsible Person) records from |
1273 | remote masters. Serving them was already possible. | |
d16e0461 TP |
1274 | |
1275 | * Added support for LOC records, which encode the geographical location | |
1276 | of a host, both serving and retrieving (thanks to Marco Davids using | |
1277 | them on our last Bind server, forcing us to implement this silly | |
1278 | record). | |
1279 | ||
33ccb468 | 1280 | * Configuration file parser now strips leading spaces too, allowing |
d16e0461 TP |
1281 | "chroot= /tmp" to work, as well as "chroot=/tmp" (Thanks to Hub Dohmen |
1282 | for reporting this for months on end). | |
1283 | ||
1284 | * Added bind-domain-status command that shows the status of all domains | |
1285 | (when/if they were parsed, any errors encountered while parsing them). | |
1286 | ||
1287 | * Added bind-reload-now command that tries to reload a zone from disk | |
1288 | NOW, and reports back errors to the operator immediatly. | |
1289 | ||
1290 | * Added retrieve command that queues a request to retrieve a zone from | |
1291 | its master. | |
1292 | ||
33ccb468 | 1293 | * Zones retrieved from masters are now stored way smaller on disk |
d16e0461 TP |
1294 | because the domain is stripped from records, which is derived from the |
1295 | configuration file. Retrieved zones are now prefixed with some | |
33ccb468 | 1296 | information on where they came from. |
1297 | ||
1298 | Changes: | |
1299 | ||
1300 | * gpgsql and gmysql backends split out of the hybrid pgmysqlbackend. | |
1301 | This again changed compilation instructions! | |
d16e0461 TP |
1302 | |
1303 | * pdns_control now uses the rarely seen SOCK_STREAM Unix Domain socket | |
1304 | variety so it can transport large amounts of text, which is needed for | |
1305 | the bind-domain-status command, for which see Section A.9.2. This | |
1306 | breaks compatability with older pdns_control and pdns_server binaries! | |
1307 | ||
1308 | * Bind backend now ignores 'hint' and 'forward' and other unsupported | |
1309 | zone types. | |
1310 | ||
33ccb468 | 1311 | * AXFRs are now logged more heavily by default. An AXFR is a heavy |
d16e0461 TP |
1312 | operation anyhow, some more logging does not further increase the load |
1313 | materially. Does help in clearing up what slaves are doing. | |
1314 | ||
1315 | * A lot of master/slave chatter has been silenced, making output more | |
1316 | relevant. No more repetitive 'No master domains need notifications' | |
1317 | etc, only changes are reported now. | |
33ccb468 | 1318 | |
1319 | Bugfixes: | |
1320 | ||
1321 | * Windows version did not compile without minor changes. | |
d16e0461 | 1322 | |
33ccb468 | 1323 | * Confusing error reporting on Windows 98 (which does not support |
1324 | PowerDNS) fixed | |
d16e0461 | 1325 | |
33ccb468 | 1326 | * Potential crashes with shortened packets addressed. An upgrade is |
1327 | advised! | |
d16e0461 | 1328 | |
33ccb468 | 1329 | * notify (which was already there, just badly documented) no longer |
1330 | prints out debugging garbage. | |
33ccb468 | 1331 | |
d16e0461 TP |
1332 | * pgmysql backend had problems launching when not compiled in but |
1333 | available as a module. Workaround for 2.9.2 is 'load-modules=pgmysql', | |
1334 | but even then gpgsql would not work! gmysql would then, however. These | |
1335 | modules are now split out, removing such issues. | |
1336 | ||
1337 | ---------------------------------------------------------------------- | |
1338 | ||
fc2fb8ea | 1339 | 1.3.14. Version 2.9.2 |
d16e0461 TP |
1340 | |
1341 | Bugfixes galore. Solaris porting created some issues on all platforms. | |
1342 | Great news is that PowerDNS is now in Debian 'sid' (unstable). The 2.9.1 | |
1343 | packages in there currently aren't very good but the 2.9.2 ones will be. | |
1344 | Many thanks to Wichert Akkerman, our 'downstream' for making this | |
1345 | possible. | |
1346 | ||
1347 | Warning The Generic MySQL backend, part of the Generic MySQL & PostgreSQL | |
1348 | backend, is now the DEFAULT! The previous default, the 'mysql' | |
1349 | backend (note the lack of 'g') is now DEPRECATED. This was the | |
1350 | source of much confusion. The 'mysql' backend does not support | |
1351 | MASTER or SLAVE operation. The Generic backends do. | |
1352 | ||
1353 | To get back the mysql backend, add --with-modules="mysql" or | |
1354 | --with-dynmodules="mysql" if you prefer to load your modules at | |
1355 | runtime. | |
33ccb468 | 1356 | |
1357 | Bugs fixed: | |
1358 | ||
1359 | * Silly debugging output removed from the webserver (found by Paul | |
1360 | Wouters) | |
d16e0461 | 1361 | |
33ccb468 | 1362 | * SEVERE: due to Solaris portability fixes, qtypes<127 were broken. |
d16e0461 TP |
1363 | These include NAPTR, ANY and AXFR. The upshot is that powerdns wasn't |
1364 | performing outgoing AXFRs nor ANY queries. These were the 'question | |
1365 | for type -1' warnings in the log | |
1366 | ||
33ccb468 | 1367 | * incoming AXFR could theoretically miss some trailing records (not |
1368 | observed, but could happen) | |
d16e0461 TP |
1369 | |
1370 | * incoming AXFR did not support TXT records (spotted by Paul Wouters) | |
1371 | ||
33ccb468 | 1372 | * with some remotes, an incoming AXFR would not terminate until a |
1373 | timeout occured (observed by Paul Wouters) | |
d16e0461 | 1374 | |
33ccb468 | 1375 | * Documentation bug, pgmysql != mypgsql |
1376 | ||
1377 | Documentation: | |
1378 | ||
d16e0461 TP |
1379 | * Documented the 'random backend', see Section A.3. |
1380 | ||
33ccb468 | 1381 | * Wichert Akkerman contributed three manpages. |
d16e0461 TP |
1382 | |
1383 | * Building PowerDNS on Unix is now documented somewhat more, see Section | |
1384 | D.1. | |
33ccb468 | 1385 | |
1386 | Features: | |
1387 | ||
1388 | * pdns init.d script is now +x by default | |
d16e0461 TP |
1389 | |
1390 | * OpenBSD is on its way of becoming a supported platform! As of 2.9.2, | |
1391 | PowerDNS compiles on OpenBSD but swiftly crashes. Help is welcome. | |
1392 | ||
1393 | * ODBC backend (for Windows only) was missing from the distribution, now | |
1394 | added. | |
1395 | ||
1396 | * xdb backend added - see Section A.11. Designed for use by root-server | |
1397 | operators. | |
1398 | ||
1399 | * Dynamic modules are back which is good news for distributors who want | |
1400 | to make a pdns packages that does not depend one every database under | |
1401 | the sun. | |
1402 | ||
1403 | ---------------------------------------------------------------------- | |
1404 | ||
fc2fb8ea | 1405 | 1.3.15. Version 2.9.1 |
d16e0461 TP |
1406 | |
1407 | Thanks to the great enthusiasm from around the world, powerdns is now | |
1408 | available for Solaris and FreeBSD users again! Furthermore, the Windows | |
1409 | build is back. We are very grateful for the help of: | |
33ccb468 | 1410 | |
1411 | * Michel Stol | |
d16e0461 | 1412 | |
33ccb468 | 1413 | * Wichert Akkerman |
d16e0461 | 1414 | |
33ccb468 | 1415 | * Edvard Tuinder |
d16e0461 | 1416 | |
33ccb468 | 1417 | * Koos van den Hout |
d16e0461 | 1418 | |
33ccb468 | 1419 | * Niels Bakker |
d16e0461 | 1420 | |
33ccb468 | 1421 | * Erik Bos |
d16e0461 | 1422 | |
33ccb468 | 1423 | * Alex Bleker |
d16e0461 | 1424 | |
33ccb468 | 1425 | * steven stillaway |
d16e0461 | 1426 | |
33ccb468 | 1427 | * Roel van der Made |
d16e0461 | 1428 | |
33ccb468 | 1429 | * Steven Van Steen |
1430 | ||
d16e0461 TP |
1431 | We are happy to have been able to work with the open source community to |
1432 | improve PowerDNS! | |
33ccb468 | 1433 | |
1434 | Changes: | |
1435 | ||
d16e0461 TP |
1436 | * The monitor command set no longer allows the changing of non-existant |
1437 | variables. | |
1438 | ||
1439 | * IBM Universal Database DB2 backend now included in source distribution | |
1440 | (untested!) | |
1441 | ||
1442 | * Oracle backend now included in source distribution (sligthly tested!) | |
1443 | ||
33ccb468 | 1444 | * configure script now searches for postgresql and mysql includes |
d16e0461 TP |
1445 | |
1446 | * Bind parser now no longer dies on records with a ' in them (Erik Bos) | |
1447 | ||
33ccb468 | 1448 | * The pipebackend was accidentally left out of 2.9 |
d16e0461 TP |
1449 | |
1450 | * FreeBSD fixes (with help from Erik Bos, Alex Bleeker, Niels Bakker) | |
1451 | ||
1452 | * Heap of Solaris work (with help from Edvard Tuinder, Stefan Van Steen, | |
1453 | Koos van den Hout, Roel van der Made and especially Mark Bakker). Now | |
1454 | compiles in 2.7 and 2.8, haven't tried 2.9. May be a bit dysfunctional | |
1455 | on 2.7 though - it won't do IPv6 and it won't serve AAAA. Patches | |
1456 | welcome! | |
1457 | ||
1458 | * Windows 32 build is back! Michel Stol updated his earlier work to the | |
1459 | current version. | |
1460 | ||
33ccb468 | 1461 | * S/Linux (Linux on Sparc) build works now (with help from steven |
1462 | stillaway). | |
d16e0461 | 1463 | |
33ccb468 | 1464 | * Silly debugging message ('sd.ttl from cache') removed |
d16e0461 | 1465 | |
33ccb468 | 1466 | * .debs are back, hopefully in 'sid' soon! (Wichert Akkerman) |
33ccb468 | 1467 | |
d16e0461 TP |
1468 | * Removal of bzero and other less portable constructs. Discovered that |
1469 | recent Linux glibc's need -D_GNU_SOURCE (Wichert Akkerman). | |
33ccb468 | 1470 | |
d16e0461 TP |
1471 | ---------------------------------------------------------------------- |
1472 | ||
fc2fb8ea | 1473 | 1.3.16. Version 2.9 |
d16e0461 TP |
1474 | |
1475 | Open source release. Do not deploy unless you know what you are doing. | |
1476 | Stability is expected to return with 2.9.1, as are the binary builds. | |
33ccb468 | 1477 | |
1478 | * License changed to the GNU General Public License version 2. | |
d16e0461 | 1479 | |
33ccb468 | 1480 | * Cleanups by Erik Bos @ xs4all. |
d16e0461 | 1481 | |
33ccb468 | 1482 | * Build improvements by Wichert Akkerman |
d16e0461 | 1483 | |
33ccb468 | 1484 | * Lots of work on the build system, entirely revamped. By PowerDNS. |
33ccb468 | 1485 | |
d16e0461 TP |
1486 | ---------------------------------------------------------------------- |
1487 | ||
fc2fb8ea | 1488 | 1.3.17. Version 2.8 |
33ccb468 | 1489 | |
d16e0461 TP |
1490 | From this release onwards, we'll concentrate on stabilising for the 3.0 |
1491 | release. So if you have any must-have features, let us know soonest. The | |
1492 | 2.8 release fixes a bunch of small stability issues and add two new | |
1493 | features. In the spirit of the move to stability, this release has already | |
1494 | been running 24 hours on our servers before release. | |
33ccb468 | 1495 | |
1496 | * pipe backend gains the ability to restricts its invocation to a | |
1497 | limited number of requests. This allows a very busy nameserver to | |
1498 | still serve packets from a slow perl backend. | |
d16e0461 | 1499 | |
33ccb468 | 1500 | * pipe backend now honors query-logging, which also documents which |
1501 | queries were blocked by the regex. | |
d16e0461 | 1502 | |
33ccb468 | 1503 | * pipe backend now has its own backend chapter. |
33ccb468 | 1504 | |
d16e0461 TP |
1505 | * An incoming AXFR timeout at the wrong moment had the ability to crash |
1506 | the binary, forcing a reload. Thanks to our bug spotting champions | |
1507 | Mike Benoit and Simon Kirby of NetNation for reporting this. | |
1508 | ||
1509 | ---------------------------------------------------------------------- | |
1510 | ||
fc2fb8ea | 1511 | 1.3.18. Version 2.7 and 2.7.1 |
d16e0461 TP |
1512 | |
1513 | This version fixes some very long standing issues and adds a few new | |
1514 | features. If you are still running 2.6, upgrade yesterday. If you were | |
1515 | running 2.6.1, an upgrade is still strongly advised. | |
33ccb468 | 1516 | |
d16e0461 TP |
1517 | Features: |
1518 | ||
1519 | * The controlsocket is now readable and writable by the 'setgid' user. | |
1520 | This allows for non-root access to PDNS which is nice for mrtg or | |
1521 | cricket graphs. | |
33ccb468 | 1522 | |
d16e0461 TP |
1523 | * MySQL backend (the non-generic one) gains the ability to read from a |
1524 | different table using the mysql-table setting. | |
33ccb468 | 1525 | |
33ccb468 | 1526 | * pipe backend now has a configurable timeout using the pipe-timeout |
d16e0461 TP |
1527 | setting. Thanks fo Steve Bromwich for pointing out the need for this. |
1528 | ||
33ccb468 | 1529 | * Experimental backtraces. If PowerDNS crashes, it will log a lot of |
1530 | numbers and sometimes more to the syslog. If you see these, please | |
1531 | report them to us. Only available under Linux. | |
1532 | ||
1533 | Bugs: | |
1534 | ||
d16e0461 TP |
1535 | * 2.7 briefly broke the mysql backend, so don't use it if you use that. |
1536 | 2.7.1 fixes this. | |
1537 | ||
33ccb468 | 1538 | * SOA records could sometimes have the wrong TTL. Thanks to Jonas |
1539 | Daugaard for reporting this. | |
d16e0461 TP |
1540 | |
1541 | * An ANY query might lead to duplicate SOA records being returned under | |
1542 | exceptional circumstances. Thanks to Jonas Daugaard for reporting | |
33ccb468 | 1543 | this. |
33ccb468 | 1544 | |
d16e0461 TP |
1545 | * Underlying the above bug, packet compression could sometimes suddenly |
1546 | be turned off, leading to overly large responses and non-removal of | |
1547 | duplicate records. | |
1548 | ||
1549 | * The allow-axfr-ips setting did not accept IP ranges (1.2.3.0/24) which | |
1550 | the documentation claimed it did (thanks to Florus Both of Ascio | |
1551 | technologies for being sufficiently persistent in reporting this). | |
1552 | ||
1553 | * Killed backends were not being respawned, leading to suboptimal | |
1554 | behaviour on intermittent database errors. Thanks to Steve Bromwich | |
1555 | for reporting this. | |
1556 | ||
1557 | * Corrupt packets during an incoming AXFR when acting as a slave would | |
1558 | cause a PowerDNS reload instead of just failing that AXFR. Thanks to | |
1559 | Mike Benoit and Simon Kirby of NetNation for reporting this. | |
1560 | ||
1561 | * Label compression in incoming AXFR had problems with large offsets, | |
1562 | causing the above mentioned errors. Thanks to Mike Benoit and Simon | |
1563 | Kirby of NetNation for reporting this. | |
1564 | ||
1565 | ---------------------------------------------------------------------- | |
1566 | ||
fc2fb8ea | 1567 | 1.3.19. Version 2.6.1 |
33ccb468 | 1568 | |
d16e0461 | 1569 | Quick fix release for a big cache problem. |
33ccb468 | 1570 | |
d16e0461 | 1571 | ---------------------------------------------------------------------- |
33ccb468 | 1572 | |
fc2fb8ea | 1573 | 1.3.20. Version 2.6 |
33ccb468 | 1574 | |
d16e0461 TP |
1575 | Performance release. A lot of work has been done to raise PDNS performance |
1576 | to staggering levels in order to take part in benchmarketing efforts. | |
1577 | Together with our as yet unnamed partner, PDNS has been benchmarked at | |
1578 | 60.000 mostly cached queries/second on off the shelf PC hardware. Uncached | |
1579 | performance was 17.000 uncached DNS queries/second on the .ORG domain. | |
33ccb468 | 1580 | |
d16e0461 TP |
1581 | Performance has been increased by both making PDNS itself quicker but also |
1582 | by lowering the number of backend queries typically needed. Operators will | |
1583 | typically see PDNS taking less CPU and the backend seeing less load. | |
33ccb468 | 1584 | |
d16e0461 TP |
1585 | Furthermore, some real bugs were fixed. A couple of undocumented |
1586 | performance switches may appear in --help output but you are advised to | |
1587 | stay away from these. | |
33ccb468 | 1588 | |
d16e0461 TP |
1589 | Developers: this version needs the pdns-2.5.1 development kit, available |
1590 | on http://downloads.powerdns.com/releases/dev. See also Appendix C. | |
1591 | ||
1592 | Performance: | |
1593 | ||
1594 | * A big error in latency calculations - cached packets were weighed 50 | |
1595 | times less, leading to inflated latency reporting. Latency | |
1596 | calculations are now correct and way lower - often in the microseconds | |
1597 | range. | |
1598 | ||
1599 | * It is now possible to run with 0 second cache TTLs. This used to cause | |
1600 | very frequent cache cleanups, leading to performance degradation. | |
33ccb468 | 1601 | |
33ccb468 | 1602 | * Many tiny performance improvements, removing duplicate cache key |
d16e0461 TP |
1603 | calculations, etc. The cache itself has also been reworked to be more |
1604 | efficient. | |
1605 | ||
1606 | * First 'CNAME' backend query replaced by an 'ANY' query, which most of | |
1607 | the time returns the actual record, preventing the need for a separate | |
1608 | CNAME lookup, halving query load. | |
1609 | ||
33ccb468 | 1610 | * Much of the same for same-level-NS records on queries needing |
1611 | delegation. | |
1612 | ||
1613 | Bugs fixed: | |
1614 | ||
d16e0461 TP |
1615 | * Incidentally, the cache count would show 'unknown' packets, which was |
1616 | harmless but confusing. Thanks to Mike and Simon of NetNation for | |
1617 | reporting this. | |
1618 | ||
33ccb468 | 1619 | * SOA hostmaster with a . in the local-part would be cached wrongly, |
1620 | leading to a stray backslash in case of multiple successively SOA | |
1621 | queries. Thanks to Ascio Techologies for spotting this bug. | |
d16e0461 TP |
1622 | |
1623 | * zone2sql did not parse Verisign zonefiles correctly as these contained | |
1624 | a $TTL statement in mid-record. | |
1625 | ||
1626 | * Sometimes packets would not be accounted, leading to 'udp-queries' and | |
1627 | 'udp-answers' divergence. | |
33ccb468 | 1628 | |
1629 | Features: | |
1630 | ||
1631 | * 'cricket' command added to init.d scripts that provides unadorned | |
1632 | output for parsing by 'Cricket'. | |
33ccb468 | 1633 | |
d16e0461 | 1634 | ---------------------------------------------------------------------- |
33ccb468 | 1635 | |
fc2fb8ea | 1636 | 1.3.21. Version 2.5.1 |
33ccb468 | 1637 | |
d16e0461 | 1638 | Brown paper bag release fixing a huge memory leak in the new Query Cache. |
33ccb468 | 1639 | |
d16e0461 TP |
1640 | Developers: this version needs the new pdns-2.5.1 development kit, |
1641 | available on http://downloads.powerdns.com/releases/dev. See also Appendix | |
1642 | C. | |
1643 | ||
1644 | And some small changes: | |
33ccb468 | 1645 | |
1646 | * Added support for RFC2038 compliant negative-answer caching. This | |
d16e0461 TP |
1647 | allows remotes to cache the fact that a domain does not exist and will |
1648 | not exist for a while. Thanks to Chris Thompson for pointing out how | |
1649 | tiny our minds are. This feature may cause a noticeable reduction in | |
1650 | query load. | |
1651 | ||
1652 | * Small speedup to non-packet-cached queries, incidentally fixing the | |
1653 | huge memory leak. | |
1654 | ||
33ccb468 | 1655 | * pdns_control ccounts command outputs statistics on what is in the |
1656 | cache, which is useful to help optimize your caching strategy. | |
33ccb468 | 1657 | |
d16e0461 TP |
1658 | ---------------------------------------------------------------------- |
1659 | ||
fc2fb8ea | 1660 | 1.3.22. Version 2.5 |
33ccb468 | 1661 | |
d16e0461 TP |
1662 | An important release which has seen quite a lot of trial and error |
1663 | testing. As a result, PDNS can now run with a huge cache and concurrent | |
1664 | invalidations. This is useful when running of a slower database or under | |
1665 | high traffic load with a fast database. | |
33ccb468 | 1666 | |
d16e0461 TP |
1667 | Furthermore, the gpgsql2 backend has been validated for use and will soon |
1668 | supplant the gpgsql backend entirely. This also bodes well for the gmysql | |
1669 | backend which is the same code. | |
33ccb468 | 1670 | |
d16e0461 TP |
1671 | Also, a large amount of issues biting large scale slave operators were |
1672 | addressed. Most of these issues would only show up after prolonged uptime. | |
33ccb468 | 1673 | |
d16e0461 | 1674 | New features: |
33ccb468 | 1675 | |
1676 | * Query cache. The old Packet Cache only cached entire questions and | |
d16e0461 TP |
1677 | their answers. This is very CPU efficient but does not lead to maximum |
1678 | hitrate. Two packets both needing to resolve smtp.you.com internally | |
1679 | would not benefit from any caching. Furthermore, many different DNS | |
1680 | queries lead to the same backend queries, like 'SOA for .COM?'. | |
1681 | ||
1682 | PDNS now also caches backend queries, but only those having no answer | |
1683 | (the majority) and those having one answer (almost the rest). | |
1684 | ||
1685 | In tests, these additional caches appear to halve the database backend | |
1686 | load numerically and perhaps even more in terms of CPU load. Often, | |
1687 | queries with no answer are more expensive than those having one. | |
1688 | ||
33ccb468 | 1689 | The default ttls for the query-cache and negquery-cache are set to |
d16e0461 TP |
1690 | safe values (20 and 60 seconds respectively), you should be seeing an |
1691 | improvement in behaviour without sacrificing a lot in terms of quick | |
1692 | updates. | |
1693 | ||
33ccb468 | 1694 | The webserver also displays the efficiency of the new Query Cache. |
d16e0461 TP |
1695 | |
1696 | The old Packet Cache is still there (and useful) but see Chapter 9 for | |
1697 | more details. | |
1698 | ||
33ccb468 | 1699 | * There is now the ability to shut off some logging at a very early |
d16e0461 TP |
1700 | stage. High performance sites doing thousands of queries/second may in |
1701 | fact spend most of their CPU time on attempting to write out logging, | |
1702 | even though it is ignored by syslog. The new flag log-dns-details, on | |
1703 | by default, allows the operator to kill most informative-only logging | |
1704 | before it takes any cpu. | |
1705 | ||
33ccb468 | 1706 | * Flags which can be switched 'on' and 'off' can now also be set to |
1707 | 'off' instead of only to 'no' to turn them off. | |
1708 | ||
1709 | Enhancements: | |
1710 | ||
1711 | * Packet Cache is now case insensitive, leading to a higher hitrate | |
d16e0461 TP |
1712 | because identical queries only differing in case now both match. Care |
1713 | is taken to restore the proper case in the answer sent out. | |
1714 | ||
33ccb468 | 1715 | * Packet Cache stores packets more efficiently now, savings are |
1716 | estimated at 50%. | |
d16e0461 TP |
1717 | |
1718 | * The Packet Cache is now asynchronous which means that PDNS continues | |
1719 | to answer questions while the cache is busy being purged or queried. | |
1720 | Incidentally this will mean a cache miss where previously the question | |
1721 | would wait until the cache became available again. | |
1722 | ||
1723 | The upshot of this is that operators can call pdns_control purge as | |
1724 | often as desired without fearing performance loss. Especially the | |
1725 | full, non-specific, purge was speeded up tremendously. | |
1726 | ||
33ccb468 | 1727 | This optimization is of little merit for small sites but is very |
d16e0461 TP |
1728 | important when running with a large packetcache, such as when using |
1729 | recursion under high load. | |
1730 | ||
1731 | * AXFR log messages now all contain the word 'AXFR' to ease grepping. | |
1732 | ||
33ccb468 | 1733 | * Linux static version now compiled with gcc 3.2 which is known to |
1734 | output better and faster code than the previously used 3.0.4. | |
1735 | ||
1736 | Bugs fixed: | |
1737 | ||
d16e0461 TP |
1738 | * Packetcache would sometimes send packets back with slightly modified |
1739 | flags if these differed from the flags of the cached copy. | |
1740 | ||
33ccb468 | 1741 | * Resolver code did bad things with filedescriptors leading to fd |
d16e0461 TP |
1742 | exhaustion after prolonged uptimes and many slave SOA currency checks. |
1743 | ||
1744 | * Resolver code failed to properly log some errors, leading to operator | |
1745 | uncertainty regarding to AXFR problems with remote masters. | |
1746 | ||
1747 | * After prolonged uptime, slave code would try to use privileged ports | |
1748 | for originating queries, leading to bad replication efficiency. | |
1749 | ||
1750 | * Masters sending back answers in differing case from questions would | |
1751 | lead to bogus 'Master tried to sneak in out-of-zone data' errors and | |
1752 | failing AXFRs. | |
1753 | ||
1754 | ---------------------------------------------------------------------- | |
1755 | ||
fc2fb8ea | 1756 | 1.3.23. Version 2.4 |
d16e0461 TP |
1757 | |
1758 | Developers: this version is compatible with the pdns-2.1 development kit, | |
1759 | available on http://downloads.powerdns.com/releases/dev. See also Appendix | |
1760 | C. | |
1761 | ||
1762 | This version fixes some stability issues with malformed or malcrafted | |
1763 | packets. An upgrade is advised. Furthermore, there are interesting new | |
1764 | features. | |
1765 | ||
1766 | New features: | |
1767 | ||
1768 | * Recursive queries are now also cached, but in a separate namespace so | |
1769 | non-recursive queries don't get recursed answers and vice versa. This | |
1770 | should mean way lower database load for sites running with the current | |
1771 | default lazy-recursion. Up to now, each and every recursive query | |
1772 | would lead to a large amount of SQL queries. | |
1773 | ||
33ccb468 | 1774 | To prevent the packetcache from becoming huge, a separate |
1775 | recursive-cache-ttl can be specified. | |
d16e0461 TP |
1776 | |
1777 | * The ability to change parameters at runtime was added. Currently, only | |
1778 | the new query-logging flag can be changed. | |
1779 | ||
1780 | * Added query-logging flag which hints a backend that it should output a | |
1781 | textual representation of queries it receives. Currently only gmysql | |
1782 | and gpgsql2 honor this flag. | |
1783 | ||
33ccb468 | 1784 | * Gmysql backend can now also talk to PgSQL, leading to less code. |
d16e0461 TP |
1785 | Currently, the old postgresql driver ('gpgsql') is still the default, |
1786 | the new driver is available as 'gpgsql2' and has the benefit that it | |
1787 | does query logging. In the future, gpgsql2 will become the default | |
1788 | gpgsql driver. | |
1789 | ||
1790 | * DNS recursing proxy is now more verbose in logging odd events which | |
1791 | may be caused by buggy recursing backends. | |
1792 | ||
33ccb468 | 1793 | * Webserver now displays peak queries/second 1 minute average. |
1794 | ||
1795 | Bugs fixed: | |
1796 | ||
1797 | * Failure to connect to database in master/slave communicator thread | |
1798 | could lead to an unclean reload, fixed. | |
1799 | ||
1800 | Documentation: added details for strict-rfc-axfrs. This feature can be | |
d16e0461 TP |
1801 | used if very old clients need to be able to do zone transfers with PDNS. |
1802 | Very slow. | |
1803 | ||
1804 | ---------------------------------------------------------------------- | |
33ccb468 | 1805 | |
fc2fb8ea | 1806 | 1.3.24. Version 2.3 |
33ccb468 | 1807 | |
d16e0461 TP |
1808 | Developers: this version is compatible with the pdns-2.1 development kit, |
1809 | available on http://downloads.powerdns.com/releases/dev. See also Appendix | |
1810 | C. | |
33ccb468 | 1811 | |
d16e0461 TP |
1812 | This release adds the Generic MySQL backend which allows full master/slave |
1813 | semantics with MySQL and InnoDB tables (or other tables that support | |
1814 | transactions). See Section A.5. | |
33ccb468 | 1815 | |
d16e0461 | 1816 | Other new features: |
33ccb468 | 1817 | |
d16e0461 TP |
1818 | * Improved error messages in master/slave communicator will help down |
1819 | track problems. | |
1820 | ||
1821 | * slave-cycle-interval setting added. Very large sites with thousands of | |
1822 | slave domains may need to raise this value above the default of 60. | |
1823 | Every cycle, domains in undeterminate state are checked for their | |
1824 | condition. Depending on the health of the masters, this may entail | |
1825 | many SOA queries or attempted AXFRs. | |
33ccb468 | 1826 | |
1827 | Bugs fixed: | |
1828 | ||
1829 | * 'pdns_control purge domain' and 'pdns_control purge domain$' were | |
d16e0461 TP |
1830 | broken in version 2.2 and did not in fact purge the cache. There is a |
1831 | slight risk that domain-specific purge commands could force a reload | |
1832 | in previous version. Thanks to Mike Benoit of NetNation for | |
33ccb468 | 1833 | discovering this. |
d16e0461 | 1834 | |
33ccb468 | 1835 | * Master/slave communicator thread got confused in case of delayed |
1836 | answers from slow masters. While not causing harm, this caused | |
1837 | inefficient behaviour when testing large amounts of slave domains | |
d16e0461 TP |
1838 | because additional 'cycles' had to pass before all domains would have |
1839 | their status ascertained. | |
1840 | ||
33ccb468 | 1841 | * Backends implementing special SOA semantics (currently only the |
1842 | undocumented 'pdns express backend', or homegrown backends) would | |
d16e0461 TP |
1843 | under some circumstances not answer the SOA record in case of an ANY |
1844 | query. This should put an end to the last DENIC problems. Thanks to | |
1845 | DENIC for helping us find the problem. | |
33ccb468 | 1846 | |
d16e0461 | 1847 | ---------------------------------------------------------------------- |
33ccb468 | 1848 | |
fc2fb8ea | 1849 | 1.3.25. Version 2.2 |
d16e0461 TP |
1850 | |
1851 | Developers: this version is compatible with the pdns-2.1 development kit, | |
1852 | available on http://downloads.powerdns.com/releases/dev. See also Appendix | |
1853 | C. | |
1854 | ||
1855 | Again a big release. PowerDNS is seeing some larger deployments in more | |
1856 | demanding environments and these are helping shake out remaining issues, | |
1857 | especially with recursing backends. | |
1858 | ||
1859 | The big news is that wildcard CNAMEs are now supported, an oft requested | |
1860 | feature and nearly the only part in which PDNS differed from BIND in | |
1861 | authoritative capabilities. | |
1862 | ||
1863 | If you were seeing signal 6 errors in PDNS causing reloads and | |
1864 | intermittent service disruptions, please upgrade to this version. | |
1865 | ||
1866 | For operators of PowerDNS Express trying to host .DE domains, the very | |
1867 | special soa-serial-offset feature has been added to placate the new DENIC | |
1868 | requirement that the SOA serial be at least six digits. PowerDNS Express | |
1869 | uses the SOA serial as an actual serial and not to insert dates and hence | |
1870 | often has single digit soa serial numbers, causing big problems with .DE | |
1871 | redelegations. | |
1872 | ||
1873 | Bugs fixed: | |
33ccb468 | 1874 | |
d16e0461 TP |
1875 | * Malformed or shortened TCP recursion queries would cause a signal 6 |
1876 | and a reload. Same for EOF from the TCP recursing backend. Thanks to | |
1877 | Simon Kirby and Mike Benoit of NetNation for helping debug this. | |
33ccb468 | 1878 | |
d16e0461 TP |
1879 | * Timeouts on the TCP recursing backend were far too long, leading to |
1880 | possible exhaustion of TCP resolving threads. | |
33ccb468 | 1881 | |
d16e0461 TP |
1882 | * pdns_control purge domain accidentally cleaned all packets with that |
1883 | name as a prefix. Thanks to Simon Kirby for spotting this. | |
33ccb468 | 1884 | |
d16e0461 TP |
1885 | * Improved exception error logging - in some circumstances PDNS would |
1886 | not properly log the cause of an exception, which hampered problem | |
1887 | resolution. | |
33ccb468 | 1888 | |
d16e0461 TP |
1889 | New features: |
1890 | ||
1891 | * Wildcard CNAMEs now work as expected! | |
1892 | ||
1893 | * pdns_control purge can now also purge based on suffix, allowing | |
1894 | operators to purge an entire domain from the packet cache instead of | |
1895 | only specific records. See also Section B.1.1 Thanks to Mike Benoit | |
1896 | for this suggestion. | |
33ccb468 | 1897 | |
d16e0461 TP |
1898 | * soa-serial-offset for installations with small SOA serial numbers |
1899 | wishing to register .DE domains with DENIC which demands six-figure | |
1900 | SOA serial numbers. See also Chapter 15. | |
1901 | ||
1902 | ---------------------------------------------------------------------- | |
1903 | ||
fc2fb8ea | 1904 | 1.3.26. Version 2.1 |
d16e0461 TP |
1905 | |
1906 | This is a somewhat bigger release due to pressing demands from customers. | |
1907 | An upgrade is advised for installations using Recursion. If you are using | |
1908 | recursion, it is vital that you are aware of changes in semantics. | |
1909 | Basically, local data will now override data in your recursing backend | |
1910 | under most circumstances. Old behaviour can be restored by turning | |
1911 | lazy-recursion off. | |
1912 | ||
1913 | Developers: this version has a new pdns-2.1 development kit, available on | |
1914 | http://downloads.powerdns.com/releases/dev. See also Appendix C. | |
1915 | ||
1916 | Warning Most users will run a static version of PDNS which has no | |
1917 | dependencies on external libraries. However, some may need to run | |
1918 | the dynamic version. This warning applies to these users. | |
1919 | ||
1920 | To run the dynamic version of PDNS, which is needed for backend | |
1921 | drivers which are only available in source form, gcc 3.0 is | |
1922 | required. RedHat 7.2 comes with gcc 3.0 as an optional component, | |
1923 | RedHat 7.3 does not. However, the RedHat 7.2 Update gcc rpms | |
1924 | install just fine on RedHat 7.3. For Debian, we suggest running | |
1925 | 'woody' and installing the g++-3.0 package. We expect to release a | |
1926 | FreeBSD dynamic version shortly. | |
33ccb468 | 1927 | |
1928 | Bugs fixed: | |
1929 | ||
d16e0461 TP |
1930 | * RPM releases sometimes overwrote previous configuration files. Thanks |
1931 | to Jorn Ekkelenkamp of Hubris/ISP Services for reporting this. | |
1932 | ||
33ccb468 | 1933 | * TCP recursion sent out overly large responses due to a byteorder |
d16e0461 TP |
1934 | mistake, confusing some clients. Thanks to the capable engineers of |
1935 | NetNation for bringing this to our attention. | |
1936 | ||
33ccb468 | 1937 | * TCP recursion in combination with a recursing backend on a |
1938 | non-standard port did not work, leading to a non-functioning TCP | |
d16e0461 TP |
1939 | listener. Thanks to the capable engineers of NetNation for bringing |
1940 | this to our attention. | |
33ccb468 | 1941 | |
1942 | Unexpected behaviour: | |
1943 | ||
1944 | * Wildcard URL records where not implemented because they are a | |
1945 | performance penalty. To turn these on, enable wildcard-url in the | |
1946 | configuration. | |
d16e0461 TP |
1947 | |
1948 | * Unlike other nameservers, local data did not override the internet for | |
1949 | recursing queries. This has mostly been brought into conformance with | |
1950 | user expectations. If a recursive question can be answered entirely | |
1951 | from local data, it is. To restore old behaviour, disable | |
1952 | lazy-recursion. Also see Chapter 11. | |
33ccb468 | 1953 | |
1954 | Features: | |
1955 | ||
d16e0461 TP |
1956 | * Oracle support has been tuned, leading to the first public release of |
1957 | the Oracle backend. Zone2sql now outputs better SQL and the backend is | |
1958 | now fully documented. Furthermore, the queries are compatible with the | |
1959 | PowerDNS XML-RPC product, allowing PowerDNS express to run off Oracle. | |
1960 | See Section A.6. | |
1961 | ||
1962 | * Zone2sql now accepts --transactions to wrap zones in a transaction for | |
1963 | PostgreSQL and Oracle output. This is a major speedup and also makes | |
1964 | for better isolation of inserts. See Section 10.1. | |
1965 | ||
1966 | * pdns_control now has the ability to purge the PowerDNS cache or parts | |
1967 | of it. This enables operators to raise the TTL of the Packet Cache to | |
1968 | huge values and only to invalidate the cache when changes are made. | |
1969 | See also Chapter 9 and Section B.1.1. | |
1970 | ||
1971 | ---------------------------------------------------------------------- | |
1972 | ||
fc2fb8ea | 1973 | 1.3.27. Version 2.0.1 |
d16e0461 TP |
1974 | |
1975 | Maintenance release, fixing three small issues. | |
1976 | ||
1977 | Developers: this version is compatible with 1.99.11 backends. | |
1978 | ||
1979 | * PowerDNS ignored the logging-facility setting unless it was specified | |
1980 | on the commandline. Thanks to Karl Obermayer from WebMachine | |
1981 | Technologies for noticing this. | |
1982 | ||
1983 | * Zone2sql neglected to preserve 'slaveness' of domains when converting | |
1984 | to the slave capable PostgreSQL backend. Thanks to Mike Benoit of | |
1985 | NetNation for reporting this. Zone2sql now has a --slave option. | |
1986 | ||
33ccb468 | 1987 | * SOA Hostmaster addresses with dots in them before the @-sign were |
1988 | mis-encoded on the wire. | |
33ccb468 | 1989 | |
d16e0461 | 1990 | ---------------------------------------------------------------------- |
33ccb468 | 1991 | |
fc2fb8ea | 1992 | 1.3.28. Version 2.0 |
33ccb468 | 1993 | |
d16e0461 | 1994 | Two bugfixes, one stability/security related. No new features. |
33ccb468 | 1995 | |
d16e0461 | 1996 | Developers: this version is compatible with 1.99.11 backends. |
33ccb468 | 1997 | |
d16e0461 TP |
1998 | Bugfixes: |
1999 | ||
2000 | * zone2sql refused to work under some circumstances, taking 100% cpu and | |
2001 | not functioning. Thanks to Andrew Clark and Mike Benoit for reporting | |
2002 | this. | |
2003 | ||
2004 | * Fixed a stability issue where malformed packets could force PDNS to | |
2005 | reload. Present in all earlier 2.0 versions. | |
33ccb468 | 2006 | |
d16e0461 | 2007 | ---------------------------------------------------------------------- |
33ccb468 | 2008 | |
fc2fb8ea | 2009 | 1.3.29. Version 2.0 Release Candidate 2 |
33ccb468 | 2010 | |
d16e0461 | 2011 | Mostly bugfixes, no really new features. |
33ccb468 | 2012 | |
d16e0461 TP |
2013 | Developers: this version is compatible with 1.99.11 backends. |
2014 | ||
2015 | Bugs fixed: | |
2016 | ||
2017 | * chroot() works again - 2.0rc1 silently refused to chroot. Thanks to | |
2018 | Hub Dohmen for noticing this. | |
33ccb468 | 2019 | |
33ccb468 | 2020 | * setuid() and setgid() security features were silently not being |
2021 | performed in 2.0rc1. Thanks to Hub Dohmen for noticing this. | |
d16e0461 TP |
2022 | |
2023 | * MX preferences over 255 now work as intended. Thanks to Jeff Crowe for | |
2024 | noticing this. | |
2025 | ||
2026 | * IPv6 clients can now also benefit from the recursing backend feature. | |
2027 | Thanks to Andy Furnell for proving beyond any doubt that this did not | |
2028 | work. | |
2029 | ||
2030 | * Extremely bogus code removed from DNS notification reception code - | |
2031 | please test! Thanks to Jakub Jermar for working with us in figuring | |
2032 | out just how broken this was. | |
2033 | ||
2034 | * AXFR code improved to handle more of the myriad different zonetransfer | |
2035 | dialects available. Specifically, interoperability with Bind 4 was | |
2036 | improved, as well as Bind 8 in 'strict rfc conformance' mode. Thanks | |
2037 | again for Jakub Jermar for running many tests for us. If your | |
2038 | transfers failed with 'Unknown type 14!!' or words to that effect, | |
2039 | this was it. | |
33ccb468 | 2040 | |
2041 | Features: | |
2042 | ||
2043 | * Win32 version now has a zone2sql tool. | |
d16e0461 | 2044 | |
33ccb468 | 2045 | * Win32 version now has support for specifying how urgent messages |
2046 | should be before they go to the NT event log. | |
2047 | ||
2048 | Remaining issues: | |
2049 | ||
2050 | * One persistent report of the default 'chroot=./' configuration not | |
2051 | working. | |
d16e0461 TP |
2052 | |
2053 | * One report of disable-axfr and allow-axfr-ips not working as intended. | |
2054 | ||
2055 | * Support for relative paths in zones and in Bind configuration is not | |
2056 | bug-for-bug compatible with bind yet. | |
2057 | ||
2058 | ---------------------------------------------------------------------- | |
2059 | ||
fc2fb8ea | 2060 | 1.3.30. Version 2.0 Release Candidate 1 |
d16e0461 TP |
2061 | |
2062 | The MacOS X release! A very experimental OS X 10.2 build has been added. | |
2063 | Furthermore, the Windows version is now in line with Unix with respect to | |
2064 | capabilities. The ODBC backend now has the code to function as both a | |
2065 | master and a slave. | |
2066 | ||
2067 | Developers: this version is compatible with 1.99.11 backends. | |
2068 | ||
2069 | * Implemented native packet response parsing code, allowing Windows to | |
2070 | perform AXFR and NS and SOA queries. | |
2071 | ||
2072 | * This is the first version for which we have added support for Darwin | |
2073 | 6.0, which is part of the forthcoming Mac OS X 10.2. Please note that | |
2074 | although this version is marked RC1, that we have not done extensive | |
2075 | testing yet. Consider this a technology preview. | |
2076 | ||
2077 | * The Darwin version has been developed on Mac OS X 10.2 (6C35). | |
2078 | Other versions may or may not work. | |
2079 | ||
2080 | * Currently only the random, bind, mysql and pdns backends are | |
33ccb468 | 2081 | included. |
d16e0461 TP |
2082 | |
2083 | * The menu based installer script does not work, you will have to | |
2084 | edit pathconfig by hand as outlined in chapter 2. | |
2085 | ||
2086 | * On Mac OS X Client, PDNS will fail to start because a system | |
33ccb468 | 2087 | service is already bound to port 53. |
d16e0461 | 2088 | |
33ccb468 | 2089 | This version is distributed as a compressed tar file. You should |
2090 | follow the generic UNIX installation instructions. | |
2091 | ||
2092 | Bugs fixed: | |
2093 | ||
2094 | * Zone2sql PostgreSQL mode neglected to lowercase $ORIGIN. Thanks to | |
2095 | Maikel Verheijen of Ladot for spotting this. | |
d16e0461 | 2096 | |
33ccb468 | 2097 | * Zone2sql PostgreSQL mode neglected to remove a trailing dot from |
d16e0461 TP |
2098 | $ORIGIN if present. Thanks to Thanks to Maikel Verheijen of Ladot for |
2099 | spotting this. | |
2100 | ||
33ccb468 | 2101 | * Zonefile parser was not compatible with bind when $INCLUDING |
d16e0461 TP |
2102 | non-absolute filenames. Thanks to Jeff Miller for working out how this |
2103 | should work. | |
33ccb468 | 2104 | |
d16e0461 TP |
2105 | * Bind configuration parser was not compatible with bind when including |
2106 | non-absolute filenames. Thanks to Jeff Miller for working out how this | |
2107 | should work. | |
2108 | ||
2109 | * Documentation incorrectly listed the Bind backend as 'slave capable'. | |
2110 | This is not yet true, now labeled 'experimental'. | |
2111 | ||
2112 | Windows changes. We are indebted to Dimitry Andric who educated us in the | |
2113 | ways of distributing Windows software. | |
33ccb468 | 2114 | |
2115 | * pdns.conf is now read if available. | |
d16e0461 | 2116 | |
33ccb468 | 2117 | * Console version responds to ^c now. |
d16e0461 | 2118 | |
33ccb468 | 2119 | * Default pdns.conf added to distribution |
d16e0461 | 2120 | |
33ccb468 | 2121 | * Uninstaller missed several files, leaving remnants behind |
d16e0461 | 2122 | |
33ccb468 | 2123 | * DLLs are now installed locally, with the pdns executable. |
d16e0461 | 2124 | |
33ccb468 | 2125 | * pdns_control is now also available on Windows |
d16e0461 | 2126 | |
33ccb468 | 2127 | * ODBC backend can now act as master and slave. Experimental. |
d16e0461 | 2128 | |
33ccb468 | 2129 | * The example zone missed indexes and had other faults. |
33ccb468 | 2130 | |
d16e0461 TP |
2131 | * A runtime DLL that is present on most windows systems (but not all!) |
2132 | was missing. | |
2133 | ||
2134 | ---------------------------------------------------------------------- | |
33ccb468 | 2135 | |
fc2fb8ea | 2136 | 1.3.31. Version 1.99.12 Prerelease |
33ccb468 | 2137 | |
d16e0461 TP |
2138 | The Windows release! See Chapter 3. Beware, windows support is still very |
2139 | fresh and untested. Feedback is very welcome. | |
2140 | ||
2141 | Developers: this version is compatible with 1.99.11 backends. | |
33ccb468 | 2142 | |
2143 | * Windows 2000 codebase merge completed. This resulted in quite some | |
2144 | changes on the Unix end of things, so this may impact reliability | |
d16e0461 TP |
2145 | |
2146 | * ODBC backend added for Windows. See Section A.10. | |
2147 | ||
2148 | * IBM DB2 Universal Database backend available for Linux. See Section | |
2149 | A.8. | |
2150 | ||
33ccb468 | 2151 | * Zone2sql now understands $INCLUDE. Thanks to Amaze Internet for |
2152 | nagging about this | |
d16e0461 | 2153 | |
33ccb468 | 2154 | * The SOA Mininum TTL now has a configurable default |
2155 | (soa-minimum-ttl)value to placate the DENIC requirements. | |
d16e0461 TP |
2156 | |
2157 | * Added a limit on the simultaneous numbers of TCP connections to accept | |
2158 | (max-tcp-connections). Defaults to 10. | |
33ccb468 | 2159 | |
2160 | Bugs fixed: | |
2161 | ||
d16e0461 TP |
2162 | * When operating in virtual hosting mode (See Chapter 8), the additional |
2163 | init.d scripts would not function correctly and interface with other | |
2164 | pdns instances. | |
2165 | ||
33ccb468 | 2166 | * PDNS neglected to conserve case on answers. So a query for |
2167 | WwW.PoWeRdNs.CoM would get an answer listing the address of | |
d16e0461 TP |
2168 | www.powerdns.com. While this did not confuse resolvers, it is better |
2169 | to conserve case. This has semantical concequences for all backends, | |
2170 | which the documentation now spells out. | |
2171 | ||
33ccb468 | 2172 | * PostgreSQL backend was case sensitive and returned only answers in |
d16e0461 TP |
2173 | case an exact match was found. The Generic PostgreSQL backend is now |
2174 | officially all lower case and zone2sql in PostgreSQL mode enforces | |
2175 | this. Documentation has been been updated to reflect the case change. | |
2176 | Thanks to Maikel Verheijen of Ladot for spotting this! | |
2177 | ||
33ccb468 | 2178 | * Documentation bug - postgresql create/index statements created a |
d16e0461 TP |
2179 | duplicate index. If you've previously copy pasted the commands and not |
2180 | noticed the error, execute CREATE INDEX rec_name_index ON | |
33ccb468 | 2181 | records(name) to remedy. Thanks to Jeff Miller for reporting this. |
2182 | This also lead to depressingly slow 'ANY' lookups for those of you | |
2183 | doing benchmarks. | |
2184 | ||
2185 | Features: | |
2186 | ||
d16e0461 TP |
2187 | * pdns_control (see Section B.1.1) now opens the local end of its socket |
2188 | in /tmp instead of next to the remote socket (by default /var/run). | |
2189 | This eases the way for allowing non-root access to pdns_control. When | |
2190 | running chrooted (see Chapter 7), the local socket again moves back to | |
2191 | /var/run. | |
33ccb468 | 2192 | |
d16e0461 | 2193 | * pdns_control now has a 'version' command. See Section B.1.1. |
33ccb468 | 2194 | |
d16e0461 | 2195 | ---------------------------------------------------------------------- |
33ccb468 | 2196 | |
fc2fb8ea | 2197 | 1.3.32. Version 1.99.11 Prerelease |
33ccb468 | 2198 | |
d16e0461 TP |
2199 | This release is important because it is the first release which is |
2200 | accompanied by an Open Source Backend Development Kit, allowing external | |
2201 | developers to write backends for PDNS. Furthermore, a few bugs have been | |
2202 | fixed: | |
33ccb468 | 2203 | |
d16e0461 TP |
2204 | * Lines with only whitespace in zone files confused PDNS (thanks Henk |
2205 | Wevers) | |
33ccb468 | 2206 | |
d16e0461 TP |
2207 | * PDNS did not properly parse TTLs with symbolic sufixes in zone files, |
2208 | ie 2H instead of 7200 (thanks Henk Wevers) | |
33ccb468 | 2209 | |
d16e0461 | 2210 | ---------------------------------------------------------------------- |
33ccb468 | 2211 | |
fc2fb8ea | 2212 | 1.3.33. Version 1.99.10 Prerelease |
33ccb468 | 2213 | |
d16e0461 TP |
2214 | IMPORTANT: there has been a tiny license change involving free public |
2215 | webbased dns hosting, check out the changes before deploying! | |
2216 | ||
2217 | PDNS is now feature complete, or very nearly so. Besides adding features, | |
2218 | a lot of 'fleshing out' work is done now. There is an important | |
2219 | performance bug fix which may have lead to disappointing benchmarks - so | |
2220 | if you saw any of that, please try either this version or 1.99.8 which | |
2221 | also does not have the bug. | |
2222 | ||
2223 | This version has been very stable for us on multiple hosts, as was 1.99.9. | |
2224 | ||
2225 | PostgreSQL users should be aware that while 1.99.10 works with the schema | |
2226 | as presented in earlier versions, advanced features such as master or | |
2227 | slave support will not work unless you create the new 'domains' table as | |
2228 | well. | |
2229 | ||
2230 | Bugs fixed: | |
2231 | ||
2232 | * Wildcard AAAA queries sometimes received an NXDOMAIN error where they | |
2233 | should have gotten an empty NO ERROR. Thanks to Jeroen Massar for | |
2234 | spotting this on the .TK TLD! | |
2235 | ||
2236 | * Do not disable the packetcache for 'recursion desired' packets unless | |
2237 | a recursor was configured. Thanks to Greg Schueler for noticing this. | |
2238 | ||
2239 | * A failing backend would not be reinstated. Thanks to 'Webspider' for | |
2240 | discovering this problem with PostgreSQL connections that die after | |
2241 | prolonged inactivity. | |
33ccb468 | 2242 | |
33ccb468 | 2243 | * Fixed loads of IPv6 transport problems. Thanks to Marco Davids and |
2244 | others for testing. Considered ready for production now. | |
d16e0461 TP |
2245 | |
2246 | * Zone2sql printed a debugging statement on range $GENERATE commands. | |
2247 | Thanks to Rene van Valkenburg for spotting this. | |
33ccb468 | 2248 | |
2249 | Features: | |
2250 | ||
2251 | * PDNS can now act as a master, sending out notifications in case of | |
2252 | changes and allowing slaves to AXFR. Big rewording of replication | |
2253 | support, domains are now either 'native', 'master' or 'slave'. See | |
d16e0461 TP |
2254 | Chapter 13 for lots of details. |
2255 | ||
2256 | * Zone2sql in PostgreSQL mode now populates the 'domains' table for easy | |
2257 | master, slave or native replication support. | |
2258 | ||
2259 | * Ability to disable those annoying Windows DNS Dynamic Update messages | |
2260 | from appearing in the log. See log-failed-updates in Chapter 15. | |
2261 | ||
33ccb468 | 2262 | * Ability to run on IPv6 transport only |
d16e0461 TP |
2263 | |
2264 | * Logging can now happen under a 'facility' so all PDNS messages appear | |
2265 | in their own file. See Section 6.3. | |
2266 | ||
2267 | * Different OS releases of PDNS now get different install path defaults. | |
2268 | Thanks to Mark Lastdrager for nagging about this and to Nero Imhard | |
2269 | and Frederique Rijsdijk for suggesting saner defaults. | |
2270 | ||
33ccb468 | 2271 | * Infrastructure for 'also-notify' statements added. |
33ccb468 | 2272 | |
d16e0461 TP |
2273 | ---------------------------------------------------------------------- |
2274 | ||
fc2fb8ea | 2275 | 1.3.34. Version 1.99.9 Early Access Prerelease |
d16e0461 TP |
2276 | |
2277 | This is again a feature and an infrastructure release. We are nearly | |
2278 | feature complete and will soon start work on the backends to make sure | |
2279 | that they are all master, slave and 'superslave' capable. | |
2280 | ||
2281 | Bugs fixed: | |
2282 | ||
2283 | * PDNS sometimes sent out duplicate replies for packets passed to the | |
2284 | recursing backend. Mostly a problem on SMP systems. Thanks to Mike | |
2285 | Benoit for noticing this. | |
33ccb468 | 2286 | |
d16e0461 TP |
2287 | * Out-of-bailiwick CNAMES (ie, a CNAME to a domain not in PDNS) caused a |
2288 | 'ServFail' packet in 1.99.8, indicating failure, leading to hosts not | |
2289 | resolving. Thanks to Martin Gillstrom for noticing this. | |
33ccb468 | 2290 | |
d16e0461 TP |
2291 | * Zone2sql balked at zones editted under operating sytems terminating |
2292 | files with ^Z (Windows). Thanks Brian Willcott for reporting this. | |
33ccb468 | 2293 | |
d16e0461 TP |
2294 | * PostgreSQL backend logged the password used to connect. Now only does |
2295 | so in case of failure to connect. Thanks to 'Webspider' for noticing | |
33ccb468 | 2296 | this. |
d16e0461 | 2297 | |
33ccb468 | 2298 | * Debian unstable distribution wrongly depended on home compiled |
2299 | PostgreSQL libraries. Thanks to Konrad Wojas for noticing this. | |
2300 | ||
2301 | Features: | |
2302 | ||
d16e0461 TP |
2303 | * When operating as a slave, AAAA records are now supported in the zone. |
2304 | They were already supported in master zones. | |
2305 | ||
2306 | * IPv6 transport support - PDNS can now listen on an IPv6 socket using | |
2307 | the local-ipv6 setting. | |
2308 | ||
2309 | * Very silly randombackend added which appears in the documentation as a | |
2310 | sample backend. See Appendix C. | |
2311 | ||
2312 | * When transferring a slave zone from a master, out of zone data is now | |
2313 | rejected. Malicious operators might try to insert bad records | |
33ccb468 | 2314 | otherwise. |
d16e0461 | 2315 | |
33ccb468 | 2316 | * 'Supermaster' support for automatic provisioning from masters. See |
d16e0461 TP |
2317 | Section 13.2.1. |
2318 | ||
33ccb468 | 2319 | * Recursing backend can now live on a non-standard (!=53) port. See |
d16e0461 TP |
2320 | Chapter 11. |
2321 | ||
2322 | * Slave zone retrieval is now queued instead of immediate, which scales | |
2323 | better and is more resilient to temporary failures. | |
2324 | ||
33ccb468 | 2325 | * max-queue-length parameter. If this many packets are queued for |
2326 | database attention, consider the situation hopeless and respawn. | |
2327 | ||
2328 | Internal: | |
2329 | ||
d16e0461 TP |
2330 | * SOA records are now 'special' and each backend can optionally generate |
2331 | them in special ways. PostgreSQL backend does so when operating as a | |
2332 | slave. | |
2333 | ||
2334 | * Writing backends is now a lot easier. See Appendix C. | |
2335 | ||
2336 | * Added Bindbackend to internal regression tests, confirming that it is | |
2337 | compliant. | |
2338 | ||
2339 | ---------------------------------------------------------------------- | |
2340 | ||
fc2fb8ea | 2341 | 1.3.35. Version 1.99.8 Early Access Prerelease |
d16e0461 TP |
2342 | |
2343 | A lot of infrastructure work gearing up to 2.0. Some stability bugs fixed | |
2344 | and a lot of new features. | |
2345 | ||
2346 | Bugs fixed: | |
33ccb468 | 2347 | |
d16e0461 TP |
2348 | * Bindbackend was overly complex and crashed on some systems on startup. |
2349 | Simplified launch code. | |
33ccb468 | 2350 | |
d16e0461 TP |
2351 | * SOA fields were not always properly filled in, causing default values |
2352 | to go out on the wire | |
33ccb468 | 2353 | |
d16e0461 TP |
2354 | * Obscure bug triggered by malicious packets (we know who you are) in |
2355 | SOA finding code fixed. | |
33ccb468 | 2356 | |
33ccb468 | 2357 | * Magic serial number calculation contained a double free leading to |
2358 | instability. | |
d16e0461 | 2359 | |
33ccb468 | 2360 | * Standards violation, questions for domains for which PDNS was |
2361 | unauthoritative now get a SERVFAIL answer. Thanks to the IETF | |
2362 | Namedroppers list for helping out with this. | |
d16e0461 TP |
2363 | |
2364 | * Slowly launching backends were being relaunched at a great rate when | |
2365 | queries were coming in while launching backends. | |
2366 | ||
33ccb468 | 2367 | * MySQL-on-unix-domain-socket on SMP systems was overwhelmed by the |
2368 | quick connection rate on launch, inserted a small 50ms delay. | |
d16e0461 TP |
2369 | |
2370 | * Some SMP problems appear to be compiler related. Shifted to GCC 3.0.4 | |
2371 | for Linux. | |
2372 | ||
33ccb468 | 2373 | * Ran ispell on documentation. |
2374 | ||
2375 | Feature enhancements: | |
2376 | ||
d16e0461 TP |
2377 | * Recursing backend. See Chapter 11. Allows recursive and authoritative |
2378 | DNS on the same IP address. | |
2379 | ||
2380 | * NAPTR support, which is especially useful for the ENUM/E.164 | |
33ccb468 | 2381 | community. |
d16e0461 TP |
2382 | |
2383 | * Zone transfers can now be allowed per netmask instead of only per IP | |
2384 | address. | |
2385 | ||
33ccb468 | 2386 | * Preliminary support for slave operation included. Only for the |
d16e0461 TP |
2387 | adventurous right now! See Section 13.2 |
2388 | ||
2389 | * All record types now documented, see Chapter 17. | |
2390 | ||
2391 | ---------------------------------------------------------------------- | |
2392 | ||
fc2fb8ea | 2393 | 1.3.35.1. Known bugs |
33ccb468 | 2394 | |
d16e0461 | 2395 | Wildcard CNAMES do not work as they do with bind. |
33ccb468 | 2396 | |
d16e0461 TP |
2397 | Recursion sometimes sends out duplicate packets (fixed in 1.99.9 |
2398 | snapshots) | |
33ccb468 | 2399 | |
d16e0461 | 2400 | Some stability issues which are caught by the guardian |
33ccb468 | 2401 | |
d16e0461 | 2402 | ---------------------------------------------------------------------- |
33ccb468 | 2403 | |
fc2fb8ea | 2404 | 1.3.35.2. Missing features |
33ccb468 | 2405 | |
d16e0461 TP |
2406 | Features present in this document, but disabled or withheld from the |
2407 | current release: | |
33ccb468 | 2408 | |
2409 | * gmysqlbackend, oraclebackend | |
33ccb468 | 2410 | |
d16e0461 | 2411 | ---------------------------------------------------------------------- |
33ccb468 | 2412 | |
fc2fb8ea | 2413 | 1.3.36. Version 1.99.7 Early Access Prerelease |
33ccb468 | 2414 | |
d16e0461 TP |
2415 | Named.conf parsing got a lot of work and many more bind configurations can |
2416 | now be parsed. Furthermore, error reporting was improved. Stability is | |
2417 | looking good. | |
2418 | ||
2419 | Bugs fixed: | |
33ccb468 | 2420 | |
2421 | * Bind parser got confused by filenames with underscores and colons. | |
d16e0461 | 2422 | |
33ccb468 | 2423 | * Bind parser got confused by spaces in quoted names |
d16e0461 | 2424 | |
33ccb468 | 2425 | * FreeBSD version now stops and starts when instructed to do so. |
d16e0461 | 2426 | |
33ccb468 | 2427 | * Wildcards were off by default, which violates standards. Now on by |
2428 | default. | |
d16e0461 | 2429 | |
33ccb468 | 2430 | * --oracle was broken in zone2sql |
2431 | ||
2432 | Feature enhancements: | |
2433 | ||
2434 | * Line number counting goes on as it should when including files in | |
2435 | named.conf | |
d16e0461 | 2436 | |
33ccb468 | 2437 | * Added --no-config to enable users to start the pdns daemon without |
2438 | parsing the configuration file. | |
d16e0461 TP |
2439 | |
2440 | * zone2sql now has --bare for unformatted output which can be used to | |
2441 | generate insert statements for different database layouts | |
2442 | ||
2443 | * zone2sql now has --gpgsql, which is an alias for --mysql, to output in | |
2444 | a format useful for the default Generic PgSQL backend | |
2445 | ||
33ccb468 | 2446 | * zone2sql is now documented. |
33ccb468 | 2447 | |
d16e0461 TP |
2448 | ---------------------------------------------------------------------- |
2449 | ||
fc2fb8ea | 2450 | 1.3.36.1. Known bugs |
d16e0461 TP |
2451 | |
2452 | Wildcard CNAMES do not work as they do with bind. | |
33ccb468 | 2453 | |
d16e0461 | 2454 | ---------------------------------------------------------------------- |
33ccb468 | 2455 | |
fc2fb8ea | 2456 | 1.3.36.2. Missing features |
33ccb468 | 2457 | |
d16e0461 TP |
2458 | Features present in this document, but disabled or withheld from the |
2459 | current release: | |
33ccb468 | 2460 | |
2461 | * gmysqlbackend, oraclebackend | |
2462 | ||
d16e0461 | 2463 | Some of these features will be present in newer releases. |
33ccb468 | 2464 | |
d16e0461 | 2465 | ---------------------------------------------------------------------- |
33ccb468 | 2466 | |
fc2fb8ea | 2467 | 1.3.37. Version 1.99.6 Early Access Prerelease |
33ccb468 | 2468 | |
d16e0461 TP |
2469 | This version is now running on dns-eu1.powerdns.net and working very well |
2470 | for us. But please remain cautious before deploying! | |
2471 | ||
2472 | Bugs fixed: | |
33ccb468 | 2473 | |
2474 | * Webserver neglected to show log messages | |
d16e0461 | 2475 | |
33ccb468 | 2476 | * TCP question/answer miscounted multiple questions over one socket. |
2477 | Fixed misnaming of counter | |
d16e0461 | 2478 | |
33ccb468 | 2479 | * Packetcache now detects clock skew and times out entries |
d16e0461 TP |
2480 | |
2481 | * named.conf parser now reports errors with line number and offending | |
2482 | token | |
2483 | ||
33ccb468 | 2484 | * Filenames in named.conf can now contain : |
2485 | ||
2486 | Feature enhancements: | |
2487 | ||
2488 | * The webserver now by default does not print out configuration | |
2489 | statements, which might contain database backends. Use | |
2490 | webserver-print-arguments to restore the old behaviour. | |
d16e0461 | 2491 | |
33ccb468 | 2492 | * Generic PostgreSQL backend is now included. Still rather beta. |
33ccb468 | 2493 | |
d16e0461 TP |
2494 | ---------------------------------------------------------------------- |
2495 | ||
fc2fb8ea | 2496 | 1.3.37.1. Known bugs |
33ccb468 | 2497 | |
d16e0461 | 2498 | FreeBSD version does not stop when requested to do so. |
33ccb468 | 2499 | |
d16e0461 | 2500 | Wildcard CNAMES do not work as they do with bind. |
33ccb468 | 2501 | |
d16e0461 | 2502 | ---------------------------------------------------------------------- |
33ccb468 | 2503 | |
fc2fb8ea | 2504 | 1.3.37.2. Missing features |
d16e0461 TP |
2505 | |
2506 | \r Features present in this document, but disabled or withheld from the | |
2507 | current release: | |
33ccb468 | 2508 | |
2509 | * gmysqlbackend, oraclebackend | |
2510 | ||
d16e0461 TP |
2511 | Some of these features will be present in newer releases. |
2512 | ||
2513 | ---------------------------------------------------------------------- | |
33ccb468 | 2514 | |
fc2fb8ea | 2515 | 1.3.38. Version 1.99.5 Early Access Prerelease |
33ccb468 | 2516 | |
d16e0461 TP |
2517 | The main focus of this release is stability and TCP improvements. This is |
2518 | the first release PowerDNS-the-company actually considers for running on | |
2519 | its production servers! | |
33ccb468 | 2520 | |
d16e0461 | 2521 | Major bugs fixed: |
33ccb468 | 2522 | |
2523 | * Zone2sql received a floating point division by zero error on | |
2524 | named.confs with less than 100 domains. | |
d16e0461 TP |
2525 | |
2526 | * Huffman encoder failed without specific error on illegal characters in | |
2527 | a domain | |
2528 | ||
33ccb468 | 2529 | * Fixed huge memory leaks in TCP code. |
d16e0461 | 2530 | |
33ccb468 | 2531 | * Removed further file descriptor leaks in guardian respawning code |
d16e0461 | 2532 | |
33ccb468 | 2533 | * Pipebackend was too chatty. |
d16e0461 | 2534 | |
33ccb468 | 2535 | * pdns_server neglected to close fds 0, 1 & 2 when daemonizing |
2536 | ||
2537 | Feature enhancements: | |
2538 | ||
2539 | * bindbackend can be instructed not to check the ctime of a zone by | |
2540 | specifying bind-check-interval=0, which is also the new default. | |
d16e0461 | 2541 | |
33ccb468 | 2542 | * pdns_server --list-modules lists all available modules. |
2543 | ||
2544 | Performance enhancements: | |
2545 | ||
2546 | * TCP code now only creates a new database connection for AXFR. | |
33ccb468 | 2547 | |
d16e0461 TP |
2548 | * TCP connections timeout rather quickly now, leading to less load on |
2549 | the server. | |
33ccb468 | 2550 | |
d16e0461 | 2551 | ---------------------------------------------------------------------- |
33ccb468 | 2552 | |
fc2fb8ea | 2553 | 1.3.38.1. Known bugs |
33ccb468 | 2554 | |
d16e0461 | 2555 | FreeBSD version does not stop when requested to do so. |
33ccb468 | 2556 | |
d16e0461 TP |
2557 | Wildcard CNAMES do not work as they do with bind. |
2558 | ||
2559 | ---------------------------------------------------------------------- | |
2560 | ||
fc2fb8ea | 2561 | 1.3.38.2. Missing features |
d16e0461 TP |
2562 | |
2563 | \r Features present in this document, but disabled or withheld from the | |
2564 | current release: | |
33ccb468 | 2565 | |
2566 | * gmysqlbackend, oraclebackend, gpgsqlbackend | |
2567 | ||
d16e0461 TP |
2568 | Some of these features will be present in newer releases. |
2569 | ||
2570 | ---------------------------------------------------------------------- | |
33ccb468 | 2571 | |
fc2fb8ea | 2572 | 1.3.39. Version 1.99.4 Early Access Prerelease |
33ccb468 | 2573 | |
d16e0461 TP |
2574 | A lot of new named.confs can now be parsed, zone2sql & bindbackend have |
2575 | gained features and stability. | |
33ccb468 | 2576 | |
d16e0461 | 2577 | Major bugs fixed: |
33ccb468 | 2578 | |
2579 | * Label compression was not always enabled, leading to large reply | |
2580 | packets sometimes. | |
d16e0461 | 2581 | |
33ccb468 | 2582 | * Database errors on TCP server lead to a nameserver reload by the |
2583 | guardian. | |
d16e0461 | 2584 | |
33ccb468 | 2585 | * MySQL backend neglected to close its connection properly. |
d16e0461 | 2586 | |
33ccb468 | 2587 | * BindParser miss parsed some IP addresses and netmasks. |
d16e0461 TP |
2588 | |
2589 | * Truncated answers were also truncated on the packetcache, leading to | |
2590 | truncated TCP answers. | |
33ccb468 | 2591 | |
2592 | Feature enhancements: | |
2593 | ||
2594 | * Zone2sql and the bindbackend now understand the Bind $GENERATE{} | |
2595 | syntax. | |
d16e0461 | 2596 | |
33ccb468 | 2597 | * Zone2sql can optionally gloss over non-existing zones with |
2598 | --on-error-resume-next. | |
d16e0461 TP |
2599 | |
2600 | * Zone2sql and the bindbackend now properly expand @ also on the right | |
2601 | hand side of records. | |
2602 | ||
33ccb468 | 2603 | * Zone2sql now sets a default TTL. |
d16e0461 | 2604 | |
33ccb468 | 2605 | * DNS UPDATEs and NOTIFYs are now logged properly and sent the right |
2606 | responses. | |
2607 | ||
2608 | Performance enhancements: | |
2609 | ||
d16e0461 TP |
2610 | * 'Fancy records' are no longer queried for on ANY queries - this is a |
2611 | big speedup. | |
33ccb468 | 2612 | |
d16e0461 | 2613 | ---------------------------------------------------------------------- |
33ccb468 | 2614 | |
fc2fb8ea | 2615 | 1.3.39.1. Known bugs |
33ccb468 | 2616 | |
d16e0461 | 2617 | FreeBSD version does not stop when requested to do so. |
33ccb468 | 2618 | |
d16e0461 | 2619 | Zone2sql refuses named.confs with less than 100 domains. |
33ccb468 | 2620 | |
d16e0461 | 2621 | Wildcard CNAMES do not work as they do with bind. |
33ccb468 | 2622 | |
d16e0461 TP |
2623 | ---------------------------------------------------------------------- |
2624 | ||
fc2fb8ea | 2625 | 1.3.39.2. Missing features |
d16e0461 TP |
2626 | |
2627 | \r Features present in this document, but disabled or withheld from the | |
2628 | current release: | |
33ccb468 | 2629 | |
2630 | * gmysqlbackend, oraclebackend, gpgsqlbackend | |
2631 | ||
d16e0461 | 2632 | Some of these features will be present in newer releases. |
33ccb468 | 2633 | |
d16e0461 | 2634 | ---------------------------------------------------------------------- |
33ccb468 | 2635 | |
fc2fb8ea | 2636 | 1.3.40. Version 1.99.3 Early Access Prerelease |
33ccb468 | 2637 | |
d16e0461 TP |
2638 | The big news in this release is the BindBackend which is now capable of |
2639 | parsing many more named.conf Bind configurations. Furthermore, PDNS has | |
2640 | successfully parsed very large named.confs with large numbers of small | |
2641 | domains, as well as small numbers of large domains (TLD). | |
33ccb468 | 2642 | |
d16e0461 TP |
2643 | Zone transfers are now also much improved. |
2644 | ||
2645 | Major bugs fixed: | |
33ccb468 | 2646 | |
2647 | * zone2sql leaked file descriptors on each domain, used wrong Bison | |
d16e0461 TP |
2648 | recursion leading to parser stack overflows. This limited the amount |
2649 | of domains that could be parsed to 1024. | |
2650 | ||
2651 | * zone2sql can now read all known zonefiles, with the exception of those | |
2652 | containing $GENERATE | |
2653 | ||
33ccb468 | 2654 | * Guardian relaunching a child lost two file descriptors |
d16e0461 | 2655 | |
33ccb468 | 2656 | * Don't die on a connection reset by peer during zone transfer. |
d16e0461 | 2657 | |
33ccb468 | 2658 | * Webserver does not crash anymore on ringbuffer resize |
2659 | ||
2660 | Feature enhancements: | |
2661 | ||
2662 | * AXFR can now be disabled, and re-enabled per IP address | |
d16e0461 TP |
2663 | |
2664 | * --help accepts a parameter, will then show only help items with that | |
2665 | prefix. | |
2666 | ||
33ccb468 | 2667 | * zone2sql now accepts a --zone-name parameter |
d16e0461 | 2668 | |
33ccb468 | 2669 | * BindBackend maturing - 9500 zones parsed in 3.5 seconds. No longer |
2670 | case sensitive. | |
2671 | ||
2672 | Performance enhancements: | |
2673 | ||
d16e0461 TP |
2674 | * Implemented RFC-breaking AXFR format (which is the industry standard). |
2675 | Zone transfers now zoom along at wirespeed (many megabits/s). | |
2676 | ||
2677 | ---------------------------------------------------------------------- | |
2678 | ||
fc2fb8ea | 2679 | 1.3.40.1. Known bugs |
33ccb468 | 2680 | |
d16e0461 | 2681 | FreeBSD version does not stop when requested to do so. |
33ccb468 | 2682 | |
d16e0461 | 2683 | BindBackend cannot parse zones with $GENERATE statements. |
33ccb468 | 2684 | |
d16e0461 | 2685 | ---------------------------------------------------------------------- |
33ccb468 | 2686 | |
fc2fb8ea | 2687 | 1.3.40.2. Missing features |
33ccb468 | 2688 | |
d16e0461 TP |
2689 | \r Features present in this document, but disabled or withheld from the |
2690 | current release: | |
33ccb468 | 2691 | |
2692 | * gmysqlbackend, oraclebackend, gpgsqlbackend | |
2693 | ||
d16e0461 | 2694 | Some of these features will be present in newer releases. |
33ccb468 | 2695 | |
d16e0461 | 2696 | ---------------------------------------------------------------------- |
33ccb468 | 2697 | |
fc2fb8ea | 2698 | 1.3.41. Version 1.99.2 Early Access Prerelease |
d16e0461 TP |
2699 | |
2700 | Major bugs fixed: | |
33ccb468 | 2701 | |
2702 | * Database backend reload does not hang the daemon anymore | |
d16e0461 TP |
2703 | |
2704 | * Buffer overrun in local socket address initialisation may have caused | |
2705 | binding problems | |
2706 | ||
33ccb468 | 2707 | * setuid changed the uid to the gid of the selected user |
33ccb468 | 2708 | |
d16e0461 TP |
2709 | * zone2sql doesn't coredump on invocation anymore. Fixed lots of small |
2710 | issues. | |
2711 | ||
2712 | * Don't parse configuration file when creating configuration file. This | |
2713 | was a problem with reinstalling. | |
2714 | ||
2715 | Performance improvements: | |
33ccb468 | 2716 | |
2717 | * removed a lot of unnecessary gettimeofday calls | |
d16e0461 | 2718 | |
33ccb468 | 2719 | * removed needless select(2) call in case of listening on only one |
2720 | address | |
d16e0461 | 2721 | |
33ccb468 | 2722 | * removed 3 useless syscalls in the fast path |
2723 | ||
2724 | Having said that, more work may need to be done. Testing on a 486 saw | |
d16e0461 TP |
2725 | packet rates in a simple setup (question/wait/answer/question..) improve |
2726 | from 200 queries/second to over 400. | |
33ccb468 | 2727 | |
2728 | Usability improvements: | |
2729 | ||
2730 | * Fixed error checking in init.d script (show, mrtg) | |
d16e0461 | 2731 | |
33ccb468 | 2732 | * Added 'uptime' to the mrtg output |
d16e0461 TP |
2733 | |
2734 | * removed further GNUisms from installer and init.d scripts for use on | |
2735 | FreeBSD | |
2736 | ||
33ccb468 | 2737 | * Debian package and apt repository, thanks to Wichert Akkerman. |
d16e0461 | 2738 | |
33ccb468 | 2739 | * FreeBSD /usr/ports, thanks to Peter van Dijk (in progress). |
2740 | ||
2741 | Stability may be an issue as well as performance. This version has a | |
2742 | tendency to log a bit too much which slows the nameserver down a lot. | |
33ccb468 | 2743 | |
d16e0461 TP |
2744 | ---------------------------------------------------------------------- |
2745 | ||
fc2fb8ea | 2746 | 1.3.41.1. Known bugs |
33ccb468 | 2747 | |
d16e0461 TP |
2748 | Decreasing a ringbuffer on the website is a sure way to crash the daemon. |
2749 | Zone2sql, while improved, still has problems with a zone in the following | |
2750 | format: | |
33ccb468 | 2751 | |
d16e0461 TP |
2752 | name IN A 1.2.3.4 |
2753 | IN A 1.2.3.5 | |
2754 | ||
33ccb468 | 2755 | |
d16e0461 | 2756 | To fix, add 'name' to the second line. |
33ccb468 | 2757 | |
2758 | Zone2sql does not close filedescriptors. | |
2759 | ||
d16e0461 TP |
2760 | \r |
2761 | ||
33ccb468 | 2762 | FreeBSD version does not stop when requested via the init.d script. |
33ccb468 | 2763 | |
d16e0461 TP |
2764 | \r |
2765 | ||
2766 | ---------------------------------------------------------------------- | |
33ccb468 | 2767 | |
fc2fb8ea | 2768 | 1.3.41.2. Missing features |
d16e0461 TP |
2769 | |
2770 | Features present in this document, but disabled or withheld from the | |
2771 | current release: | |
33ccb468 | 2772 | |
2773 | * gmysqlbackend, oraclebackend, gpgsqlbackend | |
d16e0461 | 2774 | |
33ccb468 | 2775 | * fully functioning bindbackend - will try to parse named.conf, but |
2776 | probably fail | |
2777 | ||
d16e0461 | 2778 | Some of these features will be present in newer releases. |
33ccb468 | 2779 | |
d16e0461 | 2780 | ---------------------------------------------------------------------- |
33ccb468 | 2781 | |
fc2fb8ea | 2782 | 1.3.42. Version 1.99.1 Early Access Prerelease |
33ccb468 | 2783 | |
d16e0461 TP |
2784 | This is the first public release of what is going to become PDNS 2.0. As |
2785 | such, it is not of production quality. Even PowerDNS-the-company does not | |
2786 | run this yet. | |
33ccb468 | 2787 | |
d16e0461 TP |
2788 | Stability may be an issue as well as performance. This version has a |
2789 | tendency to log a bit too much which slows the nameserver down a lot. | |
2790 | ||
2791 | ---------------------------------------------------------------------- | |
2792 | ||
fc2fb8ea | 2793 | 1.3.42.1. Known bugs |
33ccb468 | 2794 | |
d16e0461 TP |
2795 | Decreasing a ringbuffer on the website is a sure way to crash the daemon. |
2796 | Zone2sql is very buggy. | |
33ccb468 | 2797 | |
d16e0461 | 2798 | ---------------------------------------------------------------------- |
33ccb468 | 2799 | |
fc2fb8ea | 2800 | 1.3.42.2. Missing features |
d16e0461 TP |
2801 | |
2802 | Features present in this document, but disabled or withheld from the | |
2803 | current release: | |
33ccb468 | 2804 | |
2805 | * gmysqlbackend, oraclebackend, gpgsqlbackend | |
d16e0461 | 2806 | |
33ccb468 | 2807 | * fully functioning bindbackend - will not parse configuration files |
2808 | ||
d16e0461 TP |
2809 | Some of these features will be present in newer releases. |
2810 | ||
2811 | ---------------------------------------------------------------------- | |
33ccb468 | 2812 | |
2813 | 1.4. Security | |
2814 | ||
d16e0461 TP |
2815 | As of the 8th of January 2003, no actual security problems with PowerDNS |
2816 | 2.9.4 or later are known about. This page will be updated with all bugs | |
2817 | which are deemed to be security problems, or could conceivably lead to | |
2818 | those. Any such notifications will also be sent to all PowerDNS | |
2819 | mailinglists and BUGTRAQ. | |
2820 | ||
2821 | All versions of PowerDNS before 2.9 are known to suffer from remote denial | |
2822 | of service problems which can disrupt operation. Please upgrade to 2.9.4 | |
2823 | as this page will only contain detailed security information from 2.9.4 | |
2824 | onwards. | |
33ccb468 | 2825 | |
d16e0461 TP |
2826 | If you have a security problem to report, please email us at both |
2827 | <powerdns@powerdns.com> and at <ahu@ds9a.nl>. We adhere to the Rain Forest | |
2828 | Puppy Full Disclosure Policy (RFPolicy) v2.0 and we ask you to do the | |
2829 | same. | |
33ccb468 | 2830 | |
d16e0461 TP |
2831 | We remind PowerDNS users that under the terms of the GNU General Public |
2832 | License, PowerDNS comes with ABSOLUTELY NO WARRANTY. This license is | |
2833 | included in the distribution and in this documentation, see Appendix E. | |
33ccb468 | 2834 | |
d16e0461 | 2835 | ---------------------------------------------------------------------- |
33ccb468 | 2836 | |
2837 | 1.5. Acknowledgements | |
2838 | ||
d16e0461 | 2839 | PowerDNS is grateful for the help of the following people or institutions: |
33ccb468 | 2840 | |
2841 | * Dave Aaldering | |
d16e0461 | 2842 | |
33ccb468 | 2843 | * Wichert Akkerman |
d16e0461 | 2844 | |
33ccb468 | 2845 | * Antony Antony |
d16e0461 | 2846 | |
33ccb468 | 2847 | * Mike Benoit (NetNation Communication Inc.) |
d16e0461 | 2848 | |
33ccb468 | 2849 | * Peter van Dijk |
d16e0461 | 2850 | |
33ccb468 | 2851 | * Koos van den Hout |
d16e0461 | 2852 | |
33ccb468 | 2853 | * Andre Koopal |
d16e0461 | 2854 | |
33ccb468 | 2855 | * Eric Veldhuyzen |
d16e0461 | 2856 | |
33ccb468 | 2857 | * Paul Wouters |
d16e0461 | 2858 | |
33ccb468 | 2859 | * Thomas Wouters |
d16e0461 | 2860 | |
33ccb468 | 2861 | * IETF Namedroppers mailinglist |
2862 | ||
d16e0461 TP |
2863 | Thanks! |
2864 | ||
2865 | (these people don't share the blame for any errors or mistakes in powerdns | |
2866 | - those are all ours) | |
2867 | ||
2868 | ---------------------------------------------------------------------- | |
33ccb468 | 2869 | |
d16e0461 | 2870 | Chapter 2. Installing on Unix |
33ccb468 | 2871 | |
d16e0461 TP |
2872 | You will typically install PDNS > 2.9 via source or via a package. Earlier |
2873 | versions used a clumsy binary installer. | |
33ccb468 | 2874 | |
d16e0461 | 2875 | ---------------------------------------------------------------------- |
33ccb468 | 2876 | |
2877 | 2.1. Possible problems at this point | |
2878 | ||
d16e0461 | 2879 | At this point some things may have gone wrong. Typical errors include: |
33ccb468 | 2880 | |
d16e0461 TP |
2881 | error while loading shared libraries: libstdc++.so.x: cannot open shared |
2882 | object file: No such file or directory | |
2883 | ||
2884 | Errors looking like this indicate a mismatch between your PDNS | |
2885 | distribution and your Unix operating system. Download the static | |
2886 | PDNS distribution for your operating system and try again. Please | |
2887 | contact <pdns@powerdns.com> if this is impractical. | |
2888 | ||
2889 | ---------------------------------------------------------------------- | |
33ccb468 | 2890 | |
2891 | 2.2. Testing your install | |
2892 | ||
d16e0461 TP |
2893 | After installing, it is a good idea to test the basic functionality of the |
2894 | software before configuring database backends. For this purpose, PowerDNS | |
2895 | contains the 'bindbackend' which has a domain built in example.com, which | |
2896 | is officially reserved for testing. To test, edit pdns.conf and add the | |
2897 | following if not already present: | |
2898 | ||
2899 | launch=bind | |
2900 | bind-example-zones | |
2901 | ||
2902 | ||
2903 | This configures powerdns to 'launch' the bindbackend, and enable the | |
2904 | example zones. To fire up PDNS in testing mode, execute: /etc/init.d/pdns | |
2905 | monitor, where you may have to substitute the location of your SysV init.d | |
2906 | location you specified earlier. In monitor mode, the pdns process runs in | |
2907 | the foreground and is very verbose, which is perfect for testing your | |
2908 | install. If everything went all right, you can query the example.com | |
2909 | domain like this: | |
2910 | ||
2911 | host www.example.com 127.0.0.1 | |
2912 | ||
2913 | ||
2914 | www.example.com should now have IP address 1.2.3.4. The host command can | |
2915 | usually be found in the dnsutils package of your operating system. | |
2916 | Alternate command is: dig www.example.com A @127.0.0.1 or even nslookup | |
2917 | www.example.com 127.0.0.1, although nslookup is not advised for DNS | |
2918 | diagnostics. | |
33ccb468 | 2919 | |
2920 | * example.com SOA record | |
d16e0461 | 2921 | |
33ccb468 | 2922 | * example.com NS record pointing to ns1.example.com |
d16e0461 | 2923 | |
33ccb468 | 2924 | * example.com NS record pointing to ns2.example.com |
d16e0461 | 2925 | |
33ccb468 | 2926 | * example.com MX record pointing to mail.example.com |
d16e0461 | 2927 | |
33ccb468 | 2928 | * example.com MX record pointing to mail1.example.com |
d16e0461 | 2929 | |
33ccb468 | 2930 | * mail.example.com A record pointing to 4.3.2.1 |
d16e0461 | 2931 | |
33ccb468 | 2932 | * mail1.example.com A record pointing to 5.4.3.2 |
d16e0461 | 2933 | |
33ccb468 | 2934 | * ns1.example.com A record pointing to 4.3.2.1 |
d16e0461 | 2935 | |
33ccb468 | 2936 | * ns2.example.com A record pointing to 5.4.3.2 |
d16e0461 | 2937 | |
33ccb468 | 2938 | * host-0 to host-9999.example.com A record pointing to 2.3.4.5 |
2939 | ||
d16e0461 TP |
2940 | When satisfied that basic functionality is there, type QUIT to exit the |
2941 | monitor mode. The adventurous may also type SHOW * to see some internal | |
2942 | statistics. In case of problems, you will want to read the following | |
2943 | section. | |
2944 | ||
2945 | ---------------------------------------------------------------------- | |
33ccb468 | 2946 | |
d16e0461 | 2947 | 2.2.1. Typical errors |
33ccb468 | 2948 | |
d16e0461 | 2949 | At this point some things may have gone wrong. Typical errors include: |
33ccb468 | 2950 | |
2951 | binding to UDP socket: Address already in use | |
d16e0461 TP |
2952 | |
2953 | This means that another nameserver is listening on port 53 | |
2954 | already. You can resolve this problem by determining if it is safe | |
2955 | to shutdown the nameserver already present, and doing so. If | |
2956 | uncertain, it is also possible to run PDNS on another port. To do | |
2957 | so, add local-port=5300 to pdns.conf, and try again. This however | |
2958 | implies that you can only test your nameserver as clients expect | |
2959 | the nameserver to live on port 53. | |
33ccb468 | 2960 | |
2961 | binding to UDP socket: Permission denied | |
d16e0461 TP |
2962 | |
2963 | You must be superuser in order to be able to bind to port 53. If | |
2964 | this is not a possibility, it is also possible to run PDNS on | |
2965 | another port. To do so, add local-port=5300 to pdns.conf, and try | |
2966 | again. This however implies that you can only test your nameserver | |
2967 | as clients expect the nameserver to live on port 53. | |
33ccb468 | 2968 | |
2969 | Unable to launch, no backends configured for querying | |
d16e0461 TP |
2970 | |
2971 | PDNS did not find the launch=bind instruction in pdns.conf. | |
33ccb468 | 2972 | |
2973 | Multiple IP addresses on your server, PDNS sending out answers on the | |
d16e0461 TP |
2974 | wrong one, Massive amounts of 'recvfrom gave error, ignoring: Connection |
2975 | refused' | |
2976 | ||
2977 | If you have multiple IP addresses on the internet on one machine, | |
2978 | UNIX often sends out answers over another interface than which the | |
2979 | packet came in on. In such cases, use local-address to bind to | |
2980 | specific IP addresses, which can be comma separated. The second | |
2981 | error comes from remotes disregarding answers to questions it | |
2982 | didn't ask to that IP address and sending back ICMP errors. | |
2983 | ||
2984 | ---------------------------------------------------------------------- | |
33ccb468 | 2985 | |
2986 | 2.3. Running PDNS on unix | |
2987 | ||
d16e0461 TP |
2988 | PDNS is normally controlled via a SysV-style init.d script, often located |
2989 | in /etc/init.d or /etc/rc.d/init.d. This script accepts the following | |
2990 | commands: | |
33ccb468 | 2991 | |
2992 | monitor | |
d16e0461 TP |
2993 | |
2994 | Monitor is a special way to view the daemon. It executes PDNS in | |
2995 | the foreground with a lot of logging turned on, which helps in | |
2996 | determining startup problems. Besides running in the foreground, | |
2997 | the raw PDNS control socket is made available. All external | |
2998 | communication with the daemon is normally sent over this socket. | |
2999 | While useful, the control console is not an officially supported | |
3000 | feature. Commands which work are: QUIT, SHOW *, SHOW varname, | |
3001 | RPING. | |
33ccb468 | 3002 | |
3003 | start | |
d16e0461 TP |
3004 | |
3005 | Start PDNS in the background. Launches the daemon but makes no | |
3006 | special effort to determine success, as making database | |
3007 | connections may take a while. Use status to query success. You can | |
3008 | safely run start many times, it will not start additional PDNS | |
3009 | instances. | |
33ccb468 | 3010 | |
3011 | restart | |
d16e0461 TP |
3012 | |
3013 | Restarts PDNS if it was running, starts it otherwise. | |
33ccb468 | 3014 | |
3015 | status | |
d16e0461 TP |
3016 | |
3017 | Query PDNS for status. This can be used to figure out if a launch | |
3018 | was successful. The status found is prefixed by the PID of the | |
3019 | main PDNS process. | |
33ccb468 | 3020 | |
3021 | stop | |
d16e0461 TP |
3022 | |
3023 | Requests that PDNS stop. Again, does not confirm success. Success | |
3024 | can be ascertained with the status command. | |
33ccb468 | 3025 | |
3026 | dump | |
d16e0461 TP |
3027 | |
3028 | Dumps a lot of statistics of a running PDNS daemon. It is also | |
3029 | possible to single out specific variable by using the show | |
3030 | command. | |
33ccb468 | 3031 | |
3032 | show variable | |
d16e0461 TP |
3033 | |
3034 | Show a single statistic, as present in the output of the dump. | |
33ccb468 | 3035 | |
3036 | mrtg | |
33ccb468 | 3037 | |
d16e0461 | 3038 | See the performance monitoring Chapter 6. |
33ccb468 | 3039 | |
d16e0461 | 3040 | ---------------------------------------------------------------------- |
33ccb468 | 3041 | |
d16e0461 | 3042 | Chapter 3. Installing on Microsoft Windows |
33ccb468 | 3043 | |
d16e0461 TP |
3044 | Note PowerDNS support for Windows is, as of 1.99.12, very recent and |
3045 | therefore quite 'beta'. For reliability, we currently advise the use | |
3046 | of the Unix versions. Furthermore there is no support for master or | |
3047 | slave operation in the ODBC backend, which is the only one provided | |
3048 | currently. This will be fixed soon. | |
3049 | ||
3050 | As of 1.99.12, PowerDNS supports Windows natively. PDNS can act as an NT | |
3051 | service and works with any ODBC drivers you may have. | |
33ccb468 | 3052 | |
3053 | To install PowerDNS for Windows you should check if your PC meets the | |
3054 | following requirements: | |
3055 | ||
d16e0461 TP |
3056 | * A PC running Microsoft NT (with a recent servicepack and at least mdac |
3057 | 2.5), 2000 or XP. | |
33ccb468 | 3058 | |
d16e0461 TP |
3059 | * An ODBC source containing valid zone information (an example MS Access |
3060 | database is supplied in the form of powerdns.mdb). | |
33ccb468 | 3061 | |
d16e0461 TP |
3062 | If your system meets these requirements, download the installer from |
3063 | http://www.powerdns.com/pdns/. After downloading the file begin the | |
3064 | installation procedure by starting powerdns-VERSION.exe. | |
33ccb468 | 3065 | |
d16e0461 TP |
3066 | After installing the software you should create a valid ODBC source. To do |
3067 | this you have open the ODBC sources dialog: Start->Settings->Control | |
3068 | Panel->Administrative Tools->Data Sources (ODBC). | |
33ccb468 | 3069 | |
d16e0461 TP |
3070 | We'll use the example zone database that is included in the installation |
3071 | to explain how to create a source. | |
33ccb468 | 3072 | |
d16e0461 | 3073 | \r When you are in the ODBC sources dialog you activate the System DSN tab. |
33ccb468 | 3074 | |
d16e0461 TP |
3075 | Note It is important to create a System DSN instead of an User DNS, |
3076 | otherwise the ODBC backend cannot function. | |
33ccb468 | 3077 | |
3078 | Press Add..., then you have to select a driver. | |
3079 | ||
3080 | Select Microsoft Access Driver (*.mdb). | |
3081 | ||
3082 | Use PowerDNS as the DSN name, you can leave the description empty. | |
3083 | ||
3084 | Then press Select... to select the database (ie. C:\Program | |
3085 | Files\PowerDNS\powerdns.mdb). | |
3086 | ||
3087 | Press Ok and you should be done. | |
3088 | ||
d16e0461 TP |
3089 | For more information, see Section A.10. |
3090 | ||
3091 | ---------------------------------------------------------------------- | |
33ccb468 | 3092 | |
3093 | 3.1. Configuring PDNS on Microsoft Windows | |
3094 | ||
d16e0461 TP |
3095 | \r You can specify program parameters in the pdns.conf file which should be |
3096 | located in pdns directory (ie. C:\Program Files\PowerDNS\). | |
33ccb468 | 3097 | |
d16e0461 | 3098 | \r To see a list of available parameters you can run pdns.exe --help. |
33ccb468 | 3099 | |
d16e0461 TP |
3100 | Note \r A default configuration file has been supplied with the |
3101 | installation. | |
33ccb468 | 3102 | |
d16e0461 | 3103 | ---------------------------------------------------------------------- |
33ccb468 | 3104 | |
3105 | 3.2. Running PDNS on Microsoft Windows | |
3106 | ||
d16e0461 TP |
3107 | If you installed pdns on Windows NT, 2000 or XP you can run pdns as a |
3108 | service. | |
33ccb468 | 3109 | |
d16e0461 TP |
3110 | This is how to do it: Go to services (Start->Settings->Control |
3111 | Panel->Administrative Tools->Services) and locate PDNS (you should have | |
3112 | registered the program as a NT service during the installation). | |
33ccb468 | 3113 | |
d16e0461 TP |
3114 | Double-click on PDNS and push the start button. You should now see a |
3115 | progress bar that gets to the end and see the status change to 'Started'. | |
33ccb468 | 3116 | |
d16e0461 | 3117 | This is the same as starting pdns like this: pdns.exe --ntservice |
33ccb468 | 3118 | |
d16e0461 TP |
3119 | If you haven't registered pdns as a service during the installation you |
3120 | can do so from the commandline by starting pdns like this: pdns.exe | |
3121 | --register-service | |
33ccb468 | 3122 | |
d16e0461 TP |
3123 | You can run pdns as a standard console program by using a command prompt |
3124 | or Start->Run... This way you can specify command-line parameters (see the | |
3125 | documentation for commandline options). | |
33ccb468 | 3126 | |
d16e0461 TP |
3127 | If you chose to add a PowerDNS menu to the start menu during the |
3128 | installation you can start pdns using the pdns shortcut in that menu. | |
33ccb468 | 3129 | |
d16e0461 | 3130 | ---------------------------------------------------------------------- |
33ccb468 | 3131 | |
d16e0461 | 3132 | Chapter 4. Configure database connectivity |
33ccb468 | 3133 | |
d16e0461 TP |
3134 | This chapter shows you how to configure the Generic MySQL backend, which |
3135 | we like a lot. But feel free to use any of the myriad other backends. This | |
3136 | backend is called 'gmysql', and needs to be configured in pdns.conf. Add | |
3137 | the following lines, adjusted for your local setup: | |
33ccb468 | 3138 | |
d16e0461 TP |
3139 | launch=gmysql |
3140 | gmysql-host=127.0.0.1 | |
3141 | gmysql-user=root | |
3142 | gmysql-dbname=pdnstest | |
3143 | ||
33ccb468 | 3144 | |
d16e0461 TP |
3145 | Remove any earlier launch statements. Also remove the bind-example-zones |
3146 | statement as the bind module is no longer launched. | |
33ccb468 | 3147 | |
d16e0461 TP |
3148 | Warning Make sure that you can actually resolve the hostname of your |
3149 | database without accessing the database! It is advised to supply | |
3150 | an IP address here to prevent chicken/egg problems! | |
33ccb468 | 3151 | |
d16e0461 TP |
3152 | Warning Be very very sure that you configure the *g*mysql backend and not |
3153 | the mysql backend. See Section A.5. If you use the 'mysql' backend | |
3154 | things will only appear to work. | |
33ccb468 | 3155 | |
3156 | Now start PDNS using the monitor command: | |
d16e0461 TP |
3157 | |
3158 | # /etc/init.d/pdns monitor | |
3159 | (...) | |
3160 | 15:31:30 PowerDNS 1.99.0 (Mar 12 2002, 15:00:28) starting up | |
3161 | 15:31:30 About to create 3 backend threads | |
3162 | 15:31:30 [gMySQLbackend] Failed to connect to database: Error: Unknown database 'pdnstest' | |
3163 | 15:31:30 [gMySQLbackend] Failed to connect to database: Error: Unknown database 'pdnstest' | |
3164 | 15:31:30 [gMySQLbackend] Failed to connect to database: Error: Unknown database 'pdnstest' | |
3165 | ||
3166 | ||
3167 | This is as to be expected - we did not yet add anything to MySQL for PDNS | |
3168 | to read from. At this point you may also see other errors which indicate | |
3169 | that PDNS either could not find your MySQL server or was unable to connect | |
3170 | to it. Fix these before proceeding. | |
33ccb468 | 3171 | |
3172 | General MySQL knowledge is assumed in this chapter, please do not | |
3173 | interpret these commands as DBA advice! | |
d16e0461 TP |
3174 | |
3175 | ---------------------------------------------------------------------- | |
33ccb468 | 3176 | |
3177 | 4.1. Configuring MySQL | |
3178 | ||
d16e0461 TP |
3179 | Connect to MySQL as a user with sufficient privileges and issue the |
3180 | following commands: | |
3181 | ||
3182 | create table domains ( | |
3183 | id INT auto_increment, | |
3184 | name VARCHAR(255) NOT NULL, | |
3185 | master VARCHAR(20) DEFAULT NULL, | |
3186 | last_check INT DEFAULT NULL, | |
3187 | type VARCHAR(6) NOT NULL, | |
3188 | notified_serial INT DEFAULT NULL, | |
3189 | account VARCHAR(40) DEFAULT NULL, | |
3190 | primary key (id) | |
3191 | )type=InnoDB; | |
3192 | ||
3193 | CREATE UNIQUE INDEX name_index ON domains(name); | |
3194 | ||
3195 | CREATE TABLE records ( | |
3196 | id INT auto_increment, | |
3197 | domain_id INT DEFAULT NULL, | |
3198 | name VARCHAR(255) DEFAULT NULL, | |
3199 | type VARCHAR(6) DEFAULT NULL, | |
3200 | content VARCHAR(255) DEFAULT NULL, | |
3201 | ttl INT DEFAULT NULL, | |
3202 | prio INT DEFAULT NULL, | |
3203 | change_date INT DEFAULT NULL, | |
3204 | primary key(id) | |
3205 | )type=InnoDB; | |
3206 | ||
3207 | CREATE INDEX rec_name_index ON records(name); | |
3208 | CREATE INDEX nametype_index ON records(name,type); | |
3209 | CREATE INDEX domain_id ON records(domain_id); | |
3210 | ||
3211 | create table supermasters ( | |
3212 | ip VARCHAR(25) NOT NULL, | |
3213 | nameserver VARCHAR(255) NOT NULL, | |
3214 | account VARCHAR(40) DEFAULT NULL | |
3215 | ); | |
3216 | ||
3217 | GRANT SELECT ON supermasters TO pdns; | |
3218 | GRANT ALL ON domains TO pdns; | |
3219 | GRANT ALL ON records TO pdns; | |
3220 | ||
3221 | ||
3222 | Now we have a database and an empty table. PDNS should now be able to | |
3223 | launch in monitor mode and display no errors: | |
3224 | ||
3225 | # /etc/init.d/pdns monitor | |
3226 | (...) | |
3227 | 15:31:30 PowerDNS 1.99.0 (Mar 12 2002, 15:00:28) starting up | |
3228 | 15:31:30 About to create 3 backend threads | |
3229 | 15:39:55 [gMySQLbackend] MySQL connection succeeded | |
3230 | 15:39:55 [gMySQLbackend] MySQL connection succeeded | |
3231 | 15:39:55 [gMySQLbackend] MySQL connection succeeded | |
3232 | ||
33ccb468 | 3233 | |
3234 | A sample query sent to the database should now return quickly without | |
3235 | data: | |
d16e0461 TP |
3236 | |
3237 | $ host www.test.com 127.0.0.1 | |
3238 | www.test.com A record currently not present at localhost | |
3239 | ||
33ccb468 | 3240 | |
3241 | And indeed, the control console now shows: | |
d16e0461 TP |
3242 | |
3243 | Mar 12 15:41:12 We're not authoritative for 'www.test.com', sending unauth normal response | |
3244 | ||
33ccb468 | 3245 | |
3246 | Now we need to add some records to our database: | |
d16e0461 TP |
3247 | |
3248 | # mysql pdnstest | |
3249 | mysql> INSERT INTO domains (name, type) values ('test.com', 'NATIVE'); | |
3250 | INSERT INTO records (domain_id, name, content, type,ttl,prio) | |
3251 | VALUES (1,'test.com','localhost ahu@ds9a.nl 1','SOA',86400,NULL); | |
3252 | INSERT INTO records (domain_id, name, content, type,ttl,prio) | |
3253 | VALUES (1,'test.com','dns-us1.powerdns.net','NS',86400,NULL); | |
3254 | INSERT INTO records (domain_id, name, content, type,ttl,prio) | |
3255 | VALUES (1,'test.com','dns-eu1.powerdns.net','NS',86400,NULL); | |
3256 | INSERT INTO records (domain_id, name, content, type,ttl,prio) | |
3257 | VALUES (1,'www.test.com','199.198.197.196','A',120,NULL); | |
3258 | INSERT INTO records (domain_id, name, content, type,ttl,prio) | |
3259 | VALUES (1,'mail.test.com','195.194.193.192','A',120,NULL); | |
3260 | INSERT INTO records (domain_id, name, content, type,ttl,prio) | |
3261 | VALUES (1,'localhost.test.com','127.0.0.1','A',120,NULL); | |
3262 | INSERT INTO records (domain_id, name, content, type,ttl,prio) | |
3263 | VALUES (1,'test.com','mail.test.com','MX',120,25); | |
3264 | ||
33ccb468 | 3265 | |
3266 | If we now requery our database, www.test.com should be present: | |
d16e0461 TP |
3267 | |
3268 | $ host www.test.com 127.0.0.1 | |
3269 | www.test.com A 199.198.197.196 | |
3270 | ||
3271 | $ host -v -t mx test.com 127.0.0.1 | |
3272 | Address: 127.0.0.1 | |
3273 | Aliases: localhost | |
3274 | ||
3275 | Query about test.com for record types MX | |
3276 | Trying test.com ... | |
3277 | Query done, 1 answer, authoritative status: no error | |
3278 | test.com 120 IN MX 25 mail.test.com | |
3279 | Additional information: | |
3280 | mail.test.com 120 IN A 195.194.193.192 | |
3281 | ||
3282 | ||
3283 | To confirm what happened, issue the command SHOW * to the control console: | |
3284 | ||
3285 | % show * | |
3286 | corrupt-packets=0,latency=0,packetcache-hit=2,packetcache-miss=5,packetcache-size=0, | |
3287 | qsize-a=0,qsize-q=0,servfail-packets=0,tcp-answers=0,tcp-queries=0, | |
3288 | timedout-packets=0,udp-answers=7,udp-queries=7, | |
3289 | % | |
3290 | ||
3291 | ||
3292 | The actual numbers will vary somewhat. Now enter QUIT and start PDNS as a | |
3293 | regular daemon, and check launch status: | |
3294 | ||
3295 | # /etc/init.d/pdns start | |
3296 | pdns: started | |
3297 | # /etc/init.d/pdns status | |
3298 | pdns: 8239: Child running | |
3299 | # /etc/init.d/pdns dump | |
3300 | pdns: corrupt-packets=0,latency=0,packetcache-hit=0,packetcache-miss=0, | |
3301 | packetcache-size=0,qsize-a=0,qsize-q=0,servfail-packets=0,tcp-answers=0, | |
3302 | tcp-queries=0,timedout-packets=0,udp-answers=0,udp-queries=0, | |
3303 | ||
3304 | ||
3305 | You now have a working database driven nameserver! To convert other zones | |
3306 | already present, use the zone2sql described in Appendix A. | |
3307 | ||
3308 | ---------------------------------------------------------------------- | |
3309 | ||
3310 | 4.1.1. Common problems | |
3311 | ||
3312 | Most problems involve PDNS not being able to connect to the database. | |
3313 | ||
3314 | Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) | |
3315 | ||
3316 | Your MySQL installation is probably defaulting to another location | |
3317 | for its socket. Can be resolved by figuring out this location | |
3318 | (often /var/run/mysqld.sock), and specifying it in the | |
3319 | configuration file with the gmysql-socket parameter. | |
3320 | ||
3321 | Another solution is to not connect to the socket, but to | |
3322 | 127.0.0.1, which can be achieved by specifying | |
3323 | gmysql-host=127.0.0.1. | |
33ccb468 | 3324 | |
3325 | Host 'x.y.z.w' is not allowed to connect to this MySQL server | |
33ccb468 | 3326 | |
d16e0461 TP |
3327 | These errors are generic MySQL errors. Solve them by trying to |
3328 | connect to your MySQL database with the MySQL console utility | |
3329 | mysql with the parameters specified to PDNS. Consult the MySQL | |
3330 | documentation. | |
33ccb468 | 3331 | |
d16e0461 | 3332 | ---------------------------------------------------------------------- |
33ccb468 | 3333 | |
d16e0461 | 3334 | Chapter 5. Dynamic resolution using the PipeBackend |
33ccb468 | 3335 | |
d16e0461 TP |
3336 | Also included in the PDNS distribution is the PipeBackend. The PipeBackend |
3337 | is primarily meant for allowing rapid development of new backends without | |
3338 | tight integration with PowerDNS. It allows end-users to write PDNS | |
3339 | backends in any language. A perl sample is provided. The PipeBackend is | |
3340 | also very well suited for dynamic resolution of queries. Example | |
3341 | applications include DNS based loadbalancing, geo-direction, DNS based | |
3342 | failover with low TTLs. | |
33ccb468 | 3343 | |
d16e0461 TP |
3344 | The Pipe Backend also has a separate chapter in the backends appendix, see |
3345 | Section A.1. | |
33ccb468 | 3346 | |
d16e0461 TP |
3347 | Note The Pipe Backend currently does not function under FreeBSD 4.x and |
3348 | 5.x, probably due to unfavorable interactions between its threading | |
3349 | implementation and the fork system call. | |
3350 | ||
3351 | Interestingly, the Linux PowerDNS binary running under the | |
3352 | Linuxulator on FreeBSD does work. | |
3353 | ||
3354 | ---------------------------------------------------------------------- | |
33ccb468 | 3355 | |
3356 | 5.1. Deploying the PipeBackend with the BindBackend | |
3357 | ||
d16e0461 TP |
3358 | Included with the PDNS distribution is the example.pl backend which has |
3359 | knowledge of the example.com zone, just like the BindBackend. To install | |
3360 | both, add the following to your pdns.conf: | |
3361 | ||
3362 | launch=pipe,bind | |
3363 | bind-example-zones | |
3364 | pipe-command=location/of/backend.pl | |
3365 | ||
33ccb468 | 3366 | |
d16e0461 TP |
3367 | Please adjust the pipe-command statement to the location of the unpacked |
3368 | PDNS distribution. If your backend is slow, raise pipe-timeout from its | |
3369 | default of 2000ms. Now launch PDNS in monitor mode, and perform some | |
3370 | queries. Note the difference with the earlier experiment where only the | |
3371 | BindBackend was loaded. The PipeBackend is launched first and thus gets | |
3372 | queried first. The sample backend.pl script knows about: | |
33ccb468 | 3373 | |
d16e0461 | 3374 | * webserver.example.com A records pointing to 1.2.3.4, 1.2.3.5, 1.2.3.6 |
33ccb468 | 3375 | |
33ccb468 | 3376 | * www.example.com CNAME pointing to webserver.example.com |
d16e0461 TP |
3377 | |
3378 | * MBOXFW (mailbox forward) records pointing to powerdns@example.com. See | |
3379 | the smtpredir documentation for information about MBOXFW. | |
33ccb468 | 3380 | |
3381 | For more information about how to write exciting backends with the | |
3382 | PipeBackend, see Appendix A. | |
33ccb468 | 3383 | |
d16e0461 TP |
3384 | ---------------------------------------------------------------------- |
3385 | ||
3386 | Chapter 6. Logging & Monitoring PDNS performance | |
33ccb468 | 3387 | |
d16e0461 TP |
3388 | In a production environment, you will want to be able to monitor PDNS |
3389 | performance. For this purpose, currently two methods are available, the | |
3390 | webserver and the init.d dump, show and mrtg, commands. Furthermore, PDNS | |
3391 | can perform a configurable amount of operational logging. This chapter | |
3392 | also explains how to configure syslog for best results. | |
3393 | ||
3394 | ---------------------------------------------------------------------- | |
33ccb468 | 3395 | |
3396 | 6.1. Webserver | |
3397 | ||
d16e0461 TP |
3398 | To launch the internal webserver, add a webserver statement to the |
3399 | pdns.conf. This will instruct the PDNS daemon to start a webserver on | |
3400 | localhost at port 8081, without password protection. Only local users (on | |
3401 | the same host) will be able to access the webserver by default. The | |
3402 | webserver lists a lot of information about the PDNS process, including | |
3403 | frequent queries, frequently failing queries, lists of remote hosts | |
3404 | sending queries, hosts sending corrupt queries etc. The webserver does not | |
3405 | allow remote management of the daemon. The following nameserver related | |
3406 | configuration items are available: | |
33ccb468 | 3407 | |
3408 | webserver | |
d16e0461 TP |
3409 | |
3410 | If set to anything but 'no', a webserver is launched. | |
33ccb468 | 3411 | |
3412 | webserver-address | |
d16e0461 TP |
3413 | |
3414 | Address to bind the webserver to. Defaults to 127.0.0.1, which | |
3415 | implies that only the local computer is able to connect to the | |
3416 | nameserver! To allow remote hosts to connect, change to 0.0.0.0 or | |
3417 | the physical IP address of your nameserver. | |
33ccb468 | 3418 | |
3419 | webserver-password | |
d16e0461 TP |
3420 | |
3421 | If set, viewers will have to enter this plaintext password in | |
3422 | order to gain access to the statistics. | |
33ccb468 | 3423 | |
3424 | webserver-port | |
d16e0461 TP |
3425 | |
3426 | Port to bind the webserver to. Defaults to 8081. | |
3427 | ||
3428 | ---------------------------------------------------------------------- | |
33ccb468 | 3429 | |
3430 | 6.2. Via init.d commands | |
3431 | ||
d16e0461 TP |
3432 | As mentioned before, the init.d commands dump, show and mrtg fetch data |
3433 | from a running PDNS process. Especially mrtg is powerful - it outputs data | |
3434 | in a format that is ready for processing by the MRTG graphing tool. | |
3435 | ||
3436 | MRTG can make insightful graphics on the performance of your nameserver, | |
3437 | enabling the operator to easily spot trends. MRTG can be found on | |
3438 | http://people.ee.ethz.ch/~oetiker/webtools/mrtg/mrtg.html | |
3439 | ||
3440 | A sample mrtg.conf: | |
3441 | ||
3442 | Interval: 5 | |
3443 | WorkDir: /var/www/mrtg | |
3444 | WriteExpires: yes | |
3445 | Options[_]: growright,nopercent | |
3446 | XSize[_]: 600 | |
3447 | ||
3448 | #--------------------------------------------------------------- | |
3449 | ||
3450 | Target[udp-queries]: `/etc/init.d/pdns mrtg udp-queries udp-answers` | |
3451 | Options[udp-queries]: growright,nopercent,perminute | |
3452 | MaxBytes[udp-queries]: 600000 | |
3453 | AbsMax[udp-queries]: 600000 | |
3454 | Title[udp-queries]: Queries per minute | |
3455 | PageTop[udp-queries]: <H2>Queries per minute</H2> | |
3456 | WithPeak[udp-queries]: ymwd | |
3457 | YLegend[udp-queries]: queries/minute | |
3458 | ShortLegend[udp-queries]: q/m | |
3459 | LegendI[udp-queries]: udp-questions | |
3460 | LegendO[udp-queries]: udp-answers | |
3461 | ||
3462 | ||
3463 | Target[perc-failed]: `/etc/init.d/pdns mrtg udp-queries udp-answers` | |
3464 | Options[perc-failed]: growright,dorelpercent,perminute | |
3465 | MaxBytes[perc-failed]: 600000 | |
3466 | AbsMax[perc-failed]: 600000 | |
3467 | Title[perc-failed]: Queries per minute, with percentage success | |
3468 | PageTop[perc-failed]: <H2>Queries per minute, with percentage success</H2> | |
3469 | WithPeak[perc-failed]: ymwd | |
3470 | YLegend[perc-failed]: queries/minute | |
3471 | ShortLegend[perc-failed]: q/m | |
3472 | LegendI[perc-failed]: udp-questions | |
3473 | LegendO[perc-failed]: udp-answers | |
3474 | ||
3475 | ||
3476 | Target[packetcache-rate]: `/etc/init.d/pdns mrtg packetcache-hit udp-queries` | |
3477 | Options[packetcache-rate]: growright,dorelpercent,perminute | |
3478 | Title[packetcache-rate]: packetcache hitrate | |
3479 | MaxBytes[packetcache-rate]: 600000 | |
3480 | AbsMax[packetcache-rate]: 600000 | |
3481 | PageTop[packetcache-rate]: <H2>packetcache hitrate</H2> | |
3482 | WithPeak[packetcache-rate]: ymwd | |
3483 | YLegend[packetcache-rate]: queries/minute | |
3484 | ShortLegend[packetcache-rate]: q/m | |
3485 | LegendO[packetcache-rate]: total | |
3486 | LegendI[packetcache-rate]: hit | |
3487 | ||
3488 | Target[packetcache-missrate]: `/etc/init.d/pdns mrtg packetcache-miss udp-queries` | |
3489 | Options[packetcache-missrate]: growright,dorelpercent,perminute | |
3490 | Title[packetcache-missrate]: packetcache MISSrate | |
3491 | MaxBytes[packetcache-missrate]: 600000 | |
3492 | AbsMax[packetcache-missrate]: 600000 | |
3493 | PageTop[packetcache-missrate]: <H2>packetcache MISSrate</H2> | |
3494 | WithPeak[packetcache-missrate]: ymwd | |
3495 | YLegend[packetcache-missrate]: queries/minute | |
3496 | ShortLegend[packetcache-missrate]: q/m | |
3497 | LegendO[packetcache-missrate]: total | |
3498 | LegendI[packetcache-missrate]: MISS | |
3499 | ||
3500 | Target[latency]: `/etc/init.d/pdns mrtg latency` | |
3501 | Options[latency]: growright,nopercent,gauge | |
3502 | MaxBytes[latency]: 600000 | |
3503 | AbsMax[latency]: 600000 | |
3504 | Title[latency]: Query/answer latency | |
3505 | PageTop[latency]: <H2>Query/answer latency</H2> | |
3506 | WithPeak[latency]: ymwd | |
3507 | YLegend[latency]: usec | |
3508 | ShortLegend[latency]: usec | |
3509 | LegendO[latency]: latency | |
3510 | LegendI[latency]: latency | |
3511 | ||
3512 | Target[recursing]: `/etc/init.d/pdns mrtg recursing-questions recursing-answers` | |
3513 | Options[recursing]: growright,nopercent,gauge | |
3514 | MaxBytes[recursing]: 600000 | |
3515 | AbsMax[recursing]: 600000 | |
3516 | Title[recursing]: Recursive questions/answers | |
3517 | PageTop[recursing]: <H2>Recursing questions/answers</H2> | |
3518 | WithPeak[recursing]: ymwd | |
3519 | YLegend[recursing]: queries/minute | |
3520 | ShortLegend[recursing]: q/m | |
3521 | LegendO[recursing]: recursing-questions | |
3522 | LegendI[recursing]: recursing-answers | |
3523 | ||
3524 | ||
3525 | ||
3526 | ---------------------------------------------------------------------- | |
33ccb468 | 3527 | |
3528 | 6.3. Operational logging using syslog | |
3529 | ||
d16e0461 | 3530 | (logging-facility is available from 1.99.10 and onwards) |
33ccb468 | 3531 | |
d16e0461 TP |
3532 | This chapter assumes familiarity with syslog, the unix logging device. |
3533 | PDNS logs messages with different levels. The more urgent the message, the | |
3534 | lower the 'priority'. By default, PDNS will only log messages with an | |
3535 | urgency of 3 or lower, but this can be changed using the loglevel setting | |
3536 | in the configuration file. Setting it to 0 will eliminate all logging, 9 | |
3537 | will log everything. | |
33ccb468 | 3538 | |
d16e0461 TP |
3539 | By default, logging is performed under the 'DAEMON' facility which is |
3540 | shared with lots of other programs. If you regard nameserving as | |
3541 | important, you may want to have it under a dedicated facility so PDNS can | |
3542 | log to its own files, and not clutter generic files. | |
33ccb468 | 3543 | |
d16e0461 TP |
3544 | For this purpose, syslog knows about 'local' facilities, numbered from |
3545 | LOCAL0 to LOCAL7. To move PDNS logging to LOCAL0, add logging-facility=0 | |
3546 | to your configuration. | |
33ccb468 | 3547 | |
d16e0461 TP |
3548 | Furthermore, you may want to have separate files for the differing |
3549 | prioties - preventing lower priority messages from obscuring important | |
3550 | ones. | |
33ccb468 | 3551 | |
d16e0461 TP |
3552 | A sample syslog.conf might be: |
3553 | ||
3554 | local0.info -/var/log/pdns.info | |
3555 | local0.warn -/var/log/pdns.warn | |
3556 | local0.err /var/log/pdns.err | |
3557 | ||
33ccb468 | 3558 | |
3559 | Where local0.err would store the really important messages. For | |
d16e0461 TP |
3560 | performance and diskspace reasons, it is advised to audit your syslog.conf |
3561 | for statements also logging PDNS activities. Many syslog.confs have a | |
3562 | '*.*' statement to /var/log/syslog, which you may want to remove. | |
3563 | ||
3564 | For performance reasons, be especially certain that no large amounts of | |
3565 | synchronous logging take place. Under Linux, this is indicated by | |
3566 | filenames not starting with a '-' - indicating a synchronous log, which | |
3567 | hurts performance. | |
33ccb468 | 3568 | |
d16e0461 | 3569 | ---------------------------------------------------------------------- |
33ccb468 | 3570 | |
d16e0461 | 3571 | Chapter 7. Security settings & considerations |
33ccb468 | 3572 | |
3573 | 7.1. Settings | |
3574 | ||
d16e0461 TP |
3575 | PDNS has several options to easily allow it to run more securely. Most |
3576 | notable are the chroot, setuid and setgid options which can be specified. | |
3577 | ||
3578 | ---------------------------------------------------------------------- | |
3579 | ||
3580 | 7.1.1. Running as a less privileged identity | |
3581 | ||
3582 | By specifying setuid and setgid, PDNS changes to this identity shortly | |
3583 | after binding to the privileged DNS ports. These options are highly | |
3584 | recommended. It is suggested that a separate identity is created for PDNS | |
3585 | as the user 'nobody' is in fact quite powerful on most systems. | |
3586 | ||
3587 | Both these parameters can be specified either numerically or as real | |
3588 | names. You should set these parameters immediately if they are not set! | |
3589 | ||
3590 | ---------------------------------------------------------------------- | |
3591 | ||
3592 | 7.1.2. Jailing the process in a chroot | |
3593 | ||
3594 | The chroot option secures PDNS to its own directory so that even if it | |
3595 | should become compromised and under control of external influences, it | |
3596 | will have a hard time affecting the rest of the system. | |
3597 | ||
3598 | Even though this will hamper hackers a lot, chroot jails have been known | |
3599 | to be broken. | |
3600 | ||
fc2fb8ea AG |
3601 | Warning When chrooting PDNS, take care that backends will be able to get |
3602 | to their files. Many databases need access to a UNIX domain socket | |
3603 | which should live within the chroot. It is often possible to | |
3604 | hardlink such a socket into the chroot dir. | |
3605 | ||
3606 | When running with master or slave support, be aware that many | |
3607 | operating systems need access to specific libraries (ofen | |
3608 | /lib/libnss*) in order to support resolution of domain names! You | |
3609 | can also hardlink these. | |
d16e0461 TP |
3610 | |
3611 | The default PDNS configuration is best chrooted to ./, which boils down to | |
3612 | the configured location of the controlsocket. | |
3613 | ||
3614 | This is achieved by adding the following to pdns.conf: chroot=./, and | |
3615 | restarting PDNS. | |
3616 | ||
3617 | ---------------------------------------------------------------------- | |
3618 | ||
3619 | 7.2. Considerations | |
3620 | ||
3621 | In general, make sure that the PDNS process is unable to execute commands | |
3622 | on your backend database. Most database backends will only need SELECT | |
3623 | privilege. Take care to not connect to your database as the 'root' or 'sa' | |
3624 | user, and configure the chosen user to have very slight privileges. | |
3625 | ||
3626 | Databases empathic-ally do not need to run on the same machine that runs | |
3627 | PDNS! In fact, in benchmarks it has been discovered that having a separate | |
3628 | database machine actually improves performance. | |
3629 | ||
3630 | Separation will enhance your database security highly. Recommended. | |
3631 | ||
3632 | ---------------------------------------------------------------------- | |
3633 | ||
3634 | Chapter 8. Virtual hosting | |
3635 | ||
3636 | It may be advantageous to run multiple separate PDNS installations on a | |
3637 | single host, for example to make sure that different customers cannot | |
3638 | affect each others zones. PDNS fully supports running multiple instances | |
3639 | on one host. | |
3640 | ||
3641 | To generate additional PDNS instances, copy the init.d script pdns to | |
3642 | pdns-name, where name is the name of your virtual configuration. Must not | |
3643 | contain a - as this will confuse the script. | |
3644 | ||
3645 | When you launch PDNS via this renamed script, it will seek configuration | |
3646 | instructions not in pdns.conf but in pdns-name.conf, allowing for separate | |
3647 | specification of parameters. | |
3648 | ||
3649 | Be aware however that the init.d force-stop will kill all PDNS instances! | |
3650 | ||
3651 | ---------------------------------------------------------------------- | |
3652 | ||
3653 | Chapter 9. Performance related settings | |
3654 | ||
3655 | Different backends will have different characteristics - some will want to | |
3656 | have more parallel instances than others. In general, if your backend is | |
3657 | latency bound, like most relational databases are, it pays to open more | |
3658 | backends. | |
3659 | ||
3660 | This is done with the distributor-threads setting. Of special importance | |
3661 | is the choice between 1 or more backends. In case of only 1 thread, PDNS | |
3662 | reverts to unthreaded operation which may be a lot faster, depending on | |
3663 | your operating system and architecture. | |
3664 | ||
3665 | Another very important setting cache-ttl. PDNS caches entire packets it | |
3666 | sends out so as to save the time to query backends to assemble all data. | |
3667 | The default setting of 10 seconds may be low for high traffic sites, a | |
3668 | value of 60 seconds rarely leads to problems. | |
3669 | ||
3670 | Some PDNS operators set cache-ttl to many hours or even days, and use | |
3671 | pdns_control purge to selectively or globally notify PDNS of changes made | |
3672 | in the backend. Also look at the Query Cache described in this chapter. It | |
3673 | may materially improve your performance. | |
3674 | ||
3675 | To determine if PDNS is unable to keep up with packets, determine the | |
3676 | value of the qsize-q variable. This represents the number of packets | |
3677 | waiting for database attention. During normal operations the queue should | |
3678 | be small. | |
3679 | ||
3680 | If it is known that backends will not contain CNAME records, the | |
3681 | skip-cname setting can be used to prevent the normally mandatory CNAME | |
3682 | lookup that is needed at least once for each DNS query. | |
3683 | ||
3684 | Much the same holds for the wildcards setting. On by default, each | |
3685 | non-existent query will lead to a number of additional wildcard queries. | |
3686 | If it is known that the backends do not contain wildcard records, | |
3687 | performance can be improved by adding wildcards=no to pdns.conf. | |
3688 | ||
3689 | Logging truly kills performance as answering a question from the cache is | |
3690 | an order of magnitude less work than logging a line about it. Busy sites | |
3691 | will prefer to turn log-dns-details and log-failed-updates off. | |
3692 | ||
3693 | ---------------------------------------------------------------------- | |
3694 | ||
3695 | 9.1. Packet Cache | |
3696 | ||
3697 | PDNS by default uses the 'Packet Cache' to recognise identical questions | |
3698 | and supply them with identical answers, without any further processing. | |
3699 | The default time to live is 10 seconds. It has been observed that the | |
3700 | utility of the packet cache increases with the load on your nameserver. | |
3701 | ||
3702 | Not all backends may benefit from the packetcache. If your backend is | |
3703 | memory based and does not lead to context switches, the packetcache may | |
3704 | actually hurt performance. | |
3705 | ||
3706 | The size of the packetcache can be observed with /etc/init.d/pdns show | |
3707 | packetcache-size | |
3708 | ||
3709 | ---------------------------------------------------------------------- | |
3710 | ||
3711 | 9.2. Query Cache | |
3712 | ||
3713 | Besides entire packets, PDNS can also cache individual backend queries. | |
3714 | Each DNS query leads to a number of backend queries, the most obvious | |
3715 | additional backend query is the check for a possible CNAME. So, when a | |
3716 | query comes in for the 'A' record for 'www.powerdns.com', PDNS must first | |
3717 | check for a CNAME for 'www.powerdns.com'. | |
3718 | ||
3719 | The Query Cache caches these backend queries, many of which are quite | |
3720 | repetitive. PDNS only caches queries with no answer, or with exactly one. | |
3721 | In the future this may be expanded but this lightweight solution is very | |
3722 | simple and therefore fast. | |
3723 | ||
3724 | Most gain is made from caching negative entries, ie, queries that have no | |
3725 | answer. As these take little memory to store and are typically not a real | |
3726 | problem in terms of speed-of-propagation, the default TTL for negative | |
3727 | queries is a rather high 60 seconds. | |
3728 | ||
3729 | This only is a problem when first doing a query for a record, adding it, | |
3730 | and immediately doing a query for that record again. It may then take up | |
3731 | to 60 seconds to appear. Changes to existing records however do not fall | |
3732 | under the negative query ttl ( negquery-cache-ttl), but under the generic | |
3733 | query-ttl which defaults to 20 seconds. | |
3734 | ||
3735 | The default values should work fine for many sites. When tuning, keep in | |
3736 | mind that the Query Cache mostly saves database access but that the Packet | |
3737 | Cache also saves a lot of CPU because 0 internal processing is done when | |
3738 | answering a question from the Packet Cache. | |
3739 | ||
3740 | ---------------------------------------------------------------------- | |
3741 | ||
3742 | Chapter 10. Migrating to PDNS | |
3743 | ||
3744 | Before migrating to PDNS a few things should be considered. | |
3745 | ||
3746 | PDNS is not a recursing nameserver on its own | |
3747 | ||
3748 | If PDNS receives a question for which it is not authoritative, it | |
3749 | can't go out on the net to figure out an answer. However, because | |
3750 | many installations are expected to be both authoritative and | |
3751 | recursing, PDNS can use a separate recursing backend to provide | |
3752 | non-authoritative answers. See Chapter 11 for more details. | |
3753 | ||
3754 | PDNS does not operate as a 'slave' or 'master' server with all backends | |
3755 | ||
3756 | Only the Generic PostgreSQL, Generic MySQL and BIND backends have | |
3757 | the ability to act as master or slave. | |
3758 | ||
3759 | To migrate, the zone2sql tool is provided. | |
3760 | ||
3761 | ---------------------------------------------------------------------- | |
3762 | ||
3763 | 10.1. Zone2sql | |
3764 | ||
3765 | Zone2sql parses Bind named.conf files and zonefiles and outputs SQL on | |
3766 | standard out, which can then be fed to your database. | |
3767 | ||
3768 | Zone2sql understands the Bind master file extension '$GENERATE' and will | |
3769 | also honour '$ORIGIN' and '$TTL'. | |
33ccb468 | 3770 | |
d16e0461 TP |
3771 | For backends supporting slave operation (currently only the Generic |
3772 | PostgreSQL, Generic MySQL and BIND backend), there is also an option to | |
3773 | keep slave zones as slaves, and not convert them to native operation. | |
33ccb468 | 3774 | |
d16e0461 TP |
3775 | By default, zone2sql outputs code suitable for the mysqlbackend, but it |
3776 | can also generate SQL for the Generic PostgreSQL, Generic MySQL and Oracle | |
3777 | backends. The following commands are available: | |
33ccb468 | 3778 | |
d16e0461 TP |
3779 | --bare |
3780 | ||
3781 | Output in a bare format, suitable for further parsing. The output | |
3782 | is formatted as follows: | |
3783 | ||
3784 | domain_id<TAB>'qname'<TAB>'qtype'<TAB>'content'<TAB>prio<TAB>ttl | |
3785 | ||
3786 | ||
3787 | --gmysql | |
3788 | ||
3789 | Output in format suitable for the default configuration of the | |
3790 | Generic MySQL backend. | |
3791 | ||
3792 | --gpgsql | |
3793 | ||
3794 | Output in format suitable for the default configuration of the | |
3795 | Generic PostgreSQL backend. | |
3796 | ||
3797 | --help | |
3798 | ||
3799 | List options. | |
3800 | ||
3801 | --mysql | |
3802 | ||
3803 | Output in format suitable for the default configuration of the | |
3804 | MySQL backend. Default. | |
3805 | ||
3806 | --named-conf=... | |
3807 | ||
3808 | Parse this named.conf to find locations of zones. | |
3809 | ||
3810 | --on-error-resume-next | |
3811 | ||
3812 | Ignore missing files during parsing. Dangerous. | |
3813 | ||
3814 | --oracle | |
3815 | ||
3816 | Output in format suitable for the default configuration of the | |
3817 | Generic Oracle backend. | |
3818 | ||
3819 | --slave | |
3820 | ||
3821 | Maintain slave status of zones listed in named.conf as being | |
3822 | slaves. The default behaviour is to convert all zones to native | |
3823 | operation. | |
3824 | ||
3825 | --startid | |
3826 | ||
3827 | Supply a value for the first domain_id generated. Defaults at 0. | |
3828 | ||
3829 | --transactions | |
33ccb468 | 3830 | |
d16e0461 TP |
3831 | For Oracle and PostgreSQL output, wrap each domain in a |
3832 | transaction for higher speed and integrity. | |
33ccb468 | 3833 | |
d16e0461 TP |
3834 | --verbose |
3835 | ||
3836 | Be verbose during conversion. | |
3837 | ||
3838 | --zone=... | |
3839 | ||
3840 | Parse only this zone file. Conflicts with --named-conf parameter. | |
3841 | ||
3842 | --zone-name=... | |
3843 | ||
3844 | When parsing a single zone without $ORIGIN statement, set this as | |
3845 | the zone name. | |
3846 | ||
3847 | ---------------------------------------------------------------------- | |
3848 | ||
3849 | Chapter 11. Recursion | |
3850 | ||
3851 | (only available from 1.99.8 and onwards, recursing component available | |
3852 | since 2.9.5) | |
3853 | ||
3854 | From 2.9.5 onwards, PowerDNS offers both authoritative nameserving | |
3855 | capabilities and a recursive nameserver component. These two halves are | |
3856 | normally separate but many users insist on combining both recursion and | |
3857 | authoritative service on one IP address. This can be likened to running | |
3858 | Apache and Squid both on port 80. | |
3859 | ||
3860 | However, many sites want to do this anyhow and some with good reason. For | |
3861 | example, a setup like this allows the creation of fake domains which only | |
3862 | exist for local users. Such domains often don't end on ".com" or ".org" | |
3863 | but on ".intern" or ".name-of-isp". | |
3864 | ||
3865 | PowerDNS can cooperate with either its own recursor or any other you have | |
3866 | available to deliver recursive service on its port. | |
3867 | ||
3868 | By specifying the recursor option in the configuration file, questions | |
3869 | requiring recursive treatment will be handed over to the IP address | |
3870 | specified. An example configuration might be recursor=130.161.180.1, which | |
3871 | designates 130.161.180.1 as the nameserver to handle recursive queries. | |
3872 | ||
3873 | As of 2.9.5, the recursing component of PowerDNS is a bit young and | |
3874 | relatively untested but we hope people will want to use it anyhow. As an | |
3875 | alternative, we highly advise the use of the DJBDNS dnscache | |
3876 | (http://cr.yp.to/djbdns/dnscache.html). | |
33ccb468 | 3877 | |
d16e0461 TP |
3878 | Take care not to point recursor to PDNS, which leads to a very tight |
3879 | packet loop! | |
33ccb468 | 3880 | |
d16e0461 TP |
3881 | By specifying allow-recursion, recursion can be restricted to netmasks |
3882 | specified. The default is to allow recursion from everywhere. Example: | |
3883 | allow-recursion=192.168.0.0/24, 10.0.0.0/8, 1.2.3.4. | |
33ccb468 | 3884 | |
d16e0461 TP |
3885 | ---------------------------------------------------------------------- |
3886 | ||
3887 | 11.1. Details | |
3888 | ||
3889 | Questions carry a number of flags. One of these is called 'Recursion | |
3890 | Desired'. If PDNS is configured to allow recursion, AND such a flag is | |
3891 | seen, AND the IP address of the client is allowed to recurse via PDNS, | |
3892 | then the packet may be handed to the recursing backend. | |
3893 | ||
3894 | If a Recursion Desired packet arrives and PDNS is configured to allow | |
3895 | recursion, but not to the IP address of the client, resolution will | |
3896 | proceed as if the RD flag were unset and the answer will indicate that | |
3897 | recursion was not available. | |
3898 | ||
3899 | It is also possible to use a resolver living on a different port. To do | |
3900 | so, specify a recursor like this: recursor=130.161.180.1:5300. | |
3901 | ||
3902 | If the backend does not answer a question within a large amount of time, | |
3903 | this is logged as 'Recursive query for remote 10.96.0.2 with internal id 0 | |
3904 | was not answered by backend within timeout, reusing id'. This may happen | |
3905 | when using 'BIND' as a recursor as it is prone to drop queries which it | |
3906 | can't answer immediately. | |
3907 | ||
3908 | To make sure that the local authoritative database overrides recursive | |
3909 | information, PowerDNS first tries to answer a question from its own | |
3910 | database. If that succeeds, the answer packet is sent back immediately | |
fc2fb8ea AG |
3911 | without involving the recursor in any way. This means that for questions |
3912 | for which there is no answer, PowerDNS will consult the recursor for an | |
3913 | recursive query, even if PowerDNS is authoritative for a domain! This will | |
3914 | only cause problems if you 'fake' domains which don't really exist. | |
3915 | ||
3916 | If you want to create such fake domains or override existing domains, | |
3917 | please set the allow-recursion-override feature (available as of 2.9.14). | |
d16e0461 TP |
3918 | |
3919 | Some packets, like those asking for MX records which are needed for SMTP | |
3920 | transport of email, can be subject to 'additional processing'. This means | |
3921 | that a recursing nameserver is obliged to try to add A records (IP | |
3922 | addresses) for any of the mailservers mentioned in the packet, should it | |
3923 | have these addresses available. | |
3924 | ||
3925 | If PowerDNS encounters records needing such processing and finds that it | |
3926 | does not have the data in its authoritative database, it will send an | |
3927 | opportunistic quick query to the recursing component to see if it perhaps | |
3928 | has such data. This question is worded such that the recursing nameserver | |
3929 | should return immediately such as not to block the authoritative | |
3930 | nameserver. | |
3931 | ||
3932 | This marks a change from pre-2.9.5 behaviour where a packet was handed | |
3933 | wholesale to the recursor in case it needed additional processing which | |
3934 | could not proceed from the authoritative database. | |
3935 | ||
3936 | ---------------------------------------------------------------------- | |
3937 | ||
3938 | Chapter 12. PowerDNS resolver/recursing nameserver | |
3939 | ||
3940 | As of 2.9.4, a small recursor comes with PowerDNS. The algorithm is | |
3941 | influenced by the works of Dan J. Bernstein although all mistakes are | |
3942 | ours. Here are the current faults, so nobody can accuse us of false | |
3943 | advertising: | |
3944 | ||
3945 | * Only compiles on Linux, Windows and possibly Solaris. FreeBSD 4.x | |
3946 | decided not to support the POSIX get/set/swapcontext functions. Bug | |
3947 | your favorite FreeBSD kernel or libc maintainer for a fix, or ask him | |
3948 | to port MTasker (see below) to your operating system. | |
3949 | ||
3950 | * May have big problems with truncated packets. | |
3951 | ||
3952 | To compile, add --enable-recursor to configure and the file pdns_recursor | |
3953 | will be compiled. To run on a different port, use ./syncres | |
3954 | --local-port=53. To bind to another address, use the local-address | |
3955 | setting. | |
3956 | ||
3957 | Note PowerDNS author bert hubert has the pdns recursor in production and | |
3958 | browsing with it works for him. Furthermore, the LARTC mailinglist | |
3959 | (2000 subscribers) is using the pdns recursing nameserver. | |
3960 | ||
3961 | Good points: | |
3962 | ||
3963 | * Uses MTasker (homepage) | |
3964 | ||
3965 | * Can handle thousands of concurrent questions | |
3966 | ||
3967 | * Code is written linearly, sequentially, which means that there are no | |
3968 | problems with 'query restart' or anything. | |
3969 | ||
3970 | * Relies heavily on Standard C++ Library infrastructure, which makes for | |
3971 | little code (406 core lines). | |
3972 | ||
3973 | * Is very verbose in showing how recursion actually works. | |
33ccb468 | 3974 | |
d16e0461 | 3975 | * The algorithm is simple and quite nifty. |
33ccb468 | 3976 | |
d16e0461 | 3977 | ---------------------------------------------------------------------- |
33ccb468 | 3978 | |
d16e0461 | 3979 | 12.1. pdns_recursor settings |
33ccb468 | 3980 | |
d16e0461 TP |
3981 | At startup, the recursing nameserver reads the file recursor.conf from the |
3982 | configuration directory, often /etc/powerdns or /usr/local/etc. | |
33ccb468 | 3983 | |
d16e0461 | 3984 | The following settings can be configured: |
33ccb468 | 3985 | |
d16e0461 | 3986 | aaaa-additional-processing |
33ccb468 | 3987 | |
d16e0461 TP |
3988 | If turned on, the recursor will attempt to add AAAA IPv6 records |
3989 | to questions for MX records and NS records. Can be quite slow as | |
3990 | absence of these records in earlier answers does not guarantee | |
3991 | their non-existance. Can double the amount of queries needed. Off | |
3992 | by default. | |
33ccb468 | 3993 | |
d16e0461 | 3994 | config-dir |
33ccb468 | 3995 | |
d16e0461 | 3996 | Directory where the configuration file can be found. |
33ccb468 | 3997 | |
d16e0461 | 3998 | daemon |
33ccb468 | 3999 | |
d16e0461 | 4000 | Operate in the background, which is the default. |
33ccb468 | 4001 | |
d16e0461 | 4002 | delegation-only |
33ccb468 | 4003 | |
d16e0461 | 4004 | A Verisign special, see Section 12.1.1. |
33ccb468 | 4005 | |
d16e0461 | 4006 | local-address |
33ccb468 | 4007 | |
d16e0461 | 4008 | Local IP address (singular) to bind to. Defaults to all addresses. |
33ccb468 | 4009 | |
d16e0461 | 4010 | local-port |
33ccb468 | 4011 | |
d16e0461 | 4012 | Local port (singular) to bind to. Defaults to 53. |
33ccb468 | 4013 | |
d16e0461 | 4014 | quiet |
33ccb468 | 4015 | |
d16e0461 | 4016 | Don't log queries. |
33ccb468 | 4017 | |
d16e0461 | 4018 | trace |
33ccb468 | 4019 | |
d16e0461 TP |
4020 | If turned on, output impressive heaps of logging. May destroy |
4021 | performance under load. | |
33ccb468 | 4022 | |
d16e0461 | 4023 | ---------------------------------------------------------------------- |
33ccb468 | 4024 | |
d16e0461 | 4025 | 12.1.1. Verisign weirdness |
33ccb468 | 4026 | |
d16e0461 TP |
4027 | Verisign, the current operator of the COM and NET zones, decided to add a |
4028 | wildcard record so as to draw all queries for non-existing domains to | |
4029 | their own page, which lists domains you might want to visist instead. | |
33ccb468 | 4030 | |
d16e0461 TP |
4031 | To reinstate old behaviour, add delegation-only=com,net to your recursor |
4032 | configuration. | |
33ccb468 | 4033 | |
d16e0461 TP |
4034 | What this does is reject all authoritative answers from the COM and NET |
4035 | servers. ISC, the current maintainers of BIND, have implemented this | |
4036 | feature first, PowerDNS has mostly copied their algorithm. Thanks! | |
33ccb468 | 4037 | |
d16e0461 TP |
4038 | Verisign might decide to evade our tactic with wildcard NS records, by |
4039 | which time other measures will be needed to restore the old behaviour. | |
33ccb468 | 4040 | |
d16e0461 | 4041 | ---------------------------------------------------------------------- |
33ccb468 | 4042 | |
d16e0461 | 4043 | 12.2. Details |
33ccb468 | 4044 | |
d16e0461 TP |
4045 | PowerDNS implements a very simple but effective nameserver. Care has been |
4046 | taken not to overload remote servers in case of overly active clients. | |
33ccb468 | 4047 | |
d16e0461 TP |
4048 | This is implemented using the 'throttle'. This accounts all recent traffic |
4049 | and prevents queries that have been sent out recently from going out | |
4050 | again. | |
33ccb468 | 4051 | |
d16e0461 | 4052 | There are three levels of throttling. |
33ccb468 | 4053 | |
d16e0461 TP |
4054 | * If a remote server indicates that it is lame for a zone, the exact |
4055 | question won't be repeated in the next 60 seconds. | |
33ccb468 | 4056 | |
d16e0461 TP |
4057 | * After 4 ServFail responses in 60 seconds, the query gets throttled |
4058 | too. | |
33ccb468 | 4059 | |
d16e0461 | 4060 | * 5 timeouts in 20 seconds also lead to query suppression. |
33ccb468 | 4061 | |
d16e0461 | 4062 | ---------------------------------------------------------------------- |
33ccb468 | 4063 | |
d16e0461 | 4064 | 12.3. Statistics |
33ccb468 | 4065 | |
d16e0461 TP |
4066 | Every half our or so, the recursor outputs a line with statistics. More |
4067 | infrastructure is planned so as to allow for Cricket or MRTG graphs. To | |
4068 | force the output of statistics, send the process a SIGUSR1. A line of | |
4069 | statistics looks like this: | |
33ccb468 | 4070 | |
d16e0461 | 4071 | Feb 10 14:16:03 stats: 125784 questions, 13971 cache entries, 309 negative entries, 84% cache hits, outpacket/query ratio 37%, 12% throttled |
33ccb468 | 4072 | |
d16e0461 TP |
4073 | This means that there are 13791 different names cached, which each may |
4074 | have multiple records attached to them. There are 309 items in the | |
4075 | negative cache, items of which it is known that don't exist and won't do | |
4076 | so for the near future. 84% of incoming questions could be answered | |
4077 | without any additional queries going out to the net. | |
33ccb468 | 4078 | |
d16e0461 TP |
4079 | The outpacket/query ratio means that on average, 0.37 packets were needed |
4080 | to answer a question. Initially this ratio may be well over 100% as | |
4081 | additional queries may be needed to actually recurse the DNS and figure | |
4082 | out the addresses of nameservers. | |
33ccb468 | 4083 | |
d16e0461 TP |
4084 | Finally, 12% of queries were not performed because identical queries had |
4085 | gone out previously, saving load servers worldwide. | |
33ccb468 | 4086 | |
d16e0461 | 4087 | ---------------------------------------------------------------------- |
33ccb468 | 4088 | |
d16e0461 | 4089 | Chapter 13. Master/Slave operation & replication |
33ccb468 | 4090 | |
d16e0461 TP |
4091 | PDNS offers full master and slave semantics for replicating domain |
4092 | information. Furthermore, PDNS can benefit from native database | |
4093 | replication. | |
33ccb468 | 4094 | |
d16e0461 | 4095 | ---------------------------------------------------------------------- |
33ccb468 | 4096 | |
d16e0461 | 4097 | 13.1. Native replication |
33ccb468 | 4098 | |
d16e0461 TP |
4099 | Native replication is the default, unless other operation is specifically |
4100 | configured. Native replication basically means that PDNS will not send out | |
4101 | DNS update notifications, nor will react to them. PDNS assumes that the | |
4102 | backend is taking care of replication unaided. | |
33ccb468 | 4103 | |
d16e0461 TP |
4104 | MySQL replication has proven to be very robust and well suited, even over |
4105 | transatlantic connections between badly peering ISPs. Other PDNS users | |
4106 | employ Oracle replication which also works very well. | |
33ccb468 | 4107 | |
d16e0461 TP |
4108 | To use native replication, configure your backend storage to do the |
4109 | replication and do not configure PDNS to do so. | |
33ccb468 | 4110 | |
d16e0461 | 4111 | ---------------------------------------------------------------------- |
33ccb468 | 4112 | |
d16e0461 | 4113 | 13.2. Slave operation |
33ccb468 | 4114 | |
d16e0461 TP |
4115 | On launch, PDNS requests from all backends a list of domains which have |
4116 | not been checked recently for changes. This should happen every 'refresh' | |
4117 | seconds, as specified in the SOA record. All domains that are unfresh are | |
4118 | then checked for changes over at their master. If the SOA serial number | |
4119 | there is higher, the domain is retrieved and inserted into the database. | |
4120 | In any case, after the check the domain is declared 'fresh', and will only | |
4121 | be checked again after 'refresh' seconds have passed. | |
33ccb468 | 4122 | |
d16e0461 TP |
4123 | Warning Slave support is OFF by default, turn it on by adding slave to the |
4124 | configuration. The same holds for master operation. Both can be on | |
4125 | simultaneously. | |
33ccb468 | 4126 | |
d16e0461 TP |
4127 | PDNS also reacts to notifies by immediately checking if the zone has |
4128 | updated and if so, retransfering it. | |
33ccb468 | 4129 | |
d16e0461 TP |
4130 | All backends which implement this feature must make sure that they can |
4131 | handle transactions so as to not leave the zone in a half updated state. | |
4132 | MySQL configured with either BerkeleyDB or InnoDB meets this requirement, | |
4133 | as do PostgreSQL and Oracle. The Bindbackend implements transaction | |
4134 | semantics by renaming files if and only if they have been retrieved | |
4135 | completely and parsed correctly. | |
33ccb468 | 4136 | |
d16e0461 TP |
4137 | Slave operation can also be programmed using several pdns_control |
4138 | commands, see Section B.1.1. The 'retrieve' command is especially useful | |
4139 | as it triggers an immediate retrieval of the zone from the configured | |
4140 | master. | |
33ccb468 | 4141 | |
d16e0461 | 4142 | ---------------------------------------------------------------------- |
33ccb468 | 4143 | |
d16e0461 | 4144 | 13.2.1. Supermaster automatic provisioning of slaves |
33ccb468 | 4145 | |
d16e0461 TP |
4146 | PDNS can recognize so called 'supermasters'. A supermaster is a host which |
4147 | is master for domains and for which we are to be a slave. When a master | |
4148 | (re)loads a domain, it sends out a notification to its slaves. Normally, | |
4149 | such a notification is only accepted if PDNS already knows that it is a | |
4150 | slave for a domain. | |
33ccb468 | 4151 | |
d16e0461 TP |
4152 | However, a notification from a supermaster carries more persuasion. When |
4153 | PDNS determines that a notification comes from a supermaster and it is | |
4154 | bonafide, PDNS can provision the domain automatically, and configure | |
4155 | itself as a slave for that zone. | |
33ccb468 | 4156 | |
d16e0461 TP |
4157 | To enable this feature, a backend needs to know about the IP address of |
4158 | the supermaster, and how PDNS will be listed in the set of NS records | |
4159 | remotely, and the 'account' name of your supermaster. There is no need to | |
4160 | fill this out but it does help keep track of where a domain comes from. | |
33ccb468 | 4161 | |
d16e0461 | 4162 | ---------------------------------------------------------------------- |
33ccb468 | 4163 | |
d16e0461 | 4164 | 13.3. Master operation |
33ccb468 | 4165 | |
d16e0461 TP |
4166 | When operating as a master, PDNS sends out notifications of changes to |
4167 | slaves, which react to these notifications by querying PDNS to see if the | |
4168 | zone changed, and transferring its contents if it has. Notifications are a | |
4169 | way to promptly propagate zone changes to slaves, as described in RFC | |
4170 | 1996. | |
33ccb468 | 4171 | |
d16e0461 TP |
4172 | Warning Master support is OFF by default, turn it on by adding master to |
4173 | the configuration. The same holds for slave operation. Both can be | |
4174 | on simultaneously. | |
33ccb468 | 4175 | |
d16e0461 TP |
4176 | Left open by RFC 1996 is who is to be notified - which is harder to figure |
4177 | out than it sounds. All slaves for this domain must receive a notification | |
4178 | but the nameserver only knows the names of the slaves - not the IP | |
4179 | addresses, which is where the problem lies. The nameserver itself might be | |
4180 | authoritative for the name of its secondary, but not have the data | |
4181 | available. | |
33ccb468 | 4182 | |
d16e0461 TP |
4183 | To resolve this issue, PDNS tries multiple tactics to figure out the IP |
4184 | addresses of the slaves, and notifies everybody. In contrived | |
4185 | configurations this may lead to duplicate notifications being sent out, | |
4186 | which shouldn't hurt. | |
33ccb468 | 4187 | |
d16e0461 TP |
4188 | Some backends may be able to detect zone changes, others may chose to let |
4189 | the operator indicate which zones have changed and which haven't. Consult | |
4190 | the documentation for your backend to see how it processes changes in | |
4191 | zones. | |
33ccb468 | 4192 | |
d16e0461 TP |
4193 | To help deal with slaves that may have missed notifications, or have |
4194 | failed to respond to them, several override commands are available via the | |
4195 | pdns_control tool (Section B.1.1): | |
33ccb468 | 4196 | |
4197 | pdns_control notify domain | |
d16e0461 TP |
4198 | |
4199 | This instructs PDNS to notify all IP addresses it considers to be | |
4200 | slaves of this domain. | |
33ccb468 | 4201 | |
4202 | pdns_control notify-host domain ip-address | |
33ccb468 | 4203 | |
d16e0461 TP |
4204 | This is truly an override and sends a notification to an arbitrary |
4205 | IP address. Can be used in 'also-notify' situations or when PDNS | |
4206 | has trouble figuring out who to notify - which may happen in | |
4207 | contrived configurations. | |
4208 | ||
4209 | ---------------------------------------------------------------------- | |
33ccb468 | 4210 | |
d16e0461 | 4211 | Chapter 14. Fancy records for seamless email and URL integration |
33ccb468 | 4212 | |
d16e0461 TP |
4213 | PDNS also supports so called 'fancy' records. A Fancy Record is actually |
4214 | not a DNS record, but it is translated into one. Currently, two fancy | |
4215 | records are implemented, but not very useful without additional unreleased | |
4216 | software. For completeness, they are listed here. The software will become | |
4217 | available later on and is part of the Express and PowerMail suite of | |
4218 | programs. | |
4219 | ||
4220 | These records imply extra database lookups which has a performance impact. | |
4221 | Therefore fancy records are only queried for if they are enabled with the | |
4222 | fancy-records command in pdns.conf. | |
33ccb468 | 4223 | |
4224 | MBOXFW | |
33ccb468 | 4225 | |
d16e0461 TP |
4226 | This record denotes an email forward. A typical entry looks like |
4227 | this: | |
33ccb468 | 4228 | |
d16e0461 TP |
4229 | support@yourdomain.com MBOXFW you@yourcompany.com |
4230 | ||
33ccb468 | 4231 | |
d16e0461 TP |
4232 | When PDNS encounters a request for an MX record for yourdomain.com |
4233 | it will, if fancy records are enabled, also check for the | |
4234 | existence of an MBOXFW record ending on '@yourdomain.com', in | |
4235 | which case it will hand out a record containing the configured | |
4236 | smtpredirector. This server should then also be able to access the | |
4237 | PDNS database to figure out where mail to support@yourdomain.com | |
4238 | should go to. | |
33ccb468 | 4239 | |
4240 | URL | |
33ccb468 | 4241 | |
d16e0461 TP |
4242 | URL records work in much the same way, but for HTTP. A sample |
4243 | record: | |
4244 | ||
4245 | yourdomain.com URL http://somewhere.else.com/yourdomain | |
4246 | ||
33ccb468 | 4247 | |
d16e0461 TP |
4248 | A URL record is converted into an A record containing the IP |
4249 | address configured with the urlredirector setting. On that IP | |
4250 | address a webserver should live that knows how to redirect | |
4251 | yourdomain.com to http://somewhere.else.com/yourdomain. | |
33ccb468 | 4252 | |
d16e0461 | 4253 | ---------------------------------------------------------------------- |
33ccb468 | 4254 | |
d16e0461 | 4255 | Chapter 15. Index of all settings |
33ccb468 | 4256 | |
d16e0461 TP |
4257 | All PDNS settings are listed here, excluding those that originate from |
4258 | backends, which are documented in the relevant chapters. | |
33ccb468 | 4259 | |
4260 | allow-axfr-ips=... | |
d16e0461 TP |
4261 | |
4262 | Behaviour pre 2.9.10: When not allowing AXFR (disable-axfr), DO | |
4263 | allow from these IP addresses or netmasks. | |
4264 | ||
4265 | Behaviour post 2.9.10: If set, only these IP addresses or netmasks | |
4266 | will be able to perform AXFR. | |
33ccb468 | 4267 | |
4268 | allow-recursion=... | |
d16e0461 TP |
4269 | |
4270 | By specifying allow-recursion, recursion can be restricted to | |
4271 | netmasks specified. The default is to allow recursion from | |
4272 | everywhere. Example: allow-recursion=192.168.0.0/24, 10.0.0.0/8, | |
4273 | 1.2.3.4. | |
33ccb468 | 4274 | |
fc2fb8ea AG |
4275 | allow-recursion-override=on|off |
4276 | ||
4277 | By specifying allow-recursion-override, local data even about | |
4278 | hosts that don't exist will override the internet. This allows you | |
4279 | to generate zones that don't really exist on the internet. Does | |
4280 | increase the number of SQL queries for hosts that truly don't | |
4281 | exist, also not in your database. | |
4282 | ||
33ccb468 | 4283 | cache-ttl=... |
d16e0461 TP |
4284 | |
4285 | Seconds to store packets in the PacketCache. See Section 9.1. | |
33ccb468 | 4286 | |
4287 | chroot=... | |
d16e0461 TP |
4288 | |
4289 | If set, chroot to this directory for more security. See Chapter 7. | |
33ccb468 | 4290 | |
4291 | config-dir=... | |
d16e0461 TP |
4292 | |
4293 | Location of configuration directory (pdns.conf) | |
33ccb468 | 4294 | |
4295 | config-name=... | |
d16e0461 TP |
4296 | |
4297 | Name of this virtual configuration - will rename the binary image. | |
4298 | See Chapter 8. | |
33ccb468 | 4299 | |
4300 | control-console=... | |
d16e0461 TP |
4301 | |
4302 | Debugging switch - don't use. | |
33ccb468 | 4303 | |
4304 | daemon=... | |
d16e0461 TP |
4305 | |
4306 | Operate as a daemon | |
33ccb468 | 4307 | |
4308 | default-soa-name=... | |
d16e0461 TP |
4309 | |
4310 | name to insert in the SOA record if none set in the backend | |
33ccb468 | 4311 | |
4312 | disable-axfr=... | |
d16e0461 TP |
4313 | |
4314 | Do not allow zone transfers. Before 2.9.10, this could be | |
4315 | overridden by allow-axfr-ips. | |
33ccb468 | 4316 | |
4317 | disable-tcp=... | |
d16e0461 TP |
4318 | |
4319 | Do not listen to TCP queries. Breaks RFC compliance. | |
33ccb468 | 4320 | |
4321 | distributor-threads=... | |
d16e0461 TP |
4322 | |
4323 | Default number of Distributor (backend) threads to start. See | |
4324 | Chapter 9. | |
33ccb468 | 4325 | |
4326 | fancy-records=... | |
d16e0461 TP |
4327 | |
4328 | Process URL and MBOXFW records. See Chapter 14. | |
33ccb468 | 4329 | |
4330 | guardian | --guardian=yes | --guardian=no | |
d16e0461 TP |
4331 | |
4332 | Run within a guardian process. See Section B.2. | |
33ccb468 | 4333 | |
4334 | help | |
d16e0461 TP |
4335 | |
4336 | Provide a helpful message | |
33ccb468 | 4337 | |
4338 | launch=... | |
d16e0461 TP |
4339 | |
4340 | Which backends to launch and order to query them in. See Section | |
4341 | B.3. | |
33ccb468 | 4342 | |
4343 | lazy-recursion=... | |
d16e0461 TP |
4344 | |
4345 | On by default as of 2.1. Checks local data first before recursing. | |
4346 | See Chapter 11. | |
33ccb468 | 4347 | |
4348 | load-modules=... | |
d16e0461 TP |
4349 | |
4350 | Load this module - supply absolute or relative path. See Section | |
4351 | B.3. | |
33ccb468 | 4352 | |
4353 | local-address=... | |
d16e0461 TP |
4354 | |
4355 | Local IP address to which we bind. You can specify multiple | |
4356 | addresses separated by commas or whitespace. It is highly advised | |
4357 | to bind to specific interfaces and not use the default 'bind to | |
4358 | any'. This causes big problems if you have multiple IP addresses. | |
4359 | Unix does not provide a way of figuring out what IP address a | |
4360 | packet was sent to when binding to any. | |
33ccb468 | 4361 | |
4362 | local-port=... | |
d16e0461 TP |
4363 | |
4364 | The port on which we listen. Only one port possible. | |
33ccb468 | 4365 | |
4366 | log-failed-updates=... | |
d16e0461 TP |
4367 | |
4368 | If set to 'no', failed Windows Dynamic Updates will not be logged. | |
33ccb468 | 4369 | |
4370 | log-dns-details=... | |
d16e0461 TP |
4371 | |
4372 | If set to 'no', informative-only DNS details will not even be sent | |
4373 | to syslog, improving performance. Available from 2.5 and onwards. | |
33ccb468 | 4374 | |
4375 | logging-facility=... | |
d16e0461 TP |
4376 | |
4377 | If set to a a digit, logging is performed under this LOCAL | |
4378 | facility. See Section 6.3. Available from 1.99.9 and onwards. | |
33ccb468 | 4379 | |
4380 | loglevel=... | |
d16e0461 TP |
4381 | |
4382 | Amount of logging. Higher is more. Do not set below 3 | |
33ccb468 | 4383 | |
4384 | max-queue-length=... | |
d16e0461 TP |
4385 | |
4386 | If this many packets are waiting for database attention, consider | |
4387 | the situation hopeless and respawn. | |
33ccb468 | 4388 | |
4389 | module-dir=... | |
d16e0461 TP |
4390 | |
4391 | Default directory for modules. See Section B.3. | |
33ccb468 | 4392 | |
4393 | negquery-cache-ttl=... | |
d16e0461 TP |
4394 | |
4395 | Seconds to store queries with no answer in the Query Cache. See | |
4396 | Section 9.2. | |
33ccb468 | 4397 | |
4398 | no-config | |
d16e0461 TP |
4399 | |
4400 | Do not attempt to read the configuration file. | |
33ccb468 | 4401 | |
4402 | out-of-zone-additional-processing | | |
d16e0461 TP |
4403 | --out-of-zone-additional-processing=yes | |
4404 | --out-of-zone-additional-processing=no | |
4405 | ||
4406 | Do out of zone additional processing | |
33ccb468 | 4407 | |
4408 | query-cache-ttl=... | |
d16e0461 TP |
4409 | |
4410 | Seconds to store queries with an answer in the Query Cache. See | |
4411 | Section 9.2. | |
33ccb468 | 4412 | |
4413 | queue-limit=... | |
d16e0461 TP |
4414 | |
4415 | Maximum number of miliseconds to queue a query. See Chapter 9. | |
4416 | ||
4417 | query-local-address=... | |
4418 | ||
4419 | The IP address to use as a source address for sending queries. | |
4420 | Useful if you have multiple IPs and pdns is not bound to the IP | |
4421 | address your operating system uses by default for outgoing | |
4422 | packets. | |
33ccb468 | 4423 | |
4424 | query-logging | query-logging=yes | query-logging=no | |
d16e0461 TP |
4425 | |
4426 | Hints to a backend that it should log a textual representation of | |
4427 | queries it performs. Can be set at runtime. | |
33ccb468 | 4428 | |
4429 | recursive-cache-ttl=... | |
d16e0461 TP |
4430 | |
4431 | Seconds to store recursive packets in the PacketCache. See Section | |
4432 | 9.1. | |
33ccb468 | 4433 | |
4434 | recursor=... | |
d16e0461 TP |
4435 | |
4436 | If set, recursive queries will be handed to the recursor specified | |
4437 | here. See Chapter 11. | |
33ccb468 | 4438 | |
4439 | setgid=... | |
d16e0461 TP |
4440 | |
4441 | If set, change group id to this gid for more security. See Chapter | |
4442 | 7. | |
33ccb468 | 4443 | |
4444 | setuid=... | |
d16e0461 TP |
4445 | |
4446 | If set, change user id to this uid for more security. See Chapter | |
4447 | 7. | |
33ccb468 | 4448 | |
4449 | skip-cname | --skip-cname=yes | --skip-cname=no | |
d16e0461 TP |
4450 | |
4451 | Do not perform CNAME indirection for each query. Has performance | |
4452 | implications. See Chapter 7. | |
33ccb468 | 4453 | |
4454 | slave-cycle-interval=60 | |
d16e0461 TP |
4455 | |
4456 | Schedule slave up-to-date checks of domains whose status is | |
4457 | unknown every .. seconds. See Chapter 14. | |
33ccb468 | 4458 | |
4459 | smtpredirector=... | |
d16e0461 TP |
4460 | |
4461 | Our smtpredir MX host. See Chapter 14. | |
33ccb468 | 4462 | |
4463 | soa-serial-offset=... | |
d16e0461 TP |
4464 | |
4465 | If your database contains single-digit SOA serials and you need to | |
4466 | host .DE domains, this setting can help placate their 6-digit SOA | |
4467 | serial requirements. Suggested value is to set this to 1000000 | |
4468 | which adds 1000000 to all SOA Serials under that offset. | |
33ccb468 | 4469 | |
4470 | socket-dir=... | |
d16e0461 TP |
4471 | |
4472 | Where the controlsocket will live. See Section B.1. | |
33ccb468 | 4473 | |
4474 | strict-rfc-axfrs | --strict-rfc-axfrs=yes | --strict-rfc-axfrs=no | |
d16e0461 TP |
4475 | |
4476 | Perform strictly RFC conformant AXFRs, which are slow, but needed | |
4477 | to placate some old client tools. | |
33ccb468 | 4478 | |
4479 | urlredirector=... | |
d16e0461 TP |
4480 | |
4481 | Where we send hosts to that need to be url redirected. See Chapter | |
4482 | 14. | |
33ccb468 | 4483 | |
fc2fb8ea AG |
4484 | version-string=anonymous|powerdns|full|custom |
4485 | ||
4486 | When queried for its version over DNS (dig chaos txt version.bind | |
4487 | @pdns.ip.address), PowerDNS normally resonds truthfully. With this | |
4488 | setting you can overrule what will be returned. Set the | |
4489 | version-string to 'full' to get the default behaviour, to | |
4490 | 'powerdns' to just make it state 'served by PowerDNS - | |
4491 | http://www.powerdns.com'. The 'anonymous' setting will return a | |
4492 | ServFail, much like Microsoft nameservers do. You can set this | |
4493 | response to a custom value as well. | |
4494 | ||
33ccb468 | 4495 | webserver | --webserver=yes | --webserver=no |
d16e0461 TP |
4496 | |
4497 | Start a webserver for monitoring. See Chapter 6. | |
33ccb468 | 4498 | |
4499 | webserver-address=... | |
d16e0461 TP |
4500 | |
4501 | IP Address of webserver to listen on. See Chapter 6. | |
33ccb468 | 4502 | |
4503 | webserver-password=... | |
d16e0461 TP |
4504 | |
4505 | Password required for accessing the webserver. See Chapter 6. | |
33ccb468 | 4506 | |
4507 | webserver-port=... | |
d16e0461 TP |
4508 | |
4509 | Port of webserver to listen on. See Chapter 6. | |
33ccb468 | 4510 | |
4511 | wildcard-url=... | |
d16e0461 TP |
4512 | |
4513 | Check for wildcard URL records. | |
33ccb468 | 4514 | |
4515 | wildcards=... | |
33ccb468 | 4516 | |
d16e0461 TP |
4517 | Honor wildcards in the database. On by default. Turning this off |
4518 | has performance implications, see Chapter 9. | |
4519 | ||
4520 | ---------------------------------------------------------------------- | |
4521 | ||
4522 | Chapter 16. Index of all internal metrics | |
4523 | ||
4524 | ---------------------------------------------------------------------- | |
33ccb468 | 4525 | |
d16e0461 | 4526 | 16.1. Counters & variables |
33ccb468 | 4527 | |
d16e0461 TP |
4528 | A number of counters and variables are set during PDNS operation. These |
4529 | can be queried with the init.d dump, show and mrtg commands, or viewed | |
4530 | with the webserver. | |
33ccb468 | 4531 | |
4532 | corrupt-packets | |
d16e0461 TP |
4533 | |
4534 | Number of corrupt packets received | |
33ccb468 | 4535 | |
4536 | latency | |
d16e0461 TP |
4537 | |
4538 | Average number of microseconds a packet spends within PDNS | |
33ccb468 | 4539 | |
4540 | packetcache-hit | |
d16e0461 TP |
4541 | |
4542 | Number of packets which were answered out of the cache | |
33ccb468 | 4543 | |
4544 | packetcache-miss | |
d16e0461 TP |
4545 | |
4546 | Number of times a packet could not be answered out of the cache | |
33ccb468 | 4547 | |
4548 | packetcache-size | |
d16e0461 TP |
4549 | |
4550 | Amount of packets in the packetcache | |
33ccb468 | 4551 | |
4552 | qsize-a | |
d16e0461 TP |
4553 | |
4554 | Size of the queue before the transmitting socket. | |
33ccb468 | 4555 | |
4556 | qsize-q | |
d16e0461 TP |
4557 | |
4558 | Number of packets waiting for database attention | |
33ccb468 | 4559 | |
4560 | servfail-packets | |
d16e0461 TP |
4561 | |
4562 | Amount of packets that could not be answered due to database | |
4563 | problems | |
33ccb468 | 4564 | |
4565 | tcp-answers | |
d16e0461 TP |
4566 | |
4567 | Number of answers sent out over TCP | |
33ccb468 | 4568 | |
4569 | tcp-questions | |
d16e0461 TP |
4570 | |
4571 | Number of questions received over TCP | |
33ccb468 | 4572 | |
4573 | timedout-questions | |
d16e0461 TP |
4574 | |
4575 | Amount of packets that were dropped because they had to wait too | |
4576 | long internally | |
33ccb468 | 4577 | |
4578 | udp-answers | |
d16e0461 TP |
4579 | |
4580 | Number of answers sent out over UDP | |
33ccb468 | 4581 | |
4582 | udp-questions | |
33ccb468 | 4583 | |
d16e0461 | 4584 | Number of questions received over UDP |
33ccb468 | 4585 | |
d16e0461 | 4586 | ---------------------------------------------------------------------- |
33ccb468 | 4587 | |
d16e0461 | 4588 | 16.1.1. Ring buffers |
33ccb468 | 4589 | |
d16e0461 TP |
4590 | Besides counters, PDNS also maintains the ringbuffers. A ringbuffer |
4591 | records events, each new event gets a place in the buffer until it is | |
4592 | full. When full, earlier entries get overwritten, hence the name 'ring'. | |
4593 | ||
4594 | By counting the entries in the buffer, statistics can be generated. These | |
4595 | statistics can currently only be viewed using the webserver and are in | |
4596 | fact not even collected without the webserver running. | |
4597 | ||
4598 | The following ringbuffers are available: | |
33ccb468 | 4599 | |
4600 | Log messages (logmessages) | |
d16e0461 TP |
4601 | |
4602 | All messages logged | |
33ccb468 | 4603 | |
4604 | Queries for existing records but for a type we don't have | |
d16e0461 TP |
4605 | (noerror-queries) |
4606 | ||
4607 | Queries for, say, the AAAA record of a domain, when only an A is | |
4608 | available. Queries are listed in the following format: name/type. | |
4609 | So an AAA query for pdns.powerdns.com looks like | |
4610 | pdns.powerdns.com/AAAA. | |
4611 | ||
4612 | Queries for non-existing records within existing domains(nxdomain-queries) | |
4613 | ||
4614 | If PDNS knows it is authoritative over a domain, and it sees a | |
4615 | question for a record in that domain that does not exist, it is | |
4616 | able to send out an authoritative 'no such domain' message. | |
4617 | Indicates that hosts are trying to connect to services really not | |
4618 | in your zone. | |
33ccb468 | 4619 | |
4620 | UDP queries received (udp-queries) | |
d16e0461 TP |
4621 | |
4622 | All UDP queries seen. | |
33ccb468 | 4623 | |
4624 | Remote server IP addresses (remotes) | |
d16e0461 TP |
4625 | |
4626 | Hosts querying PDNS. Be aware that UDP is anonymous - person A can | |
4627 | send queries that appear to be coming from person B. | |
33ccb468 | 4628 | |
4629 | Remotes sending corrupt packets (remote-corrupts) | |
d16e0461 TP |
4630 | |
4631 | Hosts sending PDNS broken packets, possibly meant to disrupt | |
4632 | service. Be aware that UDP is anonymous - person A can send | |
4633 | queries that appear to be coming from person B. | |
33ccb468 | 4634 | |
4635 | Remotes querying domains for which we are not auth (remote-unauth) | |
d16e0461 TP |
4636 | |
4637 | It may happen that there are misconfigured hosts on the internet | |
4638 | which are configured to think that a PDNS installation is in fact | |
4639 | a resolving nameserver. These hosts will not get useful answers | |
4640 | from PDNS. This buffer lists hosts sending queries for domains | |
4641 | which PDNS does not know about. | |
33ccb468 | 4642 | |
4643 | Queries that could not be answered due to backend errors | |
d16e0461 TP |
4644 | (servfail-queries) |
4645 | ||
4646 | For one reason or another, a backend may be unable to extract | |
4647 | answers for a certain domain from its storage. This may be due to | |
4648 | a corrupt database or to inconsistent data. When this happens, | |
4649 | PDNS sends out a 'servfail' packet indicating that it was unable | |
4650 | to answer the question. This buffer shows which queries have been | |
4651 | causing servfails. | |
33ccb468 | 4652 | |
4653 | Queries for domains that we are not authoritative for (unauth-queries) | |
33ccb468 | 4654 | |
d16e0461 TP |
4655 | If a domain is delegated to a PDNS instance, but the backend is |
4656 | not made aware of this fact, questions come in for which no answer | |
4657 | is available, nor is the authority. Use this ringbuffer to spot | |
4658 | such queries. | |
4659 | ||
4660 | ---------------------------------------------------------------------- | |
33ccb468 | 4661 | |
d16e0461 TP |
4662 | Chapter 17. Supported record types and their storage |
4663 | ||
4664 | This chapter lists all record types PDNS supports, and how they are stored | |
4665 | in backends. The list is mostly alphabetical but some types are grouped. | |
33ccb468 | 4666 | |
4667 | A | |
d16e0461 TP |
4668 | |
4669 | The A record contains an IP address. It is stored as a decimal | |
4670 | dotted quad string, for example: '213.244.168.210'. | |
33ccb468 | 4671 | |
4672 | AAAA | |
d16e0461 TP |
4673 | |
4674 | The AAAA record contains an IPv6 address. An example: | |
4675 | '3ffe:8114:2000:bf0::1'. | |
33ccb468 | 4676 | |
4677 | CNAME | |
d16e0461 TP |
4678 | |
4679 | The CNAME record specifies the canonical name of a record. It is | |
4680 | stored plainly. Like all other records, it is not terminated by a | |
4681 | dot. A sample might be 'webserver-01.yourcompany.com'. | |
33ccb468 | 4682 | |
4683 | HINFO | |
d16e0461 TP |
4684 | |
4685 | Hardware Info record, used to specify CPU and operating system. | |
4686 | Stored with a single space separating these two, example: 'i386 | |
4687 | Linux'. | |
33ccb468 | 4688 | |
4689 | MX | |
d16e0461 TP |
4690 | |
4691 | The MX record specifies a mail exchanger host for a domain. Each | |
4692 | mail exchanger also has a priority or preference. This should be | |
4693 | specified in the separate field dedicated for that purpose, often | |
4694 | called 'prio'. | |
33ccb468 | 4695 | |
4696 | NAPTR | |
33ccb468 | 4697 | |
d16e0461 | 4698 | \r Naming Authority Pointer, RFC 2915. Stored as follows: |
33ccb468 | 4699 | |
d16e0461 TP |
4700 | '100 50 "s" "z3950+I2L+I2C" "" _z3950._tcp.gatech.edu'. |
4701 | ||
33ccb468 | 4702 | |
d16e0461 TP |
4703 | The fields are: order, preference, flags, service, regex, |
4704 | replacement. Note that the replacement is not enclosed in quotes, | |
4705 | and should not be. The replacement may be omitted, in which case | |
4706 | it is empty. See also RFC 2916 for how to use NAPTR for ENUM | |
4707 | (E.164) purposes. | |
33ccb468 | 4708 | |
4709 | NS | |
d16e0461 TP |
4710 | |
4711 | Nameserver record. Specifies nameservers for a domain. Stored | |
4712 | plainly: 'ns1.powerdns.com', as always without a terminating dot. | |
33ccb468 | 4713 | |
4714 | PTR | |
d16e0461 TP |
4715 | |
4716 | Reverse pointer, used to specify the host name belonging to an IP | |
4717 | or IPv6 address. Name is stored plainly: 'www.powerdns.com'. As | |
4718 | always, no terminating dot. | |
33ccb468 | 4719 | |
4720 | RP | |
d16e0461 TP |
4721 | |
4722 | Responsible Person record, as described in RFC 1183. Stored with a | |
4723 | single space between the mailbox name and the more-information | |
4724 | pointer. Example 'peter.powerdns.com peter.people.powerdns.com', | |
4725 | to indicate that peter@powerdns.com is responsible and that more | |
4726 | information about peter is available by querying the TXT record of | |
4727 | peter.people.powerdns.com. | |
33ccb468 | 4728 | |
4729 | SOA | |
33ccb468 | 4730 | |
d16e0461 TP |
4731 | The Start of Authority record is one of the most complex |
4732 | available. It specifies a lot about a domain: the name of the | |
4733 | master nameserver ('the primary'), the hostmaster and a set of | |
4734 | numbers indicating how the data in this domain expires and how | |
4735 | often it needs to be checked. Further more, it contains a serial | |
4736 | number which should rise on each change of the domain. | |
4737 | ||
4738 | The stored format is: | |
4739 | ||
4740 | primary hostmaster serial refresh retry expire default_ttl | |
4741 | ||
4742 | ||
4743 | Besides the primary and the hostmaster, all fields are numerical. | |
4744 | PDNS has a set of default values: | |
4745 | ||
4746 | Table 17-1. SOA fields | |
4747 | ||
4748 | +-----------------------------------------------------+ | |
4749 | | primary | default-soa-name configuration option | | |
4750 | |-------------+---------------------------------------| | |
4751 | | hostmaster | hostmaster@domain-name | | |
4752 | |-------------+---------------------------------------| | |
4753 | | serial | 0 | | |
4754 | |-------------+---------------------------------------| | |
4755 | | refresh | 10800 (3 hours) | | |
4756 | |-------------+---------------------------------------| | |
4757 | | retry | 3600 (1 hour) | | |
4758 | |-------------+---------------------------------------| | |
4759 | | expire | 604800 (1 week) | | |
4760 | |-------------+---------------------------------------| | |
4761 | | default_ttl | 3600 (1 hour) | | |
4762 | +-----------------------------------------------------+ | |
4763 | ||
4764 | The fields have complicated and sometimes controversial meanings. | |
4765 | The 'serial' field is special. If left at 0, the default, PDNS | |
4766 | will perform an internal list of the domain to determine highest | |
4767 | change_date field of all records within the zone, and use that as | |
4768 | the zone serial number. This means that the serial number is | |
4769 | always raised when changes are made to the zone, as long as the | |
4770 | change_date field is being set. | |
4771 | ||
4772 | SRV | |
4773 | ||
4774 | SRV records can be used to encode the location and port of | |
4775 | services on a domain name. When encoding, the priority field is | |
4776 | used to encode the priority. For example, | |
4777 | '_ldap._tcp.dc._msdcs.conaxis.ch SRV 0 100 389 mars.conaxis.ch' | |
4778 | would be encoded with 0 in the priorit field and '100 389 | |
4779 | mars.conaxis.ch' in the tontent field. | |
4780 | ||
4781 | TXT | |
33ccb468 | 4782 | |
d16e0461 TP |
4783 | The TXT field can be used to attach textual data to a domain. Text |
4784 | is stored plainly. | |
33ccb468 | 4785 | |
d16e0461 | 4786 | ---------------------------------------------------------------------- |
33ccb468 | 4787 | |
d16e0461 | 4788 | Chapter 18. HOWTO & Frequently Asked Questions |
33ccb468 | 4789 | |
d16e0461 | 4790 | This chapter contains a number of FAQs and HOWTOs. |
33ccb468 | 4791 | |
d16e0461 | 4792 | ---------------------------------------------------------------------- |
33ccb468 | 4793 | |
d16e0461 | 4794 | 18.1. Getting support, free and paid FAQ |
33ccb468 | 4795 | |
d16e0461 TP |
4796 | PowerDNS is an open source program so you may get help from the PowerDNS |
4797 | users' community or from its authors. You may also help others (please | |
4798 | do). | |
4799 | ||
4800 | Some users may not have experience in interacting with developers or the | |
4801 | open source community. This FAQ is to be considered MANDATORY READING | |
4802 | before asking us for help. | |
4803 | ||
4804 | Q: Help! | |
4805 | ||
4806 | A: Please try harder. Specifically, before people will be able to | |
4807 | help you, they need to know a lot about your system. Things you | |
4808 | may find irrelevant. But, as you have a problem, you are not in a | |
4809 | good position to know what is relevant and what not. | |
4810 | ||
4811 | Q: I have a question, what details should I supply? | |
4812 | ||
4813 | A: Start out with stating what you think should be happening. | |
4814 | Quite often, wrong expectations are the actual proble. | |
4815 | Furthermore, which database backend you use, your operating | |
4816 | system, which version of PowerDNS you use and where you got it | |
4817 | from (RPM, .DEB, tar.gz). If you compiled it yourself, what were | |
4818 | the ./configure parameters. | |
4819 | ||
4820 | In the Open Source community, not supplying vital details is | |
4821 | interpreted as a lack of respect for those willing to take time to | |
4822 | answer your questions! | |
4823 | ||
4824 | If at *all* possible, supply the actual name of your domain and | |
4825 | the IP address of your server(s). | |
4826 | ||
4827 | Q: Where should I send my question? | |
33ccb468 | 4828 | |
d16e0461 TP |
4829 | A: To a mailinglist. Do not mail the authors directly unless you |
4830 | previously entered a support contract with them! For subscription | |
4831 | details, see the mailinglists page. | |
33ccb468 | 4832 | |
d16e0461 TP |
4833 | Questions about using PowerDNS should be sent to the pdns-users |
4834 | list, questions about compiler errors or feature requests to | |
4835 | pdns-dev. | |
33ccb468 | 4836 | |
d16e0461 | 4837 | Before posting, read all FAQs and tell people you did. |
33ccb468 | 4838 | |
d16e0461 TP |
4839 | Q: I'm special, I don't email to mailinglists! |
4840 | ||
4841 | We're special too, and we ask you to mail the mailinglists. If you | |
4842 | need privacy, consider entering a support relationship with us, in | |
4843 | which case you can email <support@powerdns.com>. | |
4844 | ||
4845 | ---------------------------------------------------------------------- | |
4846 | ||
4847 | 18.2. Using and Compiling PowerDNS FAQ | |
4848 | ||
4849 | In the course of compiling and using PowerDNS, many questions may arise. | |
4850 | Here are some we've heard earlier or questions we expect people may have. | |
4851 | Please read this list before mailing us! | |
4852 | ||
4853 | Q: I get this entry a lot of times in my log file: Authoritative empty NO | |
4854 | ERROR to 1.2.3.4 for 'powerdns.nl' (AAAA).. | |
4855 | ||
4856 | As the name implies, this is not an error. It tells you there are | |
4857 | questions for a domain which exists in your database, but for | |
4858 | which no record of the requested type exists. To get rid of this | |
4859 | error, add log-dns-details=off to your configuration. | |
33ccb468 | 4860 | |
4861 | Q: Can I launch multiple backends simultaneously? | |
d16e0461 TP |
4862 | |
4863 | A: You can. This might for example be useful to keep an existing | |
4864 | BIND configuration around but to store new zones in, say MySQL. | |
4865 | The syntax to use is 'launch=bind,gmysql'. | |
4866 | ||
4867 | Q: PowerDNS does not give authoritative answers, how come? | |
4868 | ||
4869 | A: This is almost always not the case. An authoritative answer is | |
4870 | recognized by the 'AA' bit being set. Many tools prominently print | |
4871 | the number of Authority records included in an answer, leading | |
4872 | users to conclude that the absence or presence of these records | |
4873 | indicates the authority of an answer. This is not the case. | |
4874 | ||
4875 | Verily, many misguided country code domain operators have fallen | |
4876 | into this trap and demand authority records, even though these are | |
4877 | fluff and quite often misleading. Invite such operators to look at | |
4878 | section 6.2.1 of RFC 1034, which shows a correct authoritative | |
4879 | answer without authority records. In fact, none of the | |
4880 | non-deprecated authoritative answers shown have authority records! | |
4881 | ||
4882 | Sorry for sounding like DJB on this, but we get so many misguided | |
4883 | questions about authority.. | |
33ccb468 | 4884 | |
4885 | Q: Which backend should I use? There are so many! | |
33ccb468 | 4886 | |
d16e0461 TP |
4887 | A: If you have no external constraints, the Generic MySQL (gmysql) |
4888 | and Generic PostgreSQL (gpgsql) ones are probably the most used | |
4889 | and complete. By all means do not use the non-generic MySQL | |
4890 | backend, which is deprecated and only available for older | |
4891 | installations. | |
4892 | ||
4893 | The Oracle backend also has happy users, we know of no deployments | |
4894 | of the DB2 backend. The BIND backend is pretty capable too in | |
4895 | fact, but many prefer a relational database. | |
33ccb468 | 4896 | |
4897 | Q: I try to launch the pgmysqlbackend and it can't find it! | |
d16e0461 TP |
4898 | |
4899 | A: You did not read the changelog, nor the README. The 'pgmysql' | |
4900 | backend is no more and has been split into the gmysql and gpgsql | |
4901 | backends, with the common code residing within PowerDNS itself. | |
33ccb468 | 4902 | |
4903 | Q: PowerDNS compiles under OpenBSD, but crashes immediately, now what? | |
d16e0461 TP |
4904 | |
4905 | A: Reasons behind this are somewhat unclear but we hear they go | |
4906 | away if you use a more recent compiler. Let us know on | |
4907 | <pdns-dev@mailman.powerdns.com>. See also here. | |
33ccb468 | 4908 | |
4909 | Q: I'm trying to build from CVS but I get lots of weird errors! | |
d16e0461 TP |
4910 | |
4911 | A: Read the 'HACKING' file, it lists the build requirements | |
4912 | (mostly autoconf, automake, libtool). In many cases, it may be | |
4913 | easier to build from the source distribution though. | |
33ccb468 | 4914 | |
4915 | Q: I'm on Solaris 7 and AAAA records do not work | |
d16e0461 TP |
4916 | |
4917 | A: Indeed, and this is pretty sad. Either upgrade to Solaris 8 or | |
4918 | convince people to write the replacement functions needed to | |
4919 | encode AAAA if the host operating system does not offer them. | |
33ccb468 | 4920 | |
4921 | Q: When compiling I get errors about 'sstream' and 'ostringstream', or | |
d16e0461 TP |
4922 | BITSPERCHAR |
4923 | ||
4924 | A: Your gcc is too old. Versions 2.95.2 and older are not | |
4925 | supported. Many distributions have improved gcc 2.95.2 with an | |
4926 | ostringstream implementation, in which case their 2.95.2 is also | |
4927 | supported. We like gcc 3.2.1 best. | |
33ccb468 | 4928 | |
4929 | Q: Ok, I've installed gcc 3.2.1 but now the gpgsql backend won't link | |
d16e0461 TP |
4930 | |
4931 | A: Sadly, the gcc C++ on-disk object format has changed a few | |
4932 | times since the 2.95 days. This means that gcc 3.2.1 cannot link | |
4933 | against libpq++.so compiled with 2.95. The trick is to recompile | |
4934 | PostgreSQL with 3.2.1 too and have it install in a separate | |
4935 | location. Then reconfigure the pdns compile to look there, with | |
4936 | ./configure --with-pgsql-lib=/opt/postgresql-with-3.2.1/lib | |
33ccb468 | 4937 | |
4938 | Q: I've installed PostgreSQL 7.3 but it has no libpq++.so | |
d16e0461 TP |
4939 | |
4940 | A: As of 7.3, libpq++ has been split out of the main PostgreSQL | |
4941 | distribution. See here. It would in fact be a great idea to move | |
4942 | the gpgsql backend to the C interface instead of the C++ one. On | |
4943 | Debian 'Sid', libpq++.so hides in the libpqpp-dev package. | |
33ccb468 | 4944 | |
4945 | Q: PowerDNS crashes when I install the pdns-static .deb on Debian SID | |
d16e0461 TP |
4946 | |
4947 | A: Indeed. Install the .debs that come with Debian or recompile | |
4948 | PowerDNS yourself. If not using MySQL, the crashes will go away if | |
4949 | you remove setuid and setgid statements from the configuration. | |
4950 | ||
4951 | Q: Why don't my slaves act on notifications and transfer my updated zone? | |
4952 | ||
4953 | A: Raise the serial number of your zone. In most backends, this is | |
4954 | the first digit of the SOA contents field. If this number is lower | |
4955 | to equal to that on a slave, it will not consider your zone | |
4956 | updated. | |
4957 | ||
4958 | Q: Master or Slave support is not working, PDNS is not picking up changes | |
4959 | ||
4960 | A: The Master/Slave apparatus is off by default. Turn it on by | |
4961 | adding a slave and/or master statement to the configuration file. | |
4962 | Also, check that the configured backend is master or slave | |
4963 | capable. | |
4964 | ||
4965 | Q: My masters won't allow PowerDNS to access zones as it is using the | |
4966 | wrong local IP address | |
4967 | ||
4968 | A: Mark Bergsma contributed the query-local-address setting to | |
4969 | tell PowerDNS which local IP address to use. | |
4970 | ||
4971 | Q: I compiled PowerDNS myself and I see weird problems, especially on SMP | |
4972 | ||
4973 | A: There are known issues between gcc <3.2 and PowerDNS on Linux | |
4974 | SMP systems. The exact cause is not known but moving to our | |
4975 | precompiled version always fixes the problems. If you compile | |
4976 | yourself, use a recent gcc! | |
4977 | ||
4978 | Q: PowerDNS does not answer queries on all my IP addresses and I've | |
4979 | ignored the warning I got about that at startup | |
4980 | ||
4981 | A: Please don't ignore what PowerDNS says to you. Furthermore, | |
4982 | read Chapter 15 about the local-address setting, and use it to | |
4983 | specify which IP addresses PowerDNS should listen on. | |
4984 | ||
4985 | Q: Can I use a MySQL database with the Windows version of PowerDNS? | |
4986 | ||
4987 | A: You can. MySQL support is supplied through the ODBC backend, | |
4988 | which is compiled into the main binary. So if you want to use | |
4989 | MySQL you can change the pdns.conf file, which is located in the | |
4990 | PowerDNS for Windows directory, to use the correct ODBC data | |
4991 | sources. If you don't know how to use ODBC with MySQL: | |
4992 | ||
4993 | * Download MyODBC from http://www.mysql.com/ | |
4994 | ||
4995 | * Install the MySQL ODBC driver. | |
4996 | ||
4997 | Then you can follow the instructions located in Chapter 3. But | |
4998 | instead of selecting the Microsoft Access Driver you select the | |
4999 | MySQL ODBC Driver and configure it to use your MySQL database. | |
5000 | ||
5001 | Note For other databases for which an ODBC driver is | |
5002 | available, the procedure is the same as this example. | |
5003 | ||
5004 | ---------------------------------------------------------------------- | |
5005 | ||
5006 | 18.3. Backend developer HOWTO | |
5007 | ||
5008 | Writing backends without access to the full PDNS source means that you | |
5009 | need to write code that can be loaded by PDNS at runtime. This in turn | |
5010 | means that you need to use the same compiler that we do. For linux, this | |
5011 | is currently GCC 3.0.4, although any 3.0.x compiler is probably fine. In | |
5012 | tests, even 3.1 works. | |
5013 | ||
5014 | For FreeBSD we use GCC 2.95.2. | |
5015 | ||
5016 | Furthermore, your pdns_server executable must be dynamically linked. The | |
5017 | default .rpm PDNS contains a static binary so you need to retrieve the | |
5018 | dynamic rpm or the dynamic tar.gz or the Debian unstable ('Woody') deb. | |
5019 | FreeBSD dynamic releases are forthcoming. | |
5020 | ||
5021 | Q: Will PDNS drivers work with other PDNS versions than they were compiled | |
5022 | for? | |
5023 | ||
5024 | A: 'Probably'. We make no guarantees. Efforts have been made to | |
5025 | keep the interface between the backend and PDNS as thin as | |
5026 | possible. For example, a backend compiled with the 1.99.11 backend | |
5027 | development kit works with 1.99.10. But don't count on it. We will | |
5028 | notify when we think an incompatible API change has occured but | |
5029 | you are best off recompiling your driver for each new PDNS | |
5030 | release. | |
33ccb468 | 5031 | |
5032 | Q: What is in that DNSPacket * pointer passed to lookup! | |
d16e0461 TP |
5033 | |
5034 | A: For reasons outlined above, you should treat that pointer as | |
5035 | opaque and only access it via the getRemote() functions made | |
5036 | available and documented above. The DNSPacket class changes a lot | |
5037 | and this level of indirection allows for greater changes to be | |
5038 | made without changing the API to the backend coder. | |
33ccb468 | 5039 | |
5040 | Q: How is the PowerDNS Open Source Backend Development Kit licensed? | |
d16e0461 TP |
5041 | |
5042 | A: MIT X11, a very liberal license permitting basically | |
5043 | everything. | |
33ccb468 | 5044 | |
5045 | Q: Can I release the backend I wrote? | |
d16e0461 TP |
5046 | |
5047 | A: Please do! If you tell us about it we will list you on our | |
5048 | page. | |
33ccb468 | 5049 | |
5050 | Q: Can I sell backends I wrote? | |
d16e0461 TP |
5051 | |
5052 | A: You can. Again, if you tell us about them we will list your | |
5053 | backend on the site. You can keep the source of your backend | |
5054 | secret if you want, or you can share it with the world under any | |
5055 | license of your chosing. | |
33ccb468 | 5056 | |
5057 | Q: Will PowerDNS use my code in the PDNS distribution? | |
d16e0461 TP |
5058 | |
5059 | A: If your license permits it and we like your backend, we sure | |
5060 | will. If your license does not permit it but we like your backend | |
5061 | anyway we may contact you. | |
33ccb468 | 5062 | |
5063 | Q: My backend compiles but when I try to load it, it says 'undefined | |
d16e0461 TP |
5064 | symbol: _Z13BackendMakersv' |
5065 | ||
5066 | A: Your pdns_server binary is static and cannot load a backend | |
5067 | driver at runtime. Get a dynamic version of pdns, or complain to | |
5068 | pdns@powerdns.com if one isn't available. To check what kind of | |
5069 | binary you have, execute 'file $(which pdns_server)'. | |
33ccb468 | 5070 | |
5071 | Q: My backend compiles but when I try to load it, it says 'undefined | |
d16e0461 TP |
5072 | symbol: BackendMakers__Fv' |
5073 | ||
5074 | A: You compiled with the wrong GCC. Use GCC 3.x for Linux, 2.95.x | |
5075 | for FreeBSD. You may want to change g++ to g++-3.0 in the | |
5076 | Makefile, or change your path so that 3.x is used. | |
33ccb468 | 5077 | |
5078 | Q: I downloaded a dynamic copy of pdns_server but it doesn't run, even | |
d16e0461 TP |
5079 | without my backend |
5080 | ||
5081 | A: Run 'ldd' on the pdns_server binary and figure out what | |
5082 | libraries you are missing. Most likely you need to install gcc 3.0 | |
5083 | libraries, RedHat 7.1 and 7.2 have packages available, Debian | |
5084 | installs these by default if you use the 'unstable deb' of PDNS. | |
5085 | ||
5086 | Q: What I want can't be done from a backend - I need the whole PDNS source | |
5087 | ||
5088 | A: If you require the source, please contact us | |
5089 | (pdns@powerdns.com). All commercial licensees receive the source, | |
5090 | for others we may grant exceptions. | |
33ccb468 | 5091 | |
5092 | Q: What is this 'AhuException' I keep reading about? | |
d16e0461 TP |
5093 | |
5094 | A: This name has historical reasons and has no significance. | |
33ccb468 | 5095 | |
5096 | Q: I need a backend but I can't write it, can you help? | |
33ccb468 | 5097 | |
d16e0461 TP |
5098 | A: Yes, we also do custom development. Contact us at |
5099 | pdns@powerdns.com. | |
5100 | ||
5101 | ---------------------------------------------------------------------- | |
5102 | ||
5103 | 18.4. About PowerDNS.COM BV, 'the company' | |
33ccb468 | 5104 | |
d16e0461 TP |
5105 | As of 25 November 2002, the PowerDNS nameserver and its modules are open |
5106 | source. This has led to a lot of questions on the future of both PowerDNS, | |
5107 | the company and the products. This FAQ attempts to address these | |
5108 | questions. | |
33ccb468 | 5109 | |
5110 | Q: Is PowerDNS 2.9 really open source? What license? | |
d16e0461 TP |
5111 | |
5112 | A: PowerDNS 2.9 is licensed under the GNU General Public License | |
5113 | version two, the same license that covers the Linux kernel. | |
33ccb468 | 5114 | |
5115 | Q: Is the open source version crippled? | |
d16e0461 TP |
5116 | |
5117 | A: It is not. Not a single byte has been omitted. | |
33ccb468 | 5118 | |
5119 | Q: Is the nameserver abandoned? | |
d16e0461 TP |
5120 | |
5121 | A: Far from it. In fact, we expect development to speed up now | |
5122 | that we have joined the open source community. | |
33ccb468 | 5123 | |
5124 | Q: Why is the nameserver now open source? | |
d16e0461 TP |
5125 | |
5126 | A: In the current economic climate and also the way the Internet | |
5127 | is built up right now, selling software is very hard. Most | |
5128 | potential customers had never before bought a piece of software | |
5129 | for their UNIX internet setup. Even though we know (from the | |
5130 | recent survey) that nameserver operators love PowerDNS, their | |
5131 | suggested price for it is in the $100 range. | |
5132 | ||
5133 | For us, it makes far more sense to open source PowerDNS than to | |
5134 | ask $100 for it. It is expected that open sourcing PowerDNS will | |
5135 | lead to far higher adoption rates. We hope that PowerDNS will soon | |
5136 | be included in major Linux and UNIX distributions. | |
5137 | ||
5138 | Q: How does PowerDNS.COM BV expect to make money now that the nameserver | |
5139 | is free? | |
5140 | ||
5141 | A: In fact, we don't expect to in the near future. We also don't | |
5142 | have a lot of expenses, basically some hosting and a few domain | |
5143 | names. | |
5144 | ||
5145 | However, we are available for consulting work, for example to help | |
5146 | a large registrar or registry migrate to PowerDNS, or to help | |
5147 | integrate our software in existing provisioning systems. | |
5148 | ||
5149 | Furthermore, non-GPL licenses are available for those needing to | |
5150 | do closed source modifications, or for customers uncomfortable | |
5151 | with the GPL. This is much like what MySQL AB is doing now. | |
5152 | ||
5153 | In fact, their strategy is a lot like ours in general. | |
33ccb468 | 5154 | |
5155 | Q: Can I buy support contracts for PowerDNS? | |
d16e0461 TP |
5156 | |
5157 | Sure, to do so, please contact us at <sales@powerdns.com> | |
33ccb468 | 5158 | |
5159 | Q: Will you accept patches? We've added a feature | |
d16e0461 TP |
5160 | |
5161 | Probably - in general, it is best to discuss your intentions and | |
5162 | needs on the <pdns-dev@mailman.powerdns.com> (subscribe) | |
5163 | mailinglist before doing the work. We may have suggestions or | |
5164 | guidelines on how you should implement the feature. | |
5165 | ||
5166 | Q: PowerDNS doesn't work on my platform, will you port it?, Q: PowerDNS | |
5167 | doesn't have feature I need, will you add it? | |
5168 | ||
5169 | Be sure to ask on the <pdns-dev@mailman.powerdns.com> (subscribe) | |
5170 | mailinglist. You can even hire us to do work on PowerDNS if plain | |
5171 | asking is not persuasive enough. This might be the case if we | |
5172 | don't currently have time for your feature, but you need it | |
5173 | quickly anyhow, and are not in a position to submit a patch | |
5174 | implementing it. | |
5175 | ||
5176 | Q: Will PowerDNS Express be open sourced? | |
5177 | ||
5178 | Perhaps, we're not yet sure. | |
33ccb468 | 5179 | |
5180 | Q: We are a Linux/Unix vendor, can we include PowerDNS? | |
33ccb468 | 5181 | |
d16e0461 TP |
5182 | A: Please do. In fact, we'd be very happy to work with you to make |
5183 | this happen. Contact <ahu@ds9a.nl> if you have specific upstream | |
5184 | needs. | |
33ccb468 | 5185 | |
d16e0461 | 5186 | ---------------------------------------------------------------------- |
33ccb468 | 5187 | |
d16e0461 | 5188 | Appendix A. Backends in detail |
33ccb468 | 5189 | |
d16e0461 | 5190 | This appendix lists several of the available backends in more detail |
33ccb468 | 5191 | |
d16e0461 | 5192 | ---------------------------------------------------------------------- |
33ccb468 | 5193 | |
d16e0461 | 5194 | A.1. PipeBackend |
33ccb468 | 5195 | |
d16e0461 | 5196 | Table A-1. PipeBackend capabilities |
33ccb468 | 5197 | |
d16e0461 TP |
5198 | +-----------------------+ |
5199 | | Native | Yes | | |
5200 | |-------------+---------| | |
5201 | | Master | No | | |
5202 | |-------------+---------| | |
5203 | | Slave | No | | |
5204 | |-------------+---------| | |
5205 | | Superslave | No | | |
5206 | |-------------+---------| | |
5207 | | Autoserial | No | | |
5208 | |-------------+---------| | |
5209 | | Case | Depends | | |
5210 | |-------------+---------| | |
5211 | | Module name | pipe | | |
5212 | |-------------+---------| | |
5213 | | Launch name | pipe | | |
5214 | +-----------------------+ | |
5215 | ||
5216 | The PipeBackend allows for easy dynamic resolution based on a 'Coprocess' | |
5217 | which can be written in any programming language that can read a question | |
5218 | on standard input and answer on standard output. | |
5219 | ||
5220 | Note The Pipe Backend currently does not function under FreeBSD 4.x and | |
5221 | 5.x, probably due to unfavorable interactions between its threading | |
5222 | implementation and the fork system call. | |
5223 | ||
5224 | Interestingly, the Linux PowerDNS binary running under the | |
5225 | Linuxulator on FreeBSD does work. | |
33ccb468 | 5226 | |
5227 | To configure, the following settings are available: | |
5228 | ||
5229 | pipe-command | |
d16e0461 TP |
5230 | |
5231 | Command to launch as backend. Mandatory. | |
33ccb468 | 5232 | |
5233 | pipe-timeout | |
d16e0461 TP |
5234 | |
5235 | Number of milliseconds to wait for an answer from the backend. If | |
5236 | this time is ever exceeded, the backend is declared dead and a new | |
5237 | process is spawned. Available since 2.7. | |
33ccb468 | 5238 | |
5239 | pipe-regex | |
33ccb468 | 5240 | |
d16e0461 TP |
5241 | If set, only questions matching this regular expression are even |
5242 | sent to the backend. This makes sure that most of PowerDNS does | |
5243 | not slow down if you you reploy a slow backend. A query for the A | |
5244 | record of 'www.powerdns.com' would be presented to the regex as | |
5245 | 'www.powerdns.com;A'. A matching regex would be | |
5246 | '^www.powerdns.com;.*$'. | |
5247 | ||
5248 | To match only ANY and A queries for www.powerdns.com, use | |
5249 | '^www.powerdns.com;(A|ANY)$'. Available since 2.8. | |
5250 | ||
5251 | ---------------------------------------------------------------------- | |
33ccb468 | 5252 | |
d16e0461 | 5253 | A.1.1. PipeBackend protocol |
33ccb468 | 5254 | |
d16e0461 TP |
5255 | Questions come in over a file descriptor, by default standard input. |
5256 | Answers are sent out over another file descriptor, standard output by | |
5257 | default. | |
33ccb468 | 5258 | |
d16e0461 | 5259 | ---------------------------------------------------------------------- |
33ccb468 | 5260 | |
d16e0461 | 5261 | A.1.1.1. Handshake |
33ccb468 | 5262 | |
d16e0461 TP |
5263 | PowerDNS sends out 'HELO\t1', indicating that it wants to speak the |
5264 | protocol as defined in this document, version 1. A PowerDNS CoProcess must | |
5265 | then send out a banner, prefixed by 'OK\t', indicating it launched | |
5266 | successfully. If it does not support the indicated version, it should | |
5267 | respond with FAIL, but not exit. Suggested behaviour is to try and read a | |
5268 | further line, and wait to be terminated. | |
33ccb468 | 5269 | |
d16e0461 TP |
5270 | ---------------------------------------------------------------------- |
5271 | ||
5272 | A.1.1.2. Questions | |
5273 | ||
5274 | Questions come in three forms and are prefixed by a tag indicating the | |
5275 | kind: | |
33ccb468 | 5276 | |
5277 | Q | |
d16e0461 TP |
5278 | |
5279 | Regular queries | |
33ccb468 | 5280 | |
5281 | AXFR | |
d16e0461 TP |
5282 | |
5283 | List requests, which mean that an entire zone should be listed | |
33ccb468 | 5284 | |
5285 | PING | |
33ccb468 | 5286 | |
d16e0461 | 5287 | Check if the coprocess is functioning |
33ccb468 | 5288 | |
d16e0461 | 5289 | The question format: |
33ccb468 | 5290 | |
d16e0461 | 5291 | type qname qclass qtype id ip-address |
33ccb468 | 5292 | |
d16e0461 TP |
5293 | Fields are tab separated, and terminated with a single \n. Type is the tag |
5294 | above, qname is the domain the question is about. qclass is always 'IN' | |
5295 | currently, denoting an INternet question. qtype is the kind of information | |
5296 | desired, the record type, like A, CNAME or AAAA. id can be specified to | |
5297 | help your backend find an answer if the id is already known from an | |
5298 | earlier query. You can ignore it. ip-address is the ip-address of the | |
5299 | nameserver asking the question. | |
33ccb468 | 5300 | |
d16e0461 TP |
5301 | ---------------------------------------------------------------------- |
5302 | ||
5303 | A.1.1.3. Answers | |
5304 | ||
5305 | \r Each answer starts with a tag, possibly followed by a TAB and more data. | |
33ccb468 | 5306 | |
5307 | DATA | |
d16e0461 TP |
5308 | |
5309 | Indicating a successful line of DATA | |
33ccb468 | 5310 | |
5311 | END | |
d16e0461 TP |
5312 | |
5313 | Indicating the end of an answer - no further data | |
33ccb468 | 5314 | |
5315 | FAIL | |
d16e0461 TP |
5316 | |
5317 | Indicating a lookup failure. Also serves as 'END'. No further | |
5318 | data. | |
33ccb468 | 5319 | |
5320 | LOG | |
d16e0461 TP |
5321 | |
5322 | For specifying things that should be logged. Can only be sent | |
5323 | after a query and before an END line. After the tab, the message | |
5324 | to be logged | |
5325 | ||
5326 | So letting it be known that there is no data consists if sending 'END' | |
5327 | without anything else. The answer format: | |
5328 | ||
5329 | DATA qname qclass qtype ttl id content | |
5330 | ||
5331 | 'content' is as specified in Chapter 17. A sample dialogue may look like | |
5332 | this: | |
5333 | ||
5334 | Q www.ds9a.nl IN CNAME -1 213.244.168.210 | |
5335 | DATA www.ds9a.nl IN CNAME 3600 1 ws1.ds9a.nl | |
5336 | Q ws1.ds9a.nl IN CNAME -1 213.244.168.210 | |
5337 | END | |
5338 | Q wd1.ds9a.nl IN A -1 213.244.168.210 | |
5339 | DATA ws1.ds9a.nl IN A 3600 1 1.2.3.4 | |
5340 | DATA ws1.ds9a.nl IN A 3600 1 1.2.3.5 | |
5341 | DATA ws1.ds9a.nl IN A 3600 1 1.2.3.6 | |
5342 | END | |
33ccb468 | 5343 | |
5344 | This would correspond to a remote webserver 213.244.168.210 wanting to | |
d16e0461 TP |
5345 | resolve the IP address of www.ds9a.nl, and PowerDNS traversing the CNAMEs |
5346 | to find the IP addresses of ws1.ds9a.nl Another dialogue might be: | |
5347 | ||
5348 | Q ds9a.nl IN SOA -1 213.244.168.210 | |
5349 | DATA ds9a.nl IN SOA 86400 1 ahu.ds9a.nl ... | |
5350 | END | |
5351 | AXFR 1 | |
5352 | DATA ds9a.nl IN SOA 86400 1 ahu.ds9a.nl ... | |
5353 | DATA ds9a.nl IN NS 86400 1 ns1.ds9a.nl | |
5354 | DATA ds9a.nl IN NS 86400 1 ns2.ds9a.nl | |
5355 | DATA ns1.ds9a.nl IN A 86400 1 213.244.168.210 | |
5356 | DATA ns2.ds9a.nl IN A 86400 1 63.123.33.135 | |
5357 | . | |
5358 | . | |
5359 | END | |
33ccb468 | 5360 | |
5361 | This is a typical zone transfer. | |
33ccb468 | 5362 | |
d16e0461 | 5363 | ---------------------------------------------------------------------- |
33ccb468 | 5364 | |
d16e0461 | 5365 | A.1.1.4. Sample perl backend |
33ccb468 | 5366 | |
d16e0461 TP |
5367 | #!/usr/bin/perl -w |
5368 | # sample PowerDNS Coprocess backend | |
5369 | # | |
33ccb468 | 5370 | |
d16e0461 TP |
5371 | use strict; |
5372 | ||
5373 | ||
5374 | $|=1; # no buffering | |
5375 | ||
5376 | my $line=<>; | |
5377 | chomp($line); | |
5378 | ||
5379 | unless($line eq "HELO\t1") { | |
5380 | print "FAIL\n"; | |
5381 | print STDERR "Recevied '$line'\n"; | |
5382 | <>; | |
5383 | exit; | |
5384 | } | |
5385 | print "OK Sample backend firing up\n"; # print our banner | |
5386 | ||
5387 | while(<>) | |
5388 | { | |
5389 | print STDERR "$$ Received: $_"; | |
5390 | chomp(); | |
5391 | my @arr=split(/\t/); | |
5392 | if(@arr<6) { | |
5393 | print "LOG PowerDNS sent unparseable line\n"; | |
5394 | print "FAIL\n"; | |
5395 | next; | |
5396 | } | |
5397 | ||
5398 | my ($type,$qname,$qclass,$qtype,$id,$ip)=split(/\t/); | |
5399 | ||
5400 | if(($qtype eq "A" || $qtype eq "ANY") && $qname eq "webserver.example.com") { | |
5401 | print STDERR "$$ Sent A records\n"; | |
5402 | print "DATA $qname $qclass A 3600 -1 1.2.3.4\n"; | |
5403 | print "DATA $qname $qclass A 3600 -1 1.2.3.5\n"; | |
5404 | print "DATA $qname $qclass A 3600 -1 1.2.3.6\n"; | |
5405 | } | |
5406 | elsif(($qtype eq "CNAME" || $qtype eq "ANY") && $qname eq "www.example.com") { | |
5407 | print STDERR "$$ Sent CNAME records\n"; | |
5408 | print "DATA $qname $qclass CNAME 3600 -1 webserver.example.com\n"; | |
5409 | } | |
5410 | elsif($qtype eq "MBOXFW") { | |
5411 | print STDERR "$$ Sent MBOXFW records\n"; | |
5412 | print "DATA $qname $qclass MBOXFW 3600 -1 powerdns\@example.com\n"; | |
5413 | } | |
5414 | ||
5415 | ||
5416 | print STDERR "$$ End of data\n"; | |
5417 | print "END\n"; | |
5418 | } | |
5419 | ||
5420 | ||
5421 | ---------------------------------------------------------------------- | |
5422 | ||
5423 | A.2. MySQL backend | |
5424 | ||
5425 | Warning This backend is deprecated! Use the Generic MySQL backend which is | |
5426 | better in all respects. It does support master/slave operation, | |
5427 | this backend does not. See Section A.5. | |
5428 | ||
5429 | So stop reading here unless you already have a database filled | |
5430 | with 'mysql' records. | |
33ccb468 | 5431 | |
5432 | Table A-2. MySQL backend capabilities | |
d16e0461 TP |
5433 | |
5434 | +---------------------------+ | |
5435 | | Native | Yes | | |
5436 | |-------------+-------------| | |
5437 | | Master | No | | |
5438 | |-------------+-------------| | |
5439 | | Slave | No | | |
5440 | |-------------+-------------| | |
5441 | | Superslave | No | | |
5442 | |-------------+-------------| | |
5443 | | Autoserial | Yes | | |
5444 | |-------------+-------------| | |
5445 | | Case | Insensitive | | |
5446 | |-------------+-------------| | |
5447 | | Module name | mysql | | |
5448 | |-------------+-------------| | |
5449 | | Launch name | mysql | | |
5450 | +---------------------------+ | |
33ccb468 | 5451 | |
5452 | The MySQL Backend as present in PDNS is fixed - it requires a certain | |
5453 | database schema to function. This schema corresponds to this create | |
5454 | statement: | |
d16e0461 TP |
5455 | |
5456 | CREATE TABLE records ( | |
5457 | id int(11) NOT NULL auto_increment, | |
5458 | domain_id int(11) NOT NULL, | |
5459 | name varchar(255) NOT NULL, | |
5460 | type varchar(6) NOT NULL, | |
5461 | content varchar(255) NOT NULL, | |
5462 | ttl int(11) NOT NULL, | |
5463 | prio int(11) default NULL, | |
5464 | change_date int(11) default NULL, | |
5465 | PRIMARY KEY (id), | |
5466 | KEY name_index(name), | |
5467 | KEY nametype_index(name,type), | |
5468 | KEY domainid_index(domain_id) | |
5469 | ); | |
5470 | ||
5471 | ||
5472 | Every domain should have a unique domain_id, which should remain identical | |
5473 | for all records in a domain. Records with a domain_id that differs from | |
5474 | that in the domain SOA record will not appear in a zone transfer. | |
33ccb468 | 5475 | |
5476 | The change_date may optionally be updated to the time_t (the number of | |
d16e0461 TP |
5477 | seconds since midnight UTC at the start of 1970), and is in that case used |
5478 | to auto calculate the SOA serial number in case that is unspecified. | |
5479 | ||
5480 | ---------------------------------------------------------------------- | |
33ccb468 | 5481 | |
d16e0461 | 5482 | A.2.1. Configuration settings |
33ccb468 | 5483 | |
d16e0461 TP |
5484 | WARNING! Make sure that you can actually resolve the hostname of your |
5485 | database without accessing the database! It is advised to supply an IP | |
5486 | address here to prevent chicken/egg problems! | |
33ccb468 | 5487 | |
5488 | mysql-dbname | |
d16e0461 TP |
5489 | |
5490 | Database name to connect to | |
33ccb468 | 5491 | |
5492 | mysql-host | |
d16e0461 TP |
5493 | |
5494 | Database host to connect to | |
33ccb468 | 5495 | |
5496 | mysql-password | |
d16e0461 TP |
5497 | |
5498 | Password to connect with | |
33ccb468 | 5499 | |
5500 | mysql-socket | |
d16e0461 TP |
5501 | |
5502 | MySQL socket to use for connecting | |
33ccb468 | 5503 | |
5504 | mysql-table | |
d16e0461 TP |
5505 | |
5506 | MySQL table name. Defaults to 'records'. | |
33ccb468 | 5507 | |
5508 | mysql-user | |
33ccb468 | 5509 | |
d16e0461 TP |
5510 | MySQL user to connect as |
5511 | ||
5512 | ---------------------------------------------------------------------- | |
5513 | ||
5514 | A.2.2. Notes | |
5515 | ||
5516 | It has been observed that InnoDB tables outperform the default MyISAM | |
5517 | tables by a large margin. Furthermore, the default number of backends (3) | |
5518 | should be raised to 10 or 15 for busy servers. | |
33ccb468 | 5519 | |
d16e0461 | 5520 | ---------------------------------------------------------------------- |
33ccb468 | 5521 | |
5522 | A.3. Random Backend | |
5523 | ||
5524 | Table A-3. Random Backend capabilities | |
d16e0461 TP |
5525 | |
5526 | +------------------------+ | |
5527 | | Native | Yes | | |
5528 | |-------------+----------| | |
5529 | | Master | No | | |
5530 | |-------------+----------| | |
5531 | | Slave | No | | |
5532 | |-------------+----------| | |
5533 | | Superslave | No | | |
5534 | |-------------+----------| | |
5535 | | Autoserial | No | | |
5536 | |-------------+----------| | |
5537 | | Case | Depends | | |
5538 | |-------------+----------| | |
5539 | | Module name | built in | | |
5540 | |-------------+----------| | |
5541 | | Lauch name | random | | |
5542 | +------------------------+ | |
5543 | ||
5544 | This is a very silly backend which is discussed in Section C.1 as a | |
5545 | demonstration on how to write a PowerDNS backend. | |
5546 | ||
5547 | This backend knows about only one hostname, and only about its IP address | |
5548 | at that. With every query, a new random IP address is generated. | |
33ccb468 | 5549 | |
5550 | It only makes sense to load the random backend in combination with a | |
5551 | regular backend. This can be done by prepending it to the launch= | |
5552 | instruction, such as launch=random,gmysql. | |
5553 | ||
5554 | Variables: | |
5555 | ||
5556 | random-hostname | |
d16e0461 TP |
5557 | |
5558 | Hostname for which to supply a random IP address. | |
5559 | ||
5560 | ---------------------------------------------------------------------- | |
33ccb468 | 5561 | |
5562 | A.4. MySQL PDNS backend | |
5563 | ||
5564 | Table A-4. MySQL backend capabilities | |
d16e0461 TP |
5565 | |
5566 | +---------------------------+ | |
5567 | | Native | Yes | | |
5568 | |-------------+-------------| | |
5569 | | Master | No | | |
5570 | |-------------+-------------| | |
5571 | | Slave | No | | |
5572 | |-------------+-------------| | |
5573 | | Superslave | No | | |
5574 | |-------------+-------------| | |
5575 | | Autoserial | Yes | | |
5576 | |-------------+-------------| | |
5577 | | Case | Insensitive | | |
5578 | |-------------+-------------| | |
5579 | | Module name | pdns | | |
5580 | |-------------+-------------| | |
5581 | | Lauch name | pdns | | |
5582 | +---------------------------+ | |
5583 | ||
5584 | This is the driver that corresponds to the set of XML-RPC tools available | |
5585 | from PowerDNS. | |
5586 | ||
5587 | The schema: | |
5588 | ||
5589 | CREATE TABLE MailForwards ( | |
5590 | Id int(10) unsigned NOT NULL auto_increment, | |
5591 | ZoneId int(10) unsigned NOT NULL default '0', | |
5592 | Name varchar(255) NOT NULL default '', | |
5593 | Destination varchar(255) NOT NULL default '', | |
5594 | Flags int(11) NOT NULL default '0', | |
5595 | ChangeDate timestamp(14) NOT NULL, | |
5596 | CreateDate timestamp(14) NOT NULL, | |
5597 | Active tinyint(4) NOT NULL default '0', | |
5598 | PRIMARY KEY (Id), | |
5599 | KEY NameIndex (Name), | |
5600 | KEY ZoneIdIndex (ZoneId) | |
5601 | ); | |
5602 | ||
5603 | -- | |
5604 | -- Table structure for table 'Mailboxes' | |
5605 | -- | |
5606 | ||
5607 | CREATE TABLE Mailboxes ( | |
5608 | Id int(10) unsigned NOT NULL auto_increment, | |
5609 | ZoneId int(10) unsigned NOT NULL default '0', | |
5610 | Name varchar(255) NOT NULL default '', | |
5611 | Password varchar(255) NOT NULL default '', | |
5612 | Quota int(10) unsigned NOT NULL default '0', | |
5613 | Flags int(11) NOT NULL default '0', | |
5614 | ChangeDate timestamp(14) NOT NULL, | |
5615 | CreateDate timestamp(14) NOT NULL, | |
5616 | Active tinyint(4) NOT NULL default '0', | |
5617 | PRIMARY KEY (Id), | |
5618 | UNIQUE KEY Name (Name), | |
5619 | KEY ZoneIdIndex (ZoneId), | |
5620 | KEY NameIndex (Name) | |
5621 | ); | |
5622 | ||
5623 | -- | |
5624 | -- Table structure for table 'Records' | |
5625 | -- | |
5626 | ||
5627 | CREATE TABLE Records ( | |
5628 | Id int(10) unsigned NOT NULL auto_increment, | |
5629 | ZoneId int(10) unsigned NOT NULL default '0', | |
5630 | Name varchar(255) NOT NULL default '', | |
5631 | Type varchar(8) NOT NULL default '', | |
5632 | Content varchar(255) NOT NULL default '', | |
5633 | TimeToLive int(11) NOT NULL default '60', | |
5634 | Priority int(11) NOT NULL default '0', | |
5635 | Flags int(11) NOT NULL default '0', | |
5636 | ChangeDate timestamp(14) NOT NULL, | |
5637 | CreateDate timestamp(14) NOT NULL, | |
5638 | Active tinyint(4) NOT NULL default '0', | |
5639 | PRIMARY KEY (Id), | |
5640 | KEY NameIndex (Name) | |
5641 | ); | |
5642 | ||
5643 | -- | |
5644 | -- Table structure for table 'WebForwards' | |
5645 | -- | |
5646 | ||
5647 | CREATE TABLE WebForwards ( | |
5648 | Id int(10) unsigned NOT NULL auto_increment, | |
5649 | ZoneId int(10) unsigned NOT NULL default '0', | |
5650 | Name varchar(255) NOT NULL default '', | |
5651 | Destination varchar(255) NOT NULL default '', | |
5652 | Type varchar(7) NOT NULL default 'NORMAL', | |
5653 | Title varchar(255) NOT NULL default '', | |
5654 | Description varchar(255) NOT NULL default '', | |
5655 | Keywords varchar(255) NOT NULL default '', | |
5656 | FavIcon varchar(255) NOT NULL default '', | |
5657 | Flags int(11) NOT NULL default '0', | |
5658 | ChangeDate timestamp(14) NOT NULL, | |
5659 | CreateDate timestamp(14) NOT NULL, | |
5660 | Active tinyint(4) NOT NULL default '0', | |
5661 | PRIMARY KEY (Id), | |
5662 | KEY NameIndex (Name), | |
5663 | KEY ZoneIdIndex (ZoneId) | |
5664 | ); | |
5665 | ||
5666 | -- | |
5667 | -- Table structure for table 'Zones' | |
5668 | -- | |
5669 | ||
5670 | CREATE TABLE Zones ( | |
5671 | Id int(10) unsigned NOT NULL auto_increment, | |
5672 | Name varchar(255) NOT NULL default '', | |
5673 | Hostmaster varchar(255) NOT NULL default '', | |
5674 | Serial int(10) unsigned NOT NULL default '0', | |
5675 | AutoSerial tinyint(4) NOT NULL default '0', | |
5676 | Flags int(11) NOT NULL default '0', | |
5677 | ChangeDate timestamp(14) NOT NULL, | |
5678 | CreateDate timestamp(14) NOT NULL, | |
5679 | Active tinyint(4) NOT NULL default '0', | |
5680 | TimeToLive int(11) NOT NULL default '0', | |
5681 | OwnerId varchar(255) NOT NULL default '', | |
5682 | PRIMARY KEY (Id), | |
5683 | UNIQUE KEY Name (Name), | |
5684 | KEY NameIndex (Name) | |
5685 | ); | |
5686 | ||
5687 | ||
33ccb468 | 5688 | |
5689 | It takes a number of parameters: | |
5690 | ||
5691 | pdns-dbname | |
d16e0461 TP |
5692 | |
5693 | Database name to connect to | |
33ccb468 | 5694 | |
5695 | pdns-host | |
d16e0461 TP |
5696 | |
5697 | Database host to connect to | |
33ccb468 | 5698 | |
5699 | pdns-password | |
d16e0461 TP |
5700 | |
5701 | Password to connect with | |
33ccb468 | 5702 | |
5703 | pdns-socket | |
d16e0461 TP |
5704 | |
5705 | MySQL socket to use for connecting | |
33ccb468 | 5706 | |
5707 | pdns-user | |
33ccb468 | 5708 | |
d16e0461 | 5709 | MySQL user to connect as |
33ccb468 | 5710 | |
d16e0461 TP |
5711 | ---------------------------------------------------------------------- |
5712 | ||
5713 | A.4.1. Notes | |
5714 | ||
5715 | It has been observed that InnoDB tables outperform the default MyISAM | |
5716 | tables by a large margin. Furthermore, the default number of backends (3) | |
5717 | should be raised to 10 or 15 for busy servers. | |
5718 | ||
5719 | ---------------------------------------------------------------------- | |
33ccb468 | 5720 | |
5721 | A.5. Generic MySQL and PgSQL backends | |
5722 | ||
5723 | Table A-5. Generic PgSQL and MySQL backend capabilities | |
d16e0461 TP |
5724 | |
5725 | +---------------------------------------------------------------+ | |
5726 | | Native | Yes - but PostgreSQL does not replicate | | |
5727 | |---------------------+-----------------------------------------| | |
5728 | | Master | Yes | | |
5729 | |---------------------+-----------------------------------------| | |
5730 | | Slave | Yes | | |
5731 | |---------------------+-----------------------------------------| | |
5732 | | Superslave | Yes | | |
5733 | |---------------------+-----------------------------------------| | |
5734 | | Autoserial | NO | | |
5735 | |---------------------+-----------------------------------------| | |
5736 | | Case | All lower | | |
5737 | |---------------------+-----------------------------------------| | |
5738 | | Module name < 2.9.3 | pgmysql | | |
5739 | |---------------------+-----------------------------------------| | |
5740 | | Module name > 2.9.2 | gmysql and gpgsql | | |
5741 | |---------------------+-----------------------------------------| | |
5742 | | Lauch name | gmysql and gpgsql2 and gpgsql | | |
5743 | +---------------------------------------------------------------+ | |
33ccb468 | 5744 | |
5745 | PostgreSQL and MySQL backend with easily configurable SQL statements, | |
5746 | allowing you to graft PDNS on any PostgreSQL or MySQL database of your | |
5747 | choosing. Because all database schemas will be different, a generic | |
5748 | backend is needed to cover all needs. | |
5749 | ||
d16e0461 TP |
5750 | The template queries are expanded using the C function 'snprintf' which |
5751 | implies that substitutions are performed on the basis of %-place holders. | |
5752 | To place a a % in a query which will not be substituted, use %%. Make sure | |
5753 | to fill out the search key, often called 'name' in lower case! | |
33ccb468 | 5754 | |
d16e0461 TP |
5755 | There are in fact two backends, one for PostgreSQL and one for MySQL but |
5756 | they accept the same settings and use almost exactly the same database | |
5757 | schema. | |
33ccb468 | 5758 | |
d16e0461 | 5759 | ---------------------------------------------------------------------- |
33ccb468 | 5760 | |
d16e0461 | 5761 | A.5.1. MySQL specifics |
33ccb468 | 5762 | |
d16e0461 TP |
5763 | Warning If using MySQL with 'slave' support enabled in PowerDNS you must |
5764 | run MySQL with a table engine that supports transactions. | |
33ccb468 | 5765 | |
d16e0461 TP |
5766 | In practice, great results are achieved with the 'InnoDB' tables. PowerDNS |
5767 | will silently function with non-transaction aware MySQLs but at one point | |
5768 | this is going to harm your database, for example when an incoming zone | |
5769 | transfer fails. | |
33ccb468 | 5770 | |
5771 | The default setup conforms to the following schema: | |
d16e0461 TP |
5772 | |
5773 | create table domains ( | |
33ccb468 | 5774 | id INT auto_increment, |
d16e0461 TP |
5775 | name VARCHAR(255) NOT NULL, |
5776 | master VARCHAR(20) DEFAULT NULL, | |
5777 | last_check INT DEFAULT NULL, | |
5778 | type VARCHAR(6) NOT NULL, | |
5779 | notified_serial INT DEFAULT NULL, | |
5780 | account VARCHAR(40) DEFAULT NULL, | |
5781 | primary key (id) | |
5782 | )type=InnoDB; | |
5783 | ||
5784 | CREATE UNIQUE INDEX name_index ON domains(name); | |
5785 | ||
5786 | CREATE TABLE records ( | |
5787 | id INT auto_increment, | |
5788 | domain_id INT DEFAULT NULL, | |
5789 | name VARCHAR(255) DEFAULT NULL, | |
5790 | type VARCHAR(6) DEFAULT NULL, | |
5791 | content VARCHAR(255) DEFAULT NULL, | |
5792 | ttl INT DEFAULT NULL, | |
5793 | prio INT DEFAULT NULL, | |
5794 | change_date INT DEFAULT NULL, | |
5795 | primary key(id) | |
5796 | )type=InnoDB; | |
5797 | ||
5798 | CREATE INDEX rec_name_index ON records(name); | |
5799 | CREATE INDEX nametype_index ON records(name,type); | |
5800 | CREATE INDEX domain_id ON records(domain_id); | |
5801 | ||
5802 | create table supermasters ( | |
5803 | ip VARCHAR(25) NOT NULL, | |
5804 | nameserver VARCHAR(255) NOT NULL, | |
5805 | account VARCHAR(40) DEFAULT NULL | |
5806 | ); | |
5807 | ||
5808 | GRANT SELECT ON supermasters TO pdns; | |
5809 | GRANT ALL ON domains TO pdns; | |
5810 | GRANT ALL ON records TO pdns; | |
5811 | ||
5812 | ||
5813 | This schema contains all elements needed for master, slave and superslave | |
5814 | operation. Depending on which features will be used, the 'GRANT' | |
5815 | statements can be trimmed to make sure PDNS cannot subvert the contents of | |
5816 | your database. | |
33ccb468 | 5817 | |
5818 | Zone2sql with the --gmysql flag also assumes this layout is in place. | |
d16e0461 TP |
5819 | |
5820 | ---------------------------------------------------------------------- | |
5821 | ||
5822 | A.5.2. PostgresSQL specifics | |
5823 | ||
5824 | The default setup conforms to the following schema, which you should add | |
5825 | to a PostgreSQL database. | |
5826 | ||
5827 | create table domains ( | |
5828 | id SERIAL PRIMARY KEY, | |
5829 | name VARCHAR(255) NOT NULL, | |
5830 | master VARCHAR(20) DEFAULT NULL, | |
5831 | last_check INT DEFAULT NULL, | |
5832 | type VARCHAR(6) NOT NULL, | |
5833 | notified_serial INT DEFAULT NULL, | |
5834 | account VARCHAR(40) DEFAULT NULL | |
5835 | ); | |
5836 | CREATE UNIQUE INDEX name_index ON domains(name); | |
5837 | ||
5838 | CREATE TABLE records ( | |
5839 | id SERIAL PRIMARY KEY, | |
5840 | domain_id INT DEFAULT NULL, | |
5841 | name VARCHAR(255) DEFAULT NULL, | |
5842 | type VARCHAR(6) DEFAULT NULL, | |
5843 | content VARCHAR(255) DEFAULT NULL, | |
5844 | ttl INT DEFAULT NULL, | |
5845 | prio INT DEFAULT NULL, | |
5846 | change_date INT DEFAULT NULL, | |
5847 | CONSTRAINT domain_exists | |
5848 | FOREIGN KEY(domain_id) REFERENCES domains(id) | |
5849 | ON DELETE CASCADE | |
5850 | ); | |
5851 | ||
5852 | CREATE INDEX rec_name_index ON records(name); | |
5853 | CREATE INDEX nametype_index ON records(name,type); | |
5854 | CREATE INDEX domain_id ON records(domain_id); | |
5855 | ||
5856 | create table supermasters ( | |
5857 | ip VARCHAR(25) NOT NULL, | |
5858 | nameserver VARCHAR(255) NOT NULL, | |
5859 | account VARCHAR(40) DEFAULT NULL | |
5860 | ); | |
5861 | ||
5862 | GRANT SELECT ON supermasters TO pdns; | |
5863 | GRANT ALL ON domains TO pdns; | |
5864 | GRANT ALL ON domains_id_seq TO pdns; | |
5865 | GRANT ALL ON records TO pdns; | |
5866 | GRANT ALL ON records_id_seq TO pdns; | |
5867 | ||
5868 | ||
5869 | This schema contains all elements needed for master, slave and superslave | |
5870 | operation. Depending on which features will be used, the 'GRANT' | |
5871 | statements can be trimmed to make sure PDNS cannot subvert the contents of | |
5872 | your database. | |
33ccb468 | 5873 | |
5874 | Zone2sql with the --gpgsql flag also assumes this layout is in place. | |
33ccb468 | 5875 | |
d16e0461 TP |
5876 | With PostgreSQL, you may have to run 'createdb powerdns' first and then |
5877 | connect to that database with 'psql powerdns', and feed it the schema | |
5878 | above. | |
5879 | ||
5880 | ---------------------------------------------------------------------- | |
5881 | ||
5882 | A.5.3. Basic functionality | |
33ccb468 | 5883 | |
d16e0461 TP |
5884 | 4 queries are needed for regular lookups, 4 for 'fancy records' which are |
5885 | disabled by default and 1 is needed for zone transfers. | |
33ccb468 | 5886 | |
d16e0461 TP |
5887 | The 4+4 regular queries must return the following 6 fields, in this exact |
5888 | order: | |
33ccb468 | 5889 | |
5890 | content | |
d16e0461 TP |
5891 | |
5892 | This is the 'right hand side' of a DNS record. For an A record, | |
5893 | this is the IP address for example. | |
33ccb468 | 5894 | |
5895 | ttl | |
d16e0461 TP |
5896 | |
5897 | TTL of this record, in seconds. Must be a real value, no checking | |
5898 | is performed. | |
33ccb468 | 5899 | |
5900 | prio | |
d16e0461 TP |
5901 | |
5902 | For MX records, this should be the priority of the mail exchanger | |
5903 | specified. | |
33ccb468 | 5904 | |
5905 | qtype | |
d16e0461 TP |
5906 | |
5907 | The ASCII representation of the qtype of this record. Examples are | |
5908 | 'A', 'MX', 'SOA', 'AAAA'. Make sure that this field returns an | |
5909 | exact answer - PDNS won't recognise 'A ' as 'A'. This can be | |
5910 | achieved by using a VARCHAR instead of a CHAR. | |
33ccb468 | 5911 | |
5912 | domain_id | |
d16e0461 TP |
5913 | |
5914 | Each domain must have a unique domain_id. No two domains may share | |
5915 | a domain_id, all records in a domain should have the same. A | |
5916 | number. | |
33ccb468 | 5917 | |
5918 | name | |
33ccb468 | 5919 | |
d16e0461 TP |
5920 | Actual name of a record. Must not end in a '.' and be fully |
5921 | qualified - it is not relative to the name of the domain! | |
5922 | ||
5923 | Please note that the names of the fields are not relevant, but the order | |
5924 | is! | |
33ccb468 | 5925 | |
d16e0461 TP |
5926 | As said earlier, there are 8 SQL queries for regular lookups. To configure |
5927 | them, set 'gmysql-basic-query' or 'gpgsql-basic-query', depending on your | |
5928 | choice of backend. If so called 'MBOXFW' fancy records are not used, four | |
5929 | queries remain: | |
33ccb468 | 5930 | |
5931 | basic-query | |
d16e0461 TP |
5932 | |
5933 | Default: select content,ttl,prio,type,domain_id,name from records | |
5934 | where qtype='%s' and name='%s' This is the most used query, needed | |
5935 | for doing 1:1 lookups of qtype/name values. First %s is replaced | |
5936 | by the ASCII representation of the qtype of the question, the | |
5937 | second by the name. | |
33ccb468 | 5938 | |
5939 | id-query | |
d16e0461 TP |
5940 | |
5941 | Default: select content,ttl,prio,type,domain_id,name from records | |
5942 | where qtype='%s' and name='%s' and domain_id=%d Used for doing | |
5943 | lookups within a domain. First %s is replaced by the qtype, the %d | |
5944 | which should appear after the %s by the numeric domain_id. | |
33ccb468 | 5945 | |
5946 | any-query | |
d16e0461 TP |
5947 | |
5948 | For doing ANY queries. Also used internally. Default: select | |
5949 | content,ttl,prio,type,domain_id,name from records where name='%s' | |
5950 | The %s is replaced by the qname of the question. | |
33ccb468 | 5951 | |
5952 | any-id-query | |
d16e0461 TP |
5953 | |
5954 | For doing ANY queries within a domain. Also used internally. | |
5955 | Default: select content,ttl,prio,type,domain_id,name from records | |
5956 | where name='%s' and domain_id=%d The %s is replaced by the name of | |
5957 | the domain, the %d by the numerical domain id. | |
33ccb468 | 5958 | |
5959 | The last query is for listing the entire contents of a zone. This is | |
5960 | needed when performing a zone transfer, but sometimes also internally: | |
5961 | ||
5962 | list-query | |
33ccb468 | 5963 | |
d16e0461 TP |
5964 | To list an entire zone. Default: select |
5965 | content,ttl,prio,type,domain_id,name from records where | |
5966 | domain_id=%d | |
5967 | ||
5968 | ---------------------------------------------------------------------- | |
5969 | ||
5970 | A.5.4. Master/slave queries | |
33ccb468 | 5971 | |
d16e0461 TP |
5972 | Most installations will have zero need to change the following settings, |
5973 | but should the need arise, here they are: | |
33ccb468 | 5974 | |
5975 | master-zone-query | |
d16e0461 TP |
5976 | |
5977 | Called to determine the master of a zone. Default: select master | |
5978 | from domains where name='%s' and type='SLAVE' | |
33ccb468 | 5979 | |
5980 | info-zone-query | |
d16e0461 TP |
5981 | |
5982 | Called to retrieve (nearly) all information for a domain: Default: | |
5983 | select id,name,master,last_check,notified_serial,type from domains | |
5984 | where name='%s' | |
33ccb468 | 5985 | |
5986 | info-all-slaves-query | |
d16e0461 TP |
5987 | |
5988 | Called to retrieve all slave domains Default: select | |
5989 | id,name,master,last_check,type from domains where type='SLAVE' | |
33ccb468 | 5990 | |
5991 | supermaster-query | |
d16e0461 TP |
5992 | |
5993 | Called to determine if a certain host is a supermaster for a | |
5994 | certain domain name. Default: select account from supermasters | |
5995 | where ip='%s' and nameserver='%s'"); | |
33ccb468 | 5996 | |
5997 | insert-slave-query | |
d16e0461 TP |
5998 | |
5999 | Called to add a domain as slave after a supermaster notification. | |
6000 | Default: insert into domains (type,name,master,account) | |
6001 | values('SLAVE','%s','%s','%s') | |
33ccb468 | 6002 | |
6003 | insert-record-query | |
d16e0461 TP |
6004 | |
6005 | Called during incoming AXFR. Default: insert into records | |
6006 | (content,ttl,prio,type,domain_id,name) values | |
6007 | ('%s',%d,%d,'%s',%d,'%s') | |
33ccb468 | 6008 | |
6009 | update-serial-query | |
d16e0461 TP |
6010 | |
6011 | Called to update the last notified serial of a master domain. | |
6012 | Default: update domains set notified_serial=%d where id=%d | |
33ccb468 | 6013 | |
6014 | update-lastcheck-query | |
d16e0461 TP |
6015 | |
6016 | Called to update the last time a slave domain was checked for | |
6017 | freshness. Default: update domains set notified_serial=%d where | |
6018 | id=%d | |
33ccb468 | 6019 | |
6020 | info-all-master-query | |
d16e0461 TP |
6021 | |
6022 | Called to get data on all domains for which the server is master. | |
6023 | Default: select id,name,master,last_check,notified_serial,type | |
6024 | from domains where type='MASTER' | |
33ccb468 | 6025 | |
6026 | delete-zone-query | |
33ccb468 | 6027 | |
d16e0461 TP |
6028 | Called to delete all records of a zone. Used before an incoming |
6029 | AXFR. Default: delete from records where domain_id=%d | |
6030 | ||
6031 | ---------------------------------------------------------------------- | |
33ccb468 | 6032 | |
d16e0461 TP |
6033 | A.5.5. Fancy records |
6034 | ||
6035 | If PDNS is used with so called 'Fancy Records', the 'MBOXFW' record exists | |
6036 | which specifies an email address forwarding instruction, wildcard queries | |
6037 | are sometimes needed. This is not enabled by default. A wildcard query is | |
6038 | an internal concept - it has no relation to *.domain-type lookups. You can | |
6039 | safely leave these queries blank. | |
33ccb468 | 6040 | |
6041 | wildcard-query | |
d16e0461 TP |
6042 | |
6043 | Can be left blank. See above for an explanation. Default: select | |
6044 | content,ttl,prio,type,domain_id,name from records where qtype='%s' | |
6045 | and name like '%s' | |
33ccb468 | 6046 | |
6047 | wildcard-id-query | |
d16e0461 TP |
6048 | |
6049 | Can be left blank. See above for an explanation. Default: select | |
6050 | content,ttl,prio,type,domain_id,name from records where qtype='%s' | |
6051 | and name like '%s' and domain_id=%d Used for doing lookups within | |
6052 | a domain. | |
33ccb468 | 6053 | |
6054 | wildcard-any-query | |
d16e0461 TP |
6055 | |
6056 | For doing wildcard ANY queries. Default: select | |
6057 | content,ttl,prio,type,domain_id,name from records where name like | |
6058 | '%s' | |
33ccb468 | 6059 | |
6060 | wildcard-any-id-query | |
33ccb468 | 6061 | |
d16e0461 TP |
6062 | For doing wildcard ANY queries within a domain. Default: select |
6063 | content,ttl,prio,type,domain_id,name from records where name like | |
6064 | '%s' and domain_id=%d | |
6065 | ||
6066 | ---------------------------------------------------------------------- | |
6067 | ||
6068 | A.5.6. Settings and specifying queries | |
33ccb468 | 6069 | |
d16e0461 TP |
6070 | The queries above are specified in pdns.conf. For example, the basic-query |
6071 | would appear as: | |
33ccb468 | 6072 | |
d16e0461 TP |
6073 | gpgsql-basic-query=select content,ttl,prio,type,domain_id,name from records where qtype='%s' and name='%s' |
6074 | ||
33ccb468 | 6075 | |
d16e0461 TP |
6076 | When using the Generic PostgreSQL backend, they appear as above. When |
6077 | using the generic MySQL backend, change the "gpgsql-" prefix to "gmysql-". | |
33ccb468 | 6078 | |
6079 | Queries can span multiple lines, like this: | |
33ccb468 | 6080 | |
d16e0461 TP |
6081 | gpgsql-basic-query=select content,ttl,prio,type,domain_id,name from records \ |
6082 | where qtype='%s' and name='%s' | |
6083 | ||
33ccb468 | 6084 | |
d16e0461 TP |
6085 | Do not wrap statements in quotes as this will not work. Besides the query |
6086 | related settings, the following configuration options are available: | |
33ccb468 | 6087 | |
6088 | gpgsql-dbname | |
d16e0461 TP |
6089 | |
6090 | Database name to connect to | |
33ccb468 | 6091 | |
6092 | gpgsql-host | |
d16e0461 TP |
6093 | |
6094 | Database host to connect to. WARNING: When specified as a hostname | |
6095 | a chicken/egg situation might arise where the database is needed | |
6096 | to resolve the IP address of the database. It is best to supply an | |
6097 | IP address of the database here. | |
6098 | ||
6099 | gmysql-socket (only for MySQL!) | |
6100 | ||
6101 | Filename where the MySQL connection socket resides. Often | |
6102 | /tmp/mysql.sock or /var/run/mysqld/mysqld.sock. | |
33ccb468 | 6103 | |
6104 | gpgsql-password | |
d16e0461 TP |
6105 | |
6106 | Password to connect with | |
33ccb468 | 6107 | |
6108 | gpgsql-user | |
33ccb468 | 6109 | |
d16e0461 TP |
6110 | PgSQL user to connect as |
6111 | ||
6112 | ---------------------------------------------------------------------- | |
6113 | ||
6114 | A.5.7. Native operation | |
6115 | ||
6116 | For native operation, either drop the FOREIGN KEY on the domain_id field, | |
6117 | or (recommended), make sure the domains table is filled properly. To add a | |
6118 | domain, issue the following: | |
33ccb468 | 6119 | |
d16e0461 TP |
6120 | insert into domains (name,type) values ('powerdns.com','NATIVE'); |
6121 | ||
33ccb468 | 6122 | |
d16e0461 TP |
6123 | The records table can now be filled by with the domain_id set to the id of |
6124 | the domains table row just inserted. | |
33ccb468 | 6125 | |
d16e0461 | 6126 | ---------------------------------------------------------------------- |
33ccb468 | 6127 | |
d16e0461 | 6128 | A.5.8. Slave operation |
33ccb468 | 6129 | |
d16e0461 TP |
6130 | The PostgreSQL backend is fully slave capable. To become a slave of the |
6131 | 'powerdns.com' domain, execute this: | |
33ccb468 | 6132 | |
d16e0461 TP |
6133 | insert into domains (name,master,type) values ('powerdns.com','213.244.168.217','SLAVE'); |
6134 | ||
33ccb468 | 6135 | |
d16e0461 TP |
6136 | And wait a while for PDNS to pick up the addition - which happens within |
6137 | one minute. There is no need to inform PDNS that a new domain was added. | |
6138 | Typical output is: | |
33ccb468 | 6139 | |
d16e0461 TP |
6140 | Apr 09 13:34:29 All slave domains are fresh |
6141 | Apr 09 13:35:29 1 slave domain needs checking | |
6142 | Apr 09 13:35:29 Domain powerdns.com is stale, master serial 1, our serial 0 | |
6143 | Apr 09 13:35:30 [gPgSQLBackend] Connected to database | |
6144 | Apr 09 13:35:30 AXFR started for 'powerdns.com' | |
6145 | Apr 09 13:35:30 AXFR done for 'powerdns.com' | |
6146 | Apr 09 13:35:30 [gPgSQLBackend] Closing connection | |
6147 | ||
33ccb468 | 6148 | |
d16e0461 TP |
6149 | From now on, PDNS is authoritative for the 'powerdns.com' zone and will |
6150 | respond accordingly for queries within that zone. | |
33ccb468 | 6151 | |
d16e0461 TP |
6152 | Periodically, PDNS schedules checks to see if domains are still fresh. The |
6153 | default slave-cycle-interval is 60 seconds, large installations may need | |
6154 | to raise this value. Once a domain has been checked, it will not be | |
6155 | checked before its SOA refresh timer has expired. Domains whose status is | |
6156 | unknown get checked every 60 seconds by default. | |
33ccb468 | 6157 | |
d16e0461 | 6158 | ---------------------------------------------------------------------- |
33ccb468 | 6159 | |
d16e0461 | 6160 | A.5.9. Superslave operation |
33ccb468 | 6161 | |
d16e0461 TP |
6162 | To configure a supermaster with IP address 10.0.0.11 which lists this |
6163 | installation as 'autoslave.powerdns.com', issue the following: | |
33ccb468 | 6164 | |
d16e0461 TP |
6165 | insert into supermasters ('10.0.0.11','autoslave.powerdns.com','internal'); |
6166 | ||
33ccb468 | 6167 | |
d16e0461 TP |
6168 | From now on, valid notifies from 10.0.0.11 that list a NS record |
6169 | containing 'autoslave.powerdns.com' will lead to the provisioning of a | |
6170 | slave domain under the account 'internal'. See Section 13.2.1 for details. | |
33ccb468 | 6171 | |
d16e0461 | 6172 | ---------------------------------------------------------------------- |
33ccb468 | 6173 | |
d16e0461 | 6174 | A.5.10. Master operation |
33ccb468 | 6175 | |
d16e0461 TP |
6176 | The PostgreSQL backend is fully master capable with automatic discovery of |
6177 | serial changes. Raising the serial number of a domain suffices to trigger | |
6178 | PDNS to send out notifications. To configure a domain for master operation | |
6179 | instead of the default native replication, issue: | |
33ccb468 | 6180 | |
d16e0461 TP |
6181 | insert into domains (name,type) values ('powerdns.com','MASTER'); |
6182 | ||
6183 | ||
6184 | Make sure that the assigned id in the domains table matches the domain_id | |
6185 | field in the records table! | |
6186 | ||
6187 | ---------------------------------------------------------------------- | |
33ccb468 | 6188 | |
6189 | A.6. Generic Oracle backend | |
6190 | ||
6191 | Table A-6. Oracle backend capabilities | |
d16e0461 TP |
6192 | |
6193 | +----------------------+ | |
6194 | | Native | Yes | | |
6195 | |-------------+--------| | |
6196 | | Master | No | | |
6197 | |-------------+--------| | |
6198 | | Slave | No | | |
6199 | |-------------+--------| | |
6200 | | Superslave | No | | |
6201 | |-------------+--------| | |
6202 | | Autoserial | Yes | | |
6203 | |-------------+--------| | |
6204 | | Module name | oracle | | |
6205 | |-------------+--------| | |
6206 | | Launch name | oracle | | |
6207 | +----------------------+ | |
6208 | ||
6209 | Oracle backend with easily configurable SQL statements, allowing you to | |
6210 | graft PDNS on any Oracle database of your choosing. | |
6211 | ||
6212 | PowerDNS is currently ascertaining if this backend can be distributed in | |
6213 | binary form without violating Oracle licensing. In the meantime, the | |
6214 | source code to the Oracle backend is available in the pdns distribution. | |
33ccb468 | 6215 | |
6216 | The following configuration settings are available: | |
6217 | ||
6218 | oracle-debug-queries | |
d16e0461 TP |
6219 | |
6220 | Output all queries to disk for debugging purposes. | |
33ccb468 | 6221 | |
6222 | oracle-time-queries | |
d16e0461 TP |
6223 | |
6224 | Output all queries to disk for timing purposes. | |
33ccb468 | 6225 | |
6226 | oracle-uppercase-database | |
d16e0461 TP |
6227 | |
6228 | Change all domain names to uppercase before querying database. | |
33ccb468 | 6229 | |
6230 | oracle-database | |
d16e0461 TP |
6231 | |
6232 | Oracle database name to connect to. | |
33ccb468 | 6233 | |
6234 | oracle-home | |
d16e0461 TP |
6235 | |
6236 | PDNS can set the ORACLE_HOME environment variable from within the | |
6237 | executable, allowing execution of the daemon from init.d scripts | |
6238 | where ORACLE_HOME may not yet be set. | |
33ccb468 | 6239 | |
6240 | oracle-sid | |
d16e0461 TP |
6241 | |
6242 | PDNS can set the ORACLE_SID environment variable from within the | |
6243 | executable, allowing execution of the daemon from init.d scripts | |
6244 | where ORACLE_SID may not yet be set. | |
33ccb468 | 6245 | |
6246 | oracle-username | |
d16e0461 TP |
6247 | |
6248 | Oracle username to connect as. | |
33ccb468 | 6249 | |
6250 | oracle-password | |
d16e0461 TP |
6251 | |
6252 | Oracle password to connect with. | |
33ccb468 | 6253 | |
6254 | The generic Oracle backend can be configured to use user-specified | |
6255 | queries. The following are the default queries and their names: | |
6256 | ||
6257 | oracle-forward-query | |
d16e0461 TP |
6258 | |
6259 | select content, TimeToLive, Priority, type, ZoneId, | |
6260 | nvl(ChangeDate,0) from Records where name = :name and type = :type | |
33ccb468 | 6261 | |
6262 | oracle-forward-query-by-zone | |
d16e0461 TP |
6263 | |
6264 | select content, TimeToLive, Priority, type, ZoneId, | |
6265 | nvl(ChangeDate,0) from records where name = :name and type = :type | |
6266 | and ZoneId = :id | |
33ccb468 | 6267 | |
6268 | oracle-forward-any-query | |
d16e0461 TP |
6269 | |
6270 | select content, TimeToLive, Priority, type, ZoneId, | |
6271 | nvl(ChangeDate,0) from records where name = :name | |
33ccb468 | 6272 | |
6273 | oracle-list-query | |
33ccb468 | 6274 | |
d16e0461 TP |
6275 | select content, TimeToLive, Priority, type, ZoneId, |
6276 | nvl(ChangeDate, 0), name from records where ZoneId = :id | |
33ccb468 | 6277 | |
d16e0461 | 6278 | ---------------------------------------------------------------------- |
33ccb468 | 6279 | |
d16e0461 | 6280 | A.6.1. Setting up Oracle for use with PowerDNS |
33ccb468 | 6281 | |
d16e0461 TP |
6282 | To setup a database that corresponds to these default queries, issue the |
6283 | following as Oracle user sys: | |
33ccb468 | 6284 | |
d16e0461 TP |
6285 | create user powerdns identified by YOURPASSWORD; |
6286 | grant connect to powerdns; | |
6287 | ||
6288 | create tablespace powerdns datafile '/opt/oracle/oradata/oracle/powerdns.dbf' | |
6289 | size 256M extent management local autoallocate; | |
6290 | ||
6291 | alter user powerdns quota unlimited on powerdns; | |
6292 | ||
33ccb468 | 6293 | |
6294 | As user 'powerdns' continue with: | |
33ccb468 | 6295 | |
d16e0461 TP |
6296 | create table Domains ( |
6297 | ID number(11) NOT NULL, | |
6298 | NAME VARCHAR(255) NOT NULL, | |
6299 | MASTER VARCHAR(20) DEFAULT NULL, | |
6300 | LAST_CHECK INT DEFAULT NULL, | |
6301 | TYPE VARCHAR(6) NOT NULL, | |
6302 | NOTIFIED_SERIAL INT DEFAULT NULL, | |
6303 | ACCOUNT VARCHAR(40) DEFAULT NULL, | |
6304 | primary key (ID) | |
6305 | )tablespace POWERDNS; | |
6306 | ||
6307 | create index DOMAINS$NAME on Domains (NAME) tablespace POWERDNS; | |
6308 | create sequence DOMAINS_ID_SEQUENCE; | |
6309 | ||
6310 | create table Records | |
6311 | ( | |
6312 | ID number(11) NOT NULL, | |
6313 | ZoneID number(11) default NULL REFERENCES Domains(ID) ON DELETE CASCADE, | |
6314 | NAME varchar2(255) default NULL, | |
6315 | TYPE varchar2(6) default NULL, | |
6316 | CONTENT varchar2(255) default NULL, | |
6317 | TimeToLive number(11) default NULL, | |
6318 | Priority number(11) default NULL, | |
6319 | CreateDate number(11) default NULL, | |
6320 | ChangeDate number(11) default NULL, | |
6321 | primary key (ID) | |
6322 | )tablespace POWERDNS; | |
6323 | ||
6324 | create index RECORDS$NAME on RECORDS (NAME) tablespace POWERDNS; | |
6325 | create sequence RECORDS_ID_SEQUENCE; | |
6326 | ||
33ccb468 | 6327 | |
6328 | To insert records, either use zone2sql with the --oracle setting, or | |
6329 | execute sql along the lines of: | |
33ccb468 | 6330 | |
d16e0461 TP |
6331 | insert into domains (id,name,type) values (domains_id_sequence.nextval,'netherlabs.nl','NATIVE'); |
6332 | insert into Records (id,ZoneId, name,type,content,TimeToLive,Priority) select RECORDS_ID_SEQUENCE.nextval,id ,'netherlabs.nl', 'SOA', 'ahu.casema.net. hostmaster.ds9a.nl. 2000081401 28800 7200 604800 86400', 3600, 0 from Domains where name='netherlabs.nl'; | |
6333 | insert into Records (id,ZoneId, name,type,content,TimeToLive,Priority) select RECORDS_ID_SEQUENCE.nextval,id ,'netherlabs.nl', 'NS', 'ahu.casema.net', 3600, 0 from Domains where name='netherlabs.nl'; | |
6334 | insert into Records (id,ZoneId, name,type,content,TimeToLive,Priority) select RECORDS_ID_SEQUENCE.nextval,id ,'netherlabs.nl', 'NS', 'ns1.pine.nl', 3600, 0 from Domains where name='netherlabs.nl'; | |
6335 | insert into Records (id,ZoneId, name,type,content,TimeToLive,Priority) select RECORDS_ID_SEQUENCE.nextval,id ,'netherlabs.nl', 'NS', 'ns2.pine.nl', 3600, 0 from Domains where name='netherlabs.nl'; | |
6336 | insert into Records (id,ZoneId, name,type,content,TimeToLive,Priority) select RECORDS_ID_SEQUENCE.nextval,id ,'netherlabs.nl', 'A', '213.244.168.210', 3600, 0 from Domains where name='netherlabs.nl'; | |
6337 | insert into Records (id,ZoneId, name,type,content,TimeToLive,Priority) select RECORDS_ID_SEQUENCE.nextval,id ,'netherlabs.nl', 'MX', 'outpost.ds9a.nl', 3600, 10 from Domains where name='netherlabs.nl'; | |
33ccb468 | 6338 | |
d16e0461 | 6339 | |
33ccb468 | 6340 | |
6341 | For performance reasons it is best to specify --transactions too! | |
33ccb468 | 6342 | |
d16e0461 TP |
6343 | ---------------------------------------------------------------------- |
6344 | ||
6345 | A.7. Generic SQLite backend | |
6346 | ||
6347 | Table A-7. Generic SQLite backend capabilities | |
6348 | ||
6349 | +-----------------------+ | |
6350 | | Native | Yes | | |
6351 | |-------------+---------| | |
6352 | | Master | Yes | | |
6353 | |-------------+---------| | |
6354 | | Slave | Yes | | |
6355 | |-------------+---------| | |
6356 | | Superslave | Yes | | |
6357 | |-------------+---------| | |
6358 | | Module name | gsqlite | | |
6359 | |-------------+---------| | |
6360 | | Launch name | gsqlite | | |
6361 | +-----------------------+ | |
6362 | ||
6363 | This backend retrieves all data from a SQLite database, which is a RDBMS | |
6364 | that's embedded into the application itself, so you won't need to be | |
6365 | running a seperate server process. It also reduces overhead, and | |
6366 | simplifies installation. At http://www.sqlite.org you can find more | |
6367 | information about SQLite. | |
6368 | ||
6369 | As this is a generic backend, built on top of the gSql framework, you can | |
6370 | specify all queries as documented in Generic MySQL and PgSQL backends. | |
6371 | ||
6372 | ---------------------------------------------------------------------- | |
6373 | ||
6374 | A.7.1. Compiling the SQLite backend | |
6375 | ||
6376 | Before you can begin compiling PowerDNS with the SQLite backend you need | |
6377 | to have the SQLite utility and library installed on your system. You can | |
6378 | download these from http://www.sqlite.org/download.html, or you can use | |
6379 | packages (if your distribution provides those). | |
6380 | ||
6381 | When you've installed the library you can use: ./configure | |
6382 | --with-modules="gsqlite" to configure PowerDNS to use the SQLite backend. | |
6383 | Compilation can then proceed as usual. | |
6384 | ||
6385 | SQLite is included in most PowerDNS binary releases. | |
6386 | ||
6387 | ---------------------------------------------------------------------- | |
6388 | ||
6389 | A.7.2. Setting up the database | |
6390 | ||
6391 | Before you can use this backend you first have to set it up and fill it | |
6392 | with data. The default setup conforms to the following schema: | |
6393 | ||
6394 | create table domains ( | |
6395 | id INTEGER PRIMARY KEY, | |
6396 | name VARCHAR(255) NOT NULL, | |
6397 | master VARCHAR(20) DEFAULT NULL, | |
6398 | last_check INTEGER DEFAULT NULL, | |
6399 | type VARCHAR(6) NOT NULL, | |
6400 | notified_serial INTEGER DEFAULT NULL, | |
6401 | account VARCHAR(40) DEFAULT NULL | |
6402 | ); | |
6403 | ||
6404 | CREATE UNIQUE INDEX name_index ON domains(name); | |
6405 | ||
6406 | CREATE TABLE records ( | |
6407 | id INTEGER PRIMARY KEY, | |
6408 | domain_id INTEGER DEFAULT NULL, | |
6409 | name VARCHAR(255) DEFAULT NULL, | |
6410 | type VARCHAR(6) DEFAULT NULL, | |
6411 | content VARCHAR(255) DEFAULT NULL, | |
6412 | ttl INTEGER DEFAULT NULL, | |
6413 | prio INTEGER DEFAULT NULL, | |
6414 | change_date INTEGER DEFAULT NULL | |
6415 | ); | |
6416 | ||
6417 | CREATE INDEX rec_name_index ON records(name); | |
6418 | CREATE INDEX nametype_index ON records(name,type); | |
6419 | CREATE INDEX domain_id ON records(domain_id); | |
6420 | ||
6421 | create table supermasters ( | |
6422 | ip VARCHAR(25) NOT NULL, | |
6423 | nameserver VARCHAR(255) NOT NULL, | |
6424 | account VARCHAR(40) DEFAULT NULL | |
6425 | ); | |
6426 | ||
6427 | ||
6428 | This schema contains all elements needed for master, slave and superslave | |
6429 | operation. | |
6430 | ||
6431 | After you have created the database you probably want to fill it with | |
6432 | data. If you have a BIND zonefile it's as easy as: zone2sql | |
6433 | --zone=myzonefile --gmysql | sqlite powerdns.sqlite, but you can also use | |
6434 | AXFR (or insert data manually if you have too much time ;)). | |
6435 | ||
6436 | ---------------------------------------------------------------------- | |
6437 | ||
6438 | A.7.3. Using the SQLite backend | |
6439 | ||
6440 | The last thing you need to do is telling PowerDNS to use the SQLite | |
6441 | backend. | |
6442 | ||
6443 | # in pdns.conf | |
6444 | launch=gsqlite | |
6445 | gsqlite-database=<path to your SQLite database> | |
6446 | ||
6447 | ||
6448 | Then you can start PowerDNS and it should notify you that a connection to | |
6449 | the database was made. | |
33ccb468 | 6450 | |
d16e0461 | 6451 | ---------------------------------------------------------------------- |
33ccb468 | 6452 | |
d16e0461 TP |
6453 | A.8. DB2 backend |
6454 | ||
6455 | Table A-8. DB2 backend capabilities | |
6456 | ||
6457 | +-------------------+ | |
6458 | | Native | Yes | | |
6459 | |-------------+-----| | |
6460 | | Master | No | | |
6461 | |-------------+-----| | |
6462 | | Slave | No | | |
6463 | |-------------+-----| | |
6464 | | Superslave | No | | |
6465 | |-------------+-----| | |
6466 | | Autoserial | Yes | | |
6467 | |-------------+-----| | |
6468 | | Module name | db2 | | |
6469 | |-------------+-----| | |
6470 | | Launch name | db2 | | |
6471 | +-------------------+ | |
6472 | ||
6473 | PowerDNS is currently ascertaining if this backend can be distributed in | |
6474 | binary form without violating IBM DB2 licensing. | |
33ccb468 | 6475 | |
6476 | The DB2 backend executes the following queries: | |
6477 | ||
6478 | Forward Query | |
d16e0461 TP |
6479 | |
6480 | select Content, TimeToLive, Priority, Type, ZoneId, 0 as | |
6481 | ChangeDate, Name from Records where Name = ? and type = ? | |
33ccb468 | 6482 | |
6483 | Forward By Zone Query | |
d16e0461 TP |
6484 | |
6485 | select Content, TimeToLive, Priority, Type, ZoneId, 0 as | |
6486 | ChangeDate, Name from Records where Name = ? and Type = ? and | |
6487 | ZoneId = ? | |
33ccb468 | 6488 | |
6489 | Forward Any Query | |
d16e0461 TP |
6490 | |
6491 | select Content, TimeToLive, Priority, Type, ZoneId, 0 as | |
6492 | ChangeDate, Name from Records where Name = ? | |
33ccb468 | 6493 | |
6494 | List Query | |
d16e0461 TP |
6495 | |
6496 | select Content, TimeToLive, Priority, Type, ZoneId, 0 as | |
6497 | ChangeDate, Name from Records where ZoneId = ? | |
33ccb468 | 6498 | |
6499 | Configuration settings: | |
6500 | ||
6501 | db2-server | |
d16e0461 TP |
6502 | |
6503 | Server name to connect to. Defaults to 'powerdns'. Make sure that | |
6504 | your nameserver is not needed to resolve an IP address needed to | |
6505 | connect as this might lead to a chicken/egg situation. | |
33ccb468 | 6506 | |
6507 | db2-user | |
d16e0461 TP |
6508 | |
6509 | Username to connect as. Defaults to 'powerdns'. | |
33ccb468 | 6510 | |
6511 | db2-password | |
33ccb468 | 6512 | |
d16e0461 TP |
6513 | Password to connect with. Defaults to 'powerdns'. |
6514 | ||
6515 | ---------------------------------------------------------------------- | |
6516 | ||
6517 | A.9. Bind zone file backend | |
6518 | ||
6519 | Table A-9. Bind zone file backend capabilities | |
33ccb468 | 6520 | |
d16e0461 TP |
6521 | +-------------------------------+ |
6522 | | Native | Yes | | |
6523 | |-------------+-----------------| | |
6524 | | Master | Yes | | |
6525 | |-------------+-----------------| | |
6526 | | Slave | Yes | | |
6527 | |-------------+-----------------| | |
6528 | | Superslave | No | | |
6529 | |-------------+-----------------| | |
6530 | | Autoserial | No | | |
6531 | |-------------+-----------------| | |
6532 | | Module name | none (built in) | | |
6533 | |-------------+-----------------| | |
6534 | | Launch | bind | | |
6535 | +-------------------------------+ | |
33ccb468 | 6536 | |
d16e0461 TP |
6537 | Note There is also the Bind2backend which works exactly like this backend |
6538 | but is far more experimental. In the future it supplant the | |
6539 | bindbackend. | |
33ccb468 | 6540 | |
d16e0461 TP |
6541 | The BindBackend started life as a demonstration of the versatility of PDNS |
6542 | but quickly gained in importance when there appeared to be demand for a | |
6543 | Bind 'workalike'. | |
6544 | ||
6545 | The BindBackend parses a Bind-style named.conf and extracts information | |
6546 | about zones from it. It makes no attempt to honour other configuration | |
6547 | flags, which you should configure (when available) using the PDNS native | |
6548 | configuration. | |
33ccb468 | 6549 | |
6550 | --help=bind | |
d16e0461 TP |
6551 | |
6552 | Outputs all known parameters related to the bindbackend | |
33ccb468 | 6553 | |
6554 | bind-example-zones | |
d16e0461 TP |
6555 | |
6556 | Loads the 'example.com' zone which can be queried to determine if | |
6557 | PowerDNS is functioning without configuring database backends. | |
33ccb468 | 6558 | |
6559 | bind-config= | |
d16e0461 TP |
6560 | |
6561 | Location of the Bind configuration file to parse. | |
33ccb468 | 6562 | |
6563 | bind-check-interval= | |
d16e0461 TP |
6564 | |
6565 | How often to check for zone changes. See 'Operation' section. | |
33ccb468 | 6566 | |
6567 | bind-enable-huffman | |
33ccb468 | 6568 | |
d16e0461 TP |
6569 | Enable Huffman compression on zone data. Currently saves around |
6570 | 20% of memory actually used, but slows down operation somewhat. | |
6571 | ||
6572 | ---------------------------------------------------------------------- | |
6573 | ||
6574 | A.9.1. Operation | |
6575 | ||
6576 | On launch, the BindBackend first parses the named.conf to determine which | |
6577 | zones need to be loaded. These will then be parsed and made available for | |
6578 | serving, as they are parsed. So a named.conf with 100.000 zones may take | |
6579 | 20 seconds to load, but after 10 seconds, 50.000 zones will already be | |
6580 | available. While a domain is being loaded, it is not yet available, to | |
6581 | prevent incomplete answers. | |
33ccb468 | 6582 | |
d16e0461 TP |
6583 | Reloading is currently done only when a request for a zone comes in, and |
6584 | then only after bind-check-interval seconds have passed after the last | |
6585 | check. If a change occurred, access to the zone is disabled, the file is | |
6586 | reloaded, access is restored, and the question is answered. For regular | |
6587 | zones, reloading is fast enough to answer the question which lead to the | |
6588 | reload within the DNS timeout. | |
33ccb468 | 6589 | |
d16e0461 TP |
6590 | If bind-check-interval is specified as zero, no checks will be performed |
6591 | until the pdns_control reload is given. | |
33ccb468 | 6592 | |
d16e0461 | 6593 | ---------------------------------------------------------------------- |
33ccb468 | 6594 | |
d16e0461 | 6595 | A.9.2. Pdns_control commands |
33ccb468 | 6596 | |
6597 | bind-domain-status domain [domain] | |
d16e0461 TP |
6598 | |
6599 | Output status of domain or domains. Can be one of 'seen in | |
6600 | named.conf, not parsed', 'parsed successfully at <time;>' or | |
6601 | 'error parsing at line ... at <time>'. | |
33ccb468 | 6602 | |
6603 | bind-list-rejects | |
d16e0461 TP |
6604 | |
6605 | Lists all zones that have problems, and what those problems are. | |
33ccb468 | 6606 | |
6607 | bind-reload-now domain | |
33ccb468 | 6608 | |
d16e0461 TP |
6609 | Reloads a zone from disk NOW, reporting back results. |
6610 | ||
6611 | ---------------------------------------------------------------------- | |
6612 | ||
6613 | A.9.3. Performance | |
33ccb468 | 6614 | |
d16e0461 TP |
6615 | The BindBackend does not benefit from the packet cache as it is fast |
6616 | enough on its own. Furthermore, on most systems, there will be no benefit | |
6617 | in using multiple CPUs for the packetcache, so a noticeable speedup can be | |
6618 | attained by specifying distributor-threads=1 in pdns.conf. | |
33ccb468 | 6619 | |
d16e0461 | 6620 | ---------------------------------------------------------------------- |
33ccb468 | 6621 | |
d16e0461 | 6622 | A.9.4. Master/slave configuration |
33ccb468 | 6623 | |
d16e0461 | 6624 | A.9.4.1. Master |
33ccb468 | 6625 | |
d16e0461 TP |
6626 | Works as expected. At startup, no notification storm is performed as this |
6627 | is generally not useful. Perhaps in the future the Bind Backend will | |
6628 | attempt to store zone metadata in the zone, allowing it to determine if a | |
6629 | zone has changed its serial since the last time notifications were sent | |
6630 | out. | |
33ccb468 | 6631 | |
d16e0461 TP |
6632 | Changes which are discovered when reloading zones do lead to notifications |
6633 | however. | |
33ccb468 | 6634 | |
d16e0461 | 6635 | ---------------------------------------------------------------------- |
33ccb468 | 6636 | |
d16e0461 | 6637 | A.9.4.2. Slave |
33ccb468 | 6638 | |
d16e0461 TP |
6639 | Also works as expected. The Bind backend expects to be able to write to a |
6640 | directory where a slave domain lives. The incoming zone is stored as | |
6641 | 'zonename.RANDOM' and atomically renamed if it is retrieved successfully, | |
6642 | and parsed only then. | |
33ccb468 | 6643 | |
d16e0461 TP |
6644 | In the future, this may be improved so the old zone remains available |
6645 | should parsing fail. | |
6646 | ||
6647 | ---------------------------------------------------------------------- | |
6648 | ||
6649 | A.9.5. Commands | |
6650 | ||
6651 | pdns_control offers commands to communicate instructions to PowerDNS. | |
6652 | These are detailed here. | |
33ccb468 | 6653 | |
6654 | rediscover | |
33ccb468 | 6655 | |
d16e0461 TP |
6656 | Reread the bind configuration file (named.conf). If parsing fails, |
6657 | the old configuration remains in force and pdns_control reports | |
6658 | the error. Any newly discovered domains are read, discarded | |
6659 | domains are removed from memory. | |
6660 | ||
6661 | Note Except that with 2.9.3, they are not removed from | |
6662 | memory. | |
33ccb468 | 6663 | |
d16e0461 TP |
6664 | reload |
6665 | ||
6666 | All zones with a changed timestamp are reloaded at the next | |
6667 | incoming query for them. | |
33ccb468 | 6668 | |
d16e0461 | 6669 | ---------------------------------------------------------------------- |
33ccb468 | 6670 | |
d16e0461 | 6671 | A.10. ODBC backend |
33ccb468 | 6672 | |
d16e0461 | 6673 | Table A-10. ODBC backend capabilities |
33ccb468 | 6674 | |
d16e0461 TP |
6675 | +---------------------------------+ |
6676 | | Native | Yes | | |
6677 | |------------+--------------------| | |
6678 | | Master | Yes (experimental) | | |
6679 | |------------+--------------------| | |
6680 | | Slave | Yes (experimental) | | |
6681 | |------------+--------------------| | |
6682 | | Superslave | No | | |
6683 | |------------+--------------------| | |
6684 | | Autoserial | Yes | | |
6685 | +---------------------------------+ | |
33ccb468 | 6686 | |
d16e0461 TP |
6687 | The ODBC backend can retrieve zone information from any source that has a |
6688 | ODBC driver available. | |
33ccb468 | 6689 | |
d16e0461 | 6690 | Note This backend is only available on PowerDNS for Windows. |
33ccb468 | 6691 | |
6692 | The ODBC backend needs data in a fixed schema which is the same as the | |
d16e0461 TP |
6693 | data needed by the MySQL backend. The create statement will resemble this: |
6694 | ||
6695 | CREATE TABLE records ( | |
6696 | id int(11) NOT NULL auto_increment, | |
6697 | domain_id int(11) default NULL, | |
6698 | name varchar(255) default NULL, | |
6699 | type varchar(6) default NULL, | |
6700 | content varchar(255) default NULL, | |
6701 | ttl int(11) default NULL, | |
6702 | prio int(11) default NULL, | |
6703 | change_date int(11) default NULL, | |
6704 | PRIMARY KEY (id), | |
6705 | KEY name_index(name), | |
6706 | KEY nametype_index(name,type), | |
6707 | KEY domainid_index(domain_id) | |
6708 | ); | |
6709 | ||
6710 | ||
6711 | To use the ODBC backend an ODBC source has to be created, to do this see | |
6712 | the section Installing PowerDNS on Microsoft Windows, Chapter 3. | |
33ccb468 | 6713 | |
6714 | The following configuration settings are available: | |
6715 | ||
6716 | odbc-datasource | |
d16e0461 TP |
6717 | |
6718 | Specifies the name of the data source to use. | |
33ccb468 | 6719 | |
6720 | odbc-user | |
d16e0461 TP |
6721 | |
6722 | Specifies the username that has to be used to log into the | |
6723 | datasource. | |
33ccb468 | 6724 | |
6725 | odbc-pass | |
d16e0461 TP |
6726 | |
6727 | Specifies the user's password. | |
33ccb468 | 6728 | |
6729 | odbc-table | |
33ccb468 | 6730 | |
d16e0461 TP |
6731 | Specifies the name of the table containing the zone information. |
6732 | ||
6733 | The ODBC backend has been tested with Microsoft Access, MySQL (via MyODBC) | |
6734 | and Microsoft SQLServer. As the SQL statements used are very basic, it is | |
6735 | expected to work with many ODBC drivers. | |
6736 | ||
6737 | ---------------------------------------------------------------------- | |
6738 | ||
6739 | A.11. XDB Backend | |
6740 | ||
6741 | Special purpose backend for grandiose performance. Can talk to Tridge's | |
6742 | Trivial Database, or to regular *db tables on disk. Currently only | |
6743 | sparsely documented. Very useful if you need to do >50.000 queries/second, | |
6744 | which we actually measured on the .ORG zone. | |
6745 | ||
6746 | More documentation will follow. | |
6747 | ||
6748 | ---------------------------------------------------------------------- | |
6749 | ||
6750 | A.12. LDAP backend | |
6751 | ||
6752 | The main author for this module is Norbert Sendetzky who also has his own | |
6753 | PowerDNS-LDAP page. | |
6754 | ||
6755 | Table A-11. LDAP backend capabilities | |
6756 | ||
6757 | +------------------+ | |
6758 | | Native | Yes | | |
6759 | |------------+-----| | |
6760 | | Master | No | | |
6761 | |------------+-----| | |
6762 | | Slave | No | | |
6763 | |------------+-----| | |
6764 | | Superslave | No | | |
6765 | |------------+-----| | |
6766 | | Autoserial | Yes | | |
6767 | +------------------+ | |
6768 | ||
6769 | As of 2.9.6, PowerDNS comes with an LDAP backend. The code for this was | |
6770 | submitted by Norbert Sendetzky. | |
6771 | ||
6772 | The following settings are available to configure the LDAP backend: | |
6773 | ||
6774 | ldap-host | |
6775 | ||
6776 | LDAP host to connect to, defaults to localhost. | |
6777 | ||
6778 | ldap-port | |
6779 | ||
6780 | LDAP port to connect to, defaults to 389. | |
6781 | ||
6782 | ldap-basedn | |
6783 | ||
6784 | Root for DNS searches. Must be configured before the LDAP backend | |
6785 | will work. | |
6786 | ||
6787 | ldap-binddn | |
6788 | ||
6789 | Distinguished Name to bind with to the LDAP server. Defaults to | |
6790 | the empty string for anonymous bind. | |
6791 | ||
6792 | ldap-secret | |
6793 | ||
6794 | Secret to bind with to LDAP server. Defaults to the empty string | |
6795 | for anonymous bind. | |
6796 | ||
6797 | ldap-default-ttl | |
6798 | ||
6799 | TTL for records with no dnsttl attribute. Defaults to 86400 | |
6800 | seconds. | |
6801 | ||
6802 | The schema used is that defined by RFC 1279 and is present in OpenLDAP | |
6803 | under the name 'cosine.schema'. An example LDIF file: | |
6804 | ||
6805 | # zone related things including SOA, NS and MX records | |
33ccb468 | 6806 | |
d16e0461 TP |
6807 | dn: dc=example |
6808 | objectclass: top | |
6809 | objectclass: dnsdomain | |
6810 | objectclass: domainrelatedobject | |
6811 | dc: example | |
6812 | soarecord: ns.example.dom hostmaster@example.dom 2002010401 1800 3600 604800 84600 | |
6813 | nsrecord: ns.example.dom | |
6814 | mxrecord: 10 mail.example.dom | |
6815 | mxrecord: 20 mail2.example.dom | |
6816 | associateddomain: example.dom | |
33ccb468 | 6817 | |
33ccb468 | 6818 | |
d16e0461 | 6819 | # Simple record (mail.example.dom has address 172.168.0.2) |
33ccb468 | 6820 | |
d16e0461 TP |
6821 | dn: dc=mail,dc=example |
6822 | objectclass: top | |
6823 | objectclass: dnsdomain | |
6824 | objectclass: domainrelatedobject | |
6825 | dc: mail | |
6826 | arecord: 172.168.0.2 | |
6827 | associateddomain: mail.example.dom | |
33ccb468 | 6828 | |
d16e0461 TP |
6829 | # There may more than one entry per record |
6830 | # This is also applicable to all other records including "associateddomain" | |
6831 | # but not for a CNAME record | |
6832 | ||
6833 | dn: dc=server,dc=snapcount | |
6834 | objectclass: top | |
6835 | objectclass: dnsdomain | |
6836 | objectclass: domainrelatedobject | |
6837 | dc: server | |
6838 | arecord: 10.1.0.1 | |
6839 | arecord: 172.168.0.1 | |
6840 | associateddomain: server.example.dom | |
6841 | ||
6842 | ||
6843 | # domain alias ({mail2,ns}.example.dom is CNAME for server.example.dom) | |
6844 | # cnamerecord must only contain one entry | |
6845 | ||
6846 | dn: dc=backup,dc=snapcount | |
6847 | objectclass: top | |
6848 | objectclass: dnsdomain | |
6849 | objectclass: domainrelatedobject | |
6850 | dc: server | |
6851 | cnamerecord: server.example.dom | |
6852 | associateddomain: mail2.example.dom | |
6853 | associateddomain: ns.example.dom | |
6854 | ||
6855 | ---------------------------------------------------------------------- | |
6856 | ||
6857 | Appendix B. PDNS internals | |
6858 | ||
6859 | PDNS is normally launched by the init.d script but is actually a binary | |
6860 | called pdns_server. This file is started by the start and monitor commands | |
6861 | to the init.d script. Other commands are implemented using the | |
6862 | controlsocket. | |
6863 | ||
6864 | ---------------------------------------------------------------------- | |
33ccb468 | 6865 | |
6866 | B.1. Controlsocket | |
6867 | ||
d16e0461 TP |
6868 | The controlsocket is the means to contact a running PDNS daemon, or as we |
6869 | now know, a running pdns_server. Over this sockets, instructions can be | |
6870 | sent using the pdns_control program. Like the pdns_server, this program is | |
6871 | normally accessed via the init.d script. | |
33ccb468 | 6872 | |
d16e0461 | 6873 | ---------------------------------------------------------------------- |
33ccb468 | 6874 | |
d16e0461 | 6875 | B.1.1. pdns_control |
33ccb468 | 6876 | |
d16e0461 TP |
6877 | To communicate with PDNS over the controlsocket, the pdns_control command |
6878 | is used. The init.d script also calls pdns_control. The syntax is simple: | |
6879 | pdns_control command arguments. Currently this is most useful for telling | |
6880 | backends to rediscover domains or to force the transmission of | |
6881 | notifications. See Section 13.3. | |
6882 | ||
6883 | Besides the commands implemented by the init.d script, for which see | |
6884 | Section 2.3, the following pdns_control commands are available: | |
33ccb468 | 6885 | |
6886 | ccounts | |
d16e0461 TP |
6887 | |
6888 | Returns counts on the contents of the cache. | |
33ccb468 | 6889 | |
6890 | notify domain | |
d16e0461 TP |
6891 | |
6892 | Adds a domain to the notification list, causing PDNS to send out | |
6893 | notifications to the nameservers of a domain. Can be used if a | |
6894 | slave missed previous notifications or is generally hard of | |
6895 | hearing. | |
33ccb468 | 6896 | |
6897 | notify-host domain host | |
d16e0461 TP |
6898 | |
6899 | Same as above but with operator specified IP address as | |
6900 | destination, to be used if you know better than PowerDNS. | |
33ccb468 | 6901 | |
6902 | purge | |
d16e0461 TP |
6903 | |
6904 | Purges the entire Packet Cache - see Chapter 9. | |
33ccb468 | 6905 | |
6906 | purge record | |
d16e0461 TP |
6907 | |
6908 | Purges all entries for this exact record name - see Chapter 9. | |
33ccb468 | 6909 | |
6910 | purge record$ | |
d16e0461 TP |
6911 | |
6912 | Purges all cache entries ending on this name, effectively purging | |
6913 | an entire domain - see Chapter 9. | |
33ccb468 | 6914 | |
6915 | purge | |
d16e0461 TP |
6916 | |
6917 | Purges the entire Packet Cache - see Chapter 9. | |
33ccb468 | 6918 | |
6919 | purge record | |
d16e0461 TP |
6920 | |
6921 | Purges all entries for this exact record name - see Chapter 9. | |
33ccb468 | 6922 | |
6923 | rediscover | |
d16e0461 TP |
6924 | |
6925 | Instructs backends that new domains may have appeared in the | |
6926 | database, or, in the case of the Bind backend, in named.conf. | |
33ccb468 | 6927 | |
6928 | reload | |
d16e0461 TP |
6929 | |
6930 | Instructs backends that the contents of domains may have changed. | |
6931 | Many backends ignore this, the Bind backend will check timestamps | |
6932 | for all zones (once queries come in for it) and reload if needed. | |
33ccb468 | 6933 | |
6934 | retrieve domain | |
d16e0461 TP |
6935 | |
6936 | Retrieve a slave domain from its master. Done nearly immediatly. | |
33ccb468 | 6937 | |
6938 | set variable value | |
d16e0461 TP |
6939 | |
6940 | Set a configuration parameter. Currently only the 'query-logging' | |
6941 | parameter can be set. | |
33ccb468 | 6942 | |
6943 | uptime | |
d16e0461 TP |
6944 | |
6945 | Reports the uptime of the daemon in human readable form. | |
33ccb468 | 6946 | |
6947 | version | |
d16e0461 TP |
6948 | |
6949 | returns the version of a running pdns daemon. | |
6950 | ||
6951 | ---------------------------------------------------------------------- | |
33ccb468 | 6952 | |
6953 | B.2. Guardian | |
6954 | ||
d16e0461 TP |
6955 | When launched by the init.d script, pdns_server wraps itself inside a |
6956 | 'guardian'. This guardian monitors the performance of the inner | |
6957 | pdns_server instance which shows up in the process list of your OS as | |
6958 | pdns_server-instance. It is also this guardian that pdns_control talks to. | |
6959 | A STOP is interpreted by the guardian, which causes the guardian to sever | |
6960 | the connection to the inner process and terminate it, after which it | |
6961 | terminates itself. The init.d script DUMP and SHOW commands need to access | |
6962 | the inner process, because the guardian itself does not run a nameserver. | |
6963 | For this purpose, the guardian passes controlsocket requests to the | |
6964 | control console of the inner process. This is the same console as seen | |
6965 | with init.d MONITOR. | |
6966 | ||
6967 | ---------------------------------------------------------------------- | |
33ccb468 | 6968 | |
6969 | B.3. Modules & Backends | |
6970 | ||
d16e0461 TP |
6971 | PDNS has the concept of backends and modules. Non-static PDNS |
6972 | distributions have the ability to load new modules at runtime, while the | |
6973 | static versions come with a number of modules built in, but cannot load | |
6974 | more. | |
33ccb468 | 6975 | |
d16e0461 | 6976 | Related parameters are: |
33ccb468 | 6977 | |
6978 | --help | |
d16e0461 TP |
6979 | |
6980 | Outputs all known parameters, including those of launched | |
6981 | backends, see below. | |
33ccb468 | 6982 | |
6983 | --launch=backend,backend1,backend1:name | |
d16e0461 TP |
6984 | |
6985 | Launches backends. In its most simple form, supply all backends | |
6986 | that need to be launched. If you find that you need to launch | |
6987 | single backends multiple times, you can specify a name for later | |
6988 | instantiations. In this case, there are 2 instances of backend1, | |
6989 | and the second one is called 'name'. This means that | |
6990 | --backend1-setting is available to configure the first or main | |
6991 | instance, and --backend1-name-setting for the second one. | |
33ccb468 | 6992 | |
6993 | --load-modules=/directory/libyourbackend.so | |
d16e0461 TP |
6994 | |
6995 | If backends are available in nonstandard directories, specify | |
6996 | their location here. Multiple files can be loaded if separated by | |
6997 | commas. Only available in non-static PDNS distributions. | |
33ccb468 | 6998 | |
6999 | --list-modules | |
33ccb468 | 7000 | |
d16e0461 TP |
7001 | Will list all available modules, both compiled in and in |
7002 | dynamically loadable modules. | |
33ccb468 | 7003 | |
d16e0461 TP |
7004 | To run on the commandline, use the pdns_server binary. For example, to see |
7005 | options for the gpgsql backend, use the following: | |
7006 | ||
7007 | $ /usr/sbin/pdns_server --launch=gpgsql --help=gpgsql | |
7008 | ||
7009 | ||
7010 | ---------------------------------------------------------------------- | |
33ccb468 | 7011 | |
7012 | B.4. How PDNS translates DNS queries into backend queries | |
7013 | ||
d16e0461 TP |
7014 | A DNS query is not a straightforward lookup. Many DNS queries need to |
7015 | check the backend for additional data, for example to determine of an | |
7016 | unfound record should lead to an NXDOMAIN ('we know about this domain, but | |
7017 | that record does not exist') or an unauthoritative response. | |
7018 | ||
7019 | Simplified, without CNAME processing and wildcards, the algorithm is like | |
7020 | this: | |
33ccb468 | 7021 | |
d16e0461 TP |
7022 | When a query for a qname/qtype tuple comes in, it is requested directly |
7023 | from the backend. If present, PDNS adds the contents of the reply to the | |
7024 | list of records to return. A question tuple may generate multiple answer | |
7025 | records. | |
33ccb468 | 7026 | |
d16e0461 TP |
7027 | Each of these records is now investigated to see if it needs 'additional |
7028 | processing'. This holds for example for MX records which may point to | |
7029 | hosts for which the PDNS backends also contain data. This involves further | |
7030 | lookups for A or AAAA records. | |
33ccb468 | 7031 | |
d16e0461 TP |
7032 | After all additional processing has been performed, PDNS sieves out all |
7033 | double records which may well have appeared. The resulting set of records | |
7034 | is added to the answer packet, and sent out. | |
33ccb468 | 7035 | |
d16e0461 TP |
7036 | A zone transfer works by looking up the domain_id of the SOA record of the |
7037 | name and then listing all records of that domain_id. This is why all | |
7038 | records in a domain need to have the same domain_id. | |
33ccb468 | 7039 | |
d16e0461 TP |
7040 | When a query comes in for an unknown domain, PDNS starts looking for SOA |
7041 | records of all subdomains of the qname, so no.such.powerdns.com turns into | |
7042 | a SOA query for no.such.powerdns.com, such.powerdns.com, powerdns.com, | |
7043 | com, ''. When a SOA is found, that zone is consulted for relevant NS | |
7044 | instructions which lead to a referral. If nothing is found within the | |
7045 | zone, an authoritative NXDOMAIN is sent out. | |
33ccb468 | 7046 | |
d16e0461 | 7047 | If no SOA was found, an unauthoritative no-error is returned. |
33ccb468 | 7048 | |
d16e0461 TP |
7049 | In reality, each query for a question tuple first involves checking for a |
7050 | CNAME, unless that resolution has been disabled with the skip-cname | |
7051 | option. | |
33ccb468 | 7052 | |
d16e0461 TP |
7053 | PDNS breaks strict RFC compatability by not always checking for the |
7054 | presence of a SOA record first. This is unlikely to lead to problems | |
7055 | though. | |
33ccb468 | 7056 | |
d16e0461 | 7057 | ---------------------------------------------------------------------- |
33ccb468 | 7058 | |
d16e0461 | 7059 | Appendix C. Backend writers' guide |
33ccb468 | 7060 | |
d16e0461 TP |
7061 | PDNS backends are implemented via a simple yet powerful C++ interface. If |
7062 | your needs are not met by the PipeBackend, you may want to write your own. | |
7063 | Doing so requires a copy of the PowerDNS Open Source Backend Development | |
7064 | kit which can be found on http://downloads.powerdns.com/releases/dev. | |
33ccb468 | 7065 | |
d16e0461 TP |
7066 | A backend contains zero DNS logic. It need not look for CNAMES, it need |
7067 | not return NS records unless explicitly asked for, etcetera. All DNS logic | |
7068 | is contained within PDNS itself - backends should simply return records | |
7069 | matching the description asked for. | |
33ccb468 | 7070 | |
d16e0461 TP |
7071 | Warning However, please note that your backend can get queries in aNy |
7072 | CAsE! If your database is case sensitive, like most are (with the | |
7073 | notable exception of MySQL), you must make sure that you do find | |
7074 | answers which differ only in case. | |
33ccb468 | 7075 | |
d16e0461 | 7076 | ---------------------------------------------------------------------- |
33ccb468 | 7077 | |
7078 | C.1. Simple read-only native backends | |
7079 | ||
d16e0461 TP |
7080 | Implementing a backend consists of inheriting from the DNSBackend class. |
7081 | For read-only backends, which do not support slave operation, only the | |
7082 | following methods are relevant: | |
7083 | ||
7084 | class DNSBackend | |
7085 | { | |
7086 | public: | |
7087 | ||
7088 | virtual bool lookup(const QType &qtype, const string &qdomain, DNSPacket *pkt_p=0, int zoneId=-1)=0; | |
7089 | virtual bool list(int domain_id)=0; | |
7090 | virtual bool get(DNSResourceRecord &r)=0; | |
7091 | virtual bool getSOA(const string &name, SOAData &soadata); | |
7092 | }; | |
7093 | ||
7094 | ||
7095 | Note that the first three methods must be implemented. getSOA() has a | |
7096 | useful default implementation. | |
7097 | ||
7098 | The semantics are simple. Each instance of your class only handles one (1) | |
7099 | query at a time. There is no need for locking as PDNS guarantees that your | |
7100 | backend will never be called reentrantly. | |
7101 | ||
7102 | Some examples, a more formal specification is down below. A normal lookup | |
7103 | starts like this: | |
7104 | ||
7105 | YourBackend yb; | |
7106 | yb.lookup(QType::CNAME,"www.powerdns.com"); | |
7107 | ||
7108 | ||
7109 | Your class should now do everything to start this query. Perform as much | |
7110 | preparation as possible - handling errors at this stage is better for PDNS | |
7111 | than doing so later on. A real error should be reported by throwing an | |
7112 | exception. | |
7113 | ||
7114 | PDNS will then call the get() method to get DNSResourceRecords back. The | |
7115 | following code illustrates a typical query: | |
7116 | ||
7117 | yb.lookup(QType::CNAME,"www.powerdns.com"); | |
7118 | ||
7119 | DNSResourceRecord rr; | |
7120 | while(yb.get(rr)) | |
7121 | cout<<"Found cname pointing to '"+rr.content+"'"<<endl; | |
7122 | } | |
7123 | ||
7124 | ||
7125 | Each zone starts with a Start of Authority (SOA) record. This record is | |
7126 | special so many backends will choose to implement it specially. The | |
33ccb468 | 7127 | default getSOA() method performs a regular lookup on your backend to |
d16e0461 TP |
7128 | figure out the SOA, so if you have no special treatment for SOA records, |
7129 | where is no need to implement your own getSOA(). | |
33ccb468 | 7130 | |
d16e0461 TP |
7131 | Besides direct queries, PDNS also needs to be able to list a zone, to do |
7132 | zone transfers for example. Each zone has an id which should be unique | |
7133 | within the backend. To list all records belonging to a zone id, the list() | |
7134 | method is used. Conveniently, the domain_id is also available in the | |
7135 | SOAData structure. | |
33ccb468 | 7136 | |
7137 | The following lists the contents of a zone called "powerdns.com". | |
d16e0461 TP |
7138 | |
7139 | SOAData sd; | |
7140 | if(!yb.getSOA("powerdns.com",sd)) // are we authoritative over powerdns.com? | |
7141 | return RCode::NotAuth; // no | |
7142 | ||
7143 | yb.list(sd.domain_id); | |
7144 | while(yb.get(rr)) | |
7145 | cout<<rr.qname<<"\t IN "<<rr.qtype.getName()<<"\t"<<rr.content<<endl; | |
7146 | ||
7147 | ||
7148 | Please note that when so called 'fancy records' (see Chapter 14) are | |
7149 | enabled, a backend can receive wildcard lookups. These have a % as the | |
7150 | first character of the qdomain in lookup. | |
7151 | ||
7152 | ---------------------------------------------------------------------- | |
7153 | ||
7154 | C.1.1. A sample minimal backend | |
7155 | ||
7156 | This backend only knows about the host "random.powerdns.com", and | |
7157 | furthermore, only about its A record: | |
7158 | ||
7159 | /* FIRST PART */ | |
7160 | class RandomBackend : public DNSBackend | |
7161 | { | |
7162 | public: | |
7163 | bool list(int id) { | |
7164 | return false; // we don't support AXFR | |
7165 | } | |
7166 | ||
7167 | void lookup(const QType &type, const string &qdomain, DNSPacket *p, int zoneId) | |
7168 | { | |
7169 | if(type.getCode()!=QType::A || qdomain!="random.powerdns.com") // we only know about random.powerdns.com A | |
7170 | d_answer=""; // no answer | |
7171 | else { | |
7172 | ostringstream os; | |
7173 | os<<random()%256<<"."<<random()%256<<"."<<random()%256<<"."<<random()%256; | |
7174 | d_answer=os.str(); // our random ip address | |
7175 | } | |
7176 | } | |
7177 | ||
7178 | bool get(DNSResourceRecord &rr) | |
7179 | { | |
7180 | if(!d_answer.empty()) { | |
7181 | rr.qname="random.powerdns.com"; // fill in details | |
7182 | rr.qtype=QType::A; // A record | |
7183 | rr.ttl=86400; // 1 day | |
7184 | rr.content=d_answer; | |
7185 | ||
7186 | d_answer=""; // this was the last answer | |
7187 | ||
7188 | return true; | |
7189 | } | |
7190 | return false; // no more data | |
7191 | } | |
7192 | ||
7193 | private: | |
7194 | string d_answer; | |
7195 | }; | |
7196 | ||
7197 | /* SECOND PART */ | |
7198 | ||
7199 | class RandomFactory : public BackendFactory | |
7200 | { | |
7201 | public: | |
7202 | RandomFactory() : BackendFactory("random") {} | |
7203 | ||
7204 | DNSBackend *make(const string &suffix) | |
7205 | { | |
7206 | return new RandomBackend(); | |
7207 | } | |
7208 | }; | |
7209 | ||
7210 | /* THIRD PART */ | |
7211 | ||
7212 | class RandomLoader | |
7213 | { | |
7214 | public: | |
7215 | Loader() | |
7216 | { | |
7217 | BackendMakers().report(new RandomFactory); | |
7218 | ||
7219 | L<<Logger::Info<<" [RandomBackend] This is the randombackend ("__DATE__", "__TIME__") reporting"<<endl; | |
7220 | } | |
7221 | }; | |
7222 | ||
7223 | static RandomLoader randomloader; | |
7224 | ||
7225 | ||
7226 | This simple backend can be used as an 'overlay'. In other words, it only | |
7227 | knows about a single record, another loaded backend would have to know | |
7228 | about the SOA and NS records and such. But nothing prevents us from | |
7229 | loading it without another backend. | |
7230 | ||
7231 | The first part of the code contains the actual logic and should be pretty | |
7232 | straightforward. The second part is a boilerplate 'factory' class which | |
7233 | PDNS calls to create randombackend instances. Note that a 'suffix' | |
7234 | parameter is passed. Real life backends also declare parameters for the | |
7235 | configuration file; these get the 'suffix' appended to them. Note that the | |
7236 | "random" in the constructor denotes the name by which the backend will be | |
7237 | known. | |
7238 | ||
7239 | The third part registers the RandomFactory with PDNS. This is a simple C++ | |
7240 | trick which makes sure that this function is called on execution of the | |
7241 | binary or when loading the dynamic module. | |
33ccb468 | 7242 | |
7243 | Please note that a RandomBackend is actually in most PDNS releases. By | |
d16e0461 TP |
7244 | default it lives on random.example.com, but you can change that by setting |
7245 | random-hostname. | |
33ccb468 | 7246 | |
7247 | NOTE: this simple backend neglects to handle case properly! For a more | |
d16e0461 TP |
7248 | complete example, see the full pdns-dev distribution as found on the |
7249 | website. | |
7250 | ||
7251 | ---------------------------------------------------------------------- | |
33ccb468 | 7252 | |
d16e0461 | 7253 | C.1.2. Interface definition |
33ccb468 | 7254 | |
d16e0461 | 7255 | Classes: |
33ccb468 | 7256 | |
7257 | Table C-1. DNSResourceRecord class | |
d16e0461 TP |
7258 | |
7259 | +-----------------------------------------------------------------------+ | |
7260 | | QType qtype | QType of this record | | |
7261 | |----------------------+------------------------------------------------| | |
7262 | | string qname | name of this record | | |
7263 | |----------------------+------------------------------------------------| | |
7264 | | string content | ASCII representation of right hand side | | |
7265 | |----------------------+------------------------------------------------| | |
7266 | | u_int16_t priority | priority of an MX record. | | |
7267 | |----------------------+------------------------------------------------| | |
7268 | | u_int32_t ttl | Time To Live of this record | | |
7269 | |----------------------+------------------------------------------------| | |
7270 | | int domain_id | ID of the domain this record belongs to | | |
7271 | |----------------------+------------------------------------------------| | |
7272 | | time_t last_modified | If unzero, last time_t this record was changed | | |
7273 | +-----------------------------------------------------------------------+ | |
33ccb468 | 7274 | |
7275 | Table C-2. SOAData struct | |
d16e0461 TP |
7276 | |
7277 | +------------------------------------------------------------------------+ | |
7278 | | string nameserver | Name of the master nameserver of this zone | | |
7279 | |-----------------------+------------------------------------------------| | |
7280 | | string hostmaster | Hostmaster of this domain. May contain an @ | | |
7281 | |-----------------------+------------------------------------------------| | |
7282 | | u_int32_t serial | Serial number of this zone | | |
7283 | |-----------------------+------------------------------------------------| | |
7284 | | u_int32_t refresh | How often this zone should be refreshed | | |
7285 | |-----------------------+------------------------------------------------| | |
7286 | | u_int32_t retry | How often a failed zone pull should be | | |
7287 | | | retried. | | |
7288 | |-----------------------+------------------------------------------------| | |
7289 | | u_int32_t expire | If zone pulls failed for this long, retire | | |
7290 | | | records | | |
7291 | |-----------------------+------------------------------------------------| | |
7292 | | u_int32_t default_ttl | Difficult | | |
7293 | |-----------------------+------------------------------------------------| | |
7294 | | int domain_id | The ID of the domain within this backend. Must | | |
7295 | | | be filled! | | |
7296 | |-----------------------+------------------------------------------------| | |
7297 | | | Pointer to the backend that feels | | |
7298 | | DNSBackend *db | authoritative for a domain and can act as a | | |
7299 | | | slave | | |
7300 | +------------------------------------------------------------------------+ | |
33ccb468 | 7301 | |
7302 | Methods: | |
7303 | ||
d16e0461 TP |
7304 | void lookup(const QType &qtype, const string &qdomain, DNSPacket *pkt=0, |
7305 | int zoneId=-1) | |
7306 | ||
7307 | This function is used to initiate a straight lookup for a record | |
7308 | of name 'qdomain' and type 'qtype'. A QType can be converted into | |
7309 | an integer by invoking its getCode() method and into a string with | |
7310 | the getCode(). | |
7311 | ||
7312 | The original question may or may not be passed in the pointer p. | |
7313 | If it is, you can retrieve (from 1.99.11 onwards) information | |
7314 | about who asked the question with the getRemote(DNSPacket *) | |
7315 | method. Alternatively, bool getRemote(struct sockaddr *sa, | |
7316 | socklen_t *len) is available. | |
7317 | ||
7318 | Note that qdomain can be of any case and that your backend should | |
7319 | make sure it is in effect case insensitive. Furthermore, the case | |
7320 | of the original question should be retained in answers returned by | |
7321 | get()! | |
7322 | ||
7323 | Finally, the domain_id might also be passed indicating that only | |
7324 | answers from the indicated zone need apply. This can both be used | |
7325 | as a restriction or as a possible speedup, hinting your backend | |
7326 | where the answer might be found. | |
7327 | ||
7328 | If initiated succesfully, as indicated by returning true, answers | |
7329 | should be made available over the get() method. | |
7330 | ||
7331 | Should throw an AhuException if an error occured accessing the | |
7332 | database. Returning otherwise indicates that the query was started | |
7333 | succesfully. If it is known that no data is available, no | |
7334 | exception should be thrown! An exception indicates that the | |
7335 | backend considers itself broken - not that no answers are | |
7336 | available for a question. | |
7337 | ||
7338 | It is legal to return here, and have the first call to get() | |
7339 | return false. This is interpreted as 'no data' | |
33ccb468 | 7340 | |
7341 | bool list(int domain_id) | |
33ccb468 | 7342 | |
d16e0461 TP |
7343 | Initiates a list of the indicated domain. Records should then be |
7344 | made available via the get() method. Need not include the SOA | |
7345 | record. If it is, PDNS will not get confused. | |
7346 | ||
7347 | Should return false if the backend does not consider itself | |
7348 | authoritative for this zone. Should throw an AhuException if an | |
7349 | error occured accessing the database. Returning true indicates | |
7350 | that data is or should be available. | |
33ccb468 | 7351 | |
7352 | bool get(DNSResourceRecord &rr) | |
33ccb468 | 7353 | |
d16e0461 TP |
7354 | Request a DNSResourceRecord from a query started by get() of |
7355 | list(). If this functions returns true, rr has been filled with | |
7356 | data. When it returns false, no more data is available, and rr | |
7357 | does not contain new data. A backend should make sure that it | |
7358 | either fills out all fields of the DNSResourceRecord or resets | |
7359 | them to their default values. | |
33ccb468 | 7360 | |
d16e0461 TP |
7361 | The qname field of the DNSResourceRecord should be filled out with |
7362 | the exact qdomain passed to lookup, preserving its case. So if a | |
7363 | query for 'CaSe.yourdomain.com' comes in and your database | |
7364 | contains dat afor 'case.yourdomain.com', the qname field of rr | |
7365 | should contin 'CaSe.yourdomain.com'! | |
7366 | ||
7367 | Should throw an AhuException in case a database error occurred. | |
33ccb468 | 7368 | |
7369 | bool getSOA(const string &name, SOAData &soadata) | |
d16e0461 TP |
7370 | |
7371 | If the backend considers itself authoritative over domain name, | |
7372 | this method should fill out the passed SOAData structure and | |
7373 | return a positive number. If the backend is functioning correctly, | |
7374 | but does not consider itself authoritative, it should return 0. In | |
7375 | case of errors, an AhuException should be thrown. | |
7376 | ||
7377 | ---------------------------------------------------------------------- | |
33ccb468 | 7378 | |
7379 | C.2. Reporting errors | |
7380 | ||
d16e0461 TP |
7381 | To report errors, the Logger class is available which works mostly like an |
7382 | iostream. Example usage is as shown above in the RandomBackend. Note that | |
7383 | it is very important that each line is ended with endl as your message | |
7384 | won't be visible otherwise. | |
7385 | ||
7386 | To indicate the importance of an error, the standard syslog errorlevels | |
7387 | are available. They can be set by outputting Logger::Critical, | |
7388 | Logger::Error, Logger::Warning, Logger::Notice, Logger::Info or | |
7389 | Logger::Debug to L, in descending order of graveness. | |
33ccb468 | 7390 | |
d16e0461 | 7391 | ---------------------------------------------------------------------- |
33ccb468 | 7392 | |
7393 | C.3. Declaring and reading configuration details | |
7394 | ||
d16e0461 TP |
7395 | It is highly likely that a backend needs configuration details. On launch, |
7396 | these parameters need to be declared with PDNS so it knows it should | |
7397 | accept them in the configuration file and on the commandline. Furthermore, | |
7398 | they will be listed in the output of --help. | |
33ccb468 | 7399 | |
d16e0461 TP |
7400 | Declaring arguments is done by implementing the member function |
7401 | declareArguments() in the factory class of your backend. PDNS will call | |
7402 | this method after launching the backend. | |
33ccb468 | 7403 | |
d16e0461 TP |
7404 | In the declareArguments() method, the function declare() is available. The |
7405 | exact definitions: | |
33ccb468 | 7406 | |
7407 | void declareArguments(const string &suffix="") | |
d16e0461 TP |
7408 | |
7409 | This method is called to allow a backend to register configurable | |
7410 | parameters. The suffix is the sub-name of this module. There is no | |
7411 | need to touch this suffix, just pass it on to the declare method. | |
33ccb468 | 7412 | |
7413 | void declare(const string &suffix, const string ¶m, const string | |
d16e0461 TP |
7414 | &explanation, const string &value) |
7415 | ||
7416 | The suffix is passed to your method, and can be passed on to | |
7417 | declare. param is the name of your parameter. explanation is what | |
7418 | will appear in the output of --help. Furthermore, a default value | |
7419 | can be supplied in the value parameter. | |
33ccb468 | 7420 | |
7421 | A sample implementation: | |
33ccb468 | 7422 | |
d16e0461 TP |
7423 | void declareArguments(const string &suffix) |
7424 | { | |
7425 | declare(suffix,"dbname","Pdns backend database name to connect to","powerdns"); | |
7426 | declare(suffix,"user","Pdns backend user to connect as","powerdns"); | |
7427 | declare(suffix,"host","Pdns backend host to connect to",""); | |
7428 | declare(suffix,"password","Pdns backend password to connect with",""); | |
7429 | } | |
7430 | ||
33ccb468 | 7431 | |
7432 | After the arguments have been declared, they can be accessed from your | |
d16e0461 TP |
7433 | backend using the mustDo(), getArg() and getArgAsNum() methods. The are |
7434 | defined as follows in the DNSBackend class: | |
33ccb468 | 7435 | |
7436 | void setArgPrefix(const string &prefix) | |
d16e0461 TP |
7437 | |
7438 | Must be called before any of the other accessing functions are | |
7439 | used. Typical usage is 'setArgPrefix("mybackend"+suffix)' in the | |
7440 | constructor of a backend. | |
33ccb468 | 7441 | |
7442 | bool mustDo(const string &key) | |
d16e0461 TP |
7443 | |
7444 | Returns true if the variable key is set to anything but 'no'. | |
33ccb468 | 7445 | |
7446 | const string& getArg(const string &key) | |
d16e0461 TP |
7447 | |
7448 | Returns the exact value of a parameter. | |
33ccb468 | 7449 | |
7450 | int getArgAsNum(const string &key) | |
d16e0461 TP |
7451 | |
7452 | Returns the numerical value of a parameter. Uses atoi() internally | |
33ccb468 | 7453 | |
7454 | Sample usage from the BindBackend, using the bind-example-zones and | |
7455 | bind-config parameters. | |
33ccb468 | 7456 | |
d16e0461 TP |
7457 | if(mustDo("example-zones")) { |
7458 | insert(0,"www.example.com","A","1.2.3.4"); | |
7459 | /* ... */ | |
7460 | } | |
7461 | ||
33ccb468 | 7462 | |
d16e0461 TP |
7463 | if(!getArg("config").empty()) { |
7464 | BindParser BP; | |
7465 | ||
7466 | BP.parse(getArg("config")); | |
7467 | } | |
33ccb468 | 7468 | |
d16e0461 | 7469 | |
33ccb468 | 7470 | |
d16e0461 | 7471 | ---------------------------------------------------------------------- |
33ccb468 | 7472 | |
7473 | C.4. Read/write slave-capable backends | |
7474 | ||
d16e0461 TP |
7475 | The backends above are 'natively capable' in that they contain all data |
7476 | relevant for a domain and do not pull in data from other nameservers. To | |
7477 | enable storage of information, a backend must be able to do more. | |
7478 | ||
7479 | Before diving into the details of the implementation some theory is in | |
7480 | order. Slave domains are pulled from the master. PDNS needs to know for | |
7481 | which domains it is to be a slave, and for each slave domain, what the IP | |
7482 | address of the master is. | |
7483 | ||
7484 | A slave zone is pulled from a master, after which it is 'fresh', but this | |
7485 | is only temporary. In the SOA record of a zone there is a field which | |
7486 | specifies the 'refresh' interval. After that interval has elapsed, the | |
7487 | slave nameserver needs to check at the master ff the serial number there | |
7488 | is higher than what is stored in the backend locally. | |
7489 | ||
7490 | If this is the case, PDNS dubs the domain 'stale', and schedules a | |
7491 | transfer of data from the remote. This transfer remains scheduled until | |
7492 | the serial numbers remote and locally are identical again. | |
7493 | ||
7494 | This theory is implemented by the getUnfreshSlaveInfos method, which is | |
7495 | called on all backends periodically. This method fills a vector of | |
7496 | SlaveDomains with domains that are unfresh and possibly stale. | |
7497 | ||
7498 | PDNS then retrieves the SOA of those domains remotely and locally and | |
7499 | creates a list of stale domains. For each of these domains, PDNS starts a | |
7500 | zonetransfer to resynchronise. Because zone transfers can fail, it is | |
7501 | important that the interface to the backend allows for transaction | |
7502 | semantics because a zone might otherwise be left in a halfway updated | |
7503 | situation. | |
7504 | ||
7505 | The following excerpt from the DNSBackend shows the relevant functions: | |
7506 | ||
7507 | class DNSBackend { | |
7508 | public: | |
7509 | /* ... */ | |
7510 | virtual bool getDomainInfo(const string &domain, DomainInfo &di); | |
7511 | virtual bool isMaster(const string &name, const string &ip); | |
7512 | virtual bool startTransaction(const string &qname, int id); | |
7513 | virtual bool commitTransaction(); | |
7514 | virtual bool abortTransaction(); | |
7515 | virtual bool feedRecord(const DNSResourceRecord &rr); | |
7516 | virtual void getUnfreshSlaveInfos(vector<DomainInfo>* domains); | |
7517 | virtual void setFresh(int id); | |
7518 | /* ... */ | |
7519 | } | |
7520 | ||
33ccb468 | 7521 | |
7522 | The mentioned DomainInfo struct looks like this: | |
7523 | ||
7524 | Table C-3. DomainInfo struct | |
d16e0461 TP |
7525 | |
7526 | +------------------------------------------------------------------------+ | |
7527 | | int id | ID of this zone within this backend | | |
7528 | |---------------------------------+--------------------------------------| | |
7529 | | string master | IP address of the master of this | | |
7530 | | | domain, if any | | |
7531 | |---------------------------------+--------------------------------------| | |
7532 | | u_int32_t serial | Serial number of this zone | | |
7533 | |---------------------------------+--------------------------------------| | |
7534 | | u_int32_t notified_serial | Last serial number of this zone that | | |
7535 | | | slaves have seen | | |
7536 | |---------------------------------+--------------------------------------| | |
7537 | | time_t last_check | Last time this zone was checked over | | |
7538 | | | at the master for changes | | |
7539 | |---------------------------------+--------------------------------------| | |
7540 | | enum {Master,Slave,Native} kind | Type of zone | | |
7541 | |---------------------------------+--------------------------------------| | |
7542 | | | Pointer to the backend that feels | | |
7543 | | DNSBackend *backend | authoritative for a domain and can | | |
7544 | | | act as a slave | | |
7545 | +------------------------------------------------------------------------+ | |
33ccb468 | 7546 | |
7547 | These functions all have a default implementation that returns false - | |
7548 | which explains that these methods can be omitted in simple backends. | |
7549 | Furthermore, unlike with simple backends, a slave capable backend must | |
d16e0461 TP |
7550 | make sure that the 'DNSBackend *db' field of the SOAData record is filled |
7551 | out correctly - it is used to determine which backend will house this | |
7552 | zone. | |
33ccb468 | 7553 | |
7554 | bool isMaster(const string &name, const string &ip); | |
d16e0461 TP |
7555 | |
7556 | If a backend considers itself a slave for the domain name and if | |
7557 | the IP address in ip is indeed a master, it should return true. | |
7558 | False otherwise. This is a first line of checks to guard against | |
7559 | reloading a domain unnecessarily. | |
33ccb468 | 7560 | |
7561 | void getUnfreshSlaveInfos(vector<DomainInfo>* domains) | |
d16e0461 TP |
7562 | |
7563 | When called, the backend should examine its list of slave domains | |
7564 | and add any unfresh ones to the domains vector. | |
33ccb468 | 7565 | |
7566 | bool getDomainInfo(const string &name, DomainInfo & di) | |
d16e0461 TP |
7567 | |
7568 | This is like getUnfreshSlaveInfos, but for a specific domain. If | |
7569 | the backend considers itself authoritative for the named zone, di | |
7570 | should be filled out, and 'true' be returned. Otherwise return | |
7571 | false. | |
33ccb468 | 7572 | |
7573 | bool startTransaction(const string &qname, int id) | |
d16e0461 TP |
7574 | |
7575 | When called, the backend should start a transaction that can be | |
7576 | committed or rolled back atomically later on. In SQL terms, this | |
7577 | function should BEGIN a transaction and DELETE all records. | |
33ccb468 | 7578 | |
7579 | bool feedRecord(const DNSResourceRecord &rr) | |
d16e0461 TP |
7580 | |
7581 | Insert this record. | |
33ccb468 | 7582 | |
7583 | bool commitTransaction(); | |
d16e0461 TP |
7584 | |
7585 | Make the changes effective. In SQL terms, execute COMMIT. | |
33ccb468 | 7586 | |
7587 | bool abortTransaction(); | |
d16e0461 TP |
7588 | |
7589 | Abort changes. In SQL terms, execute ABORT. | |
33ccb468 | 7590 | |
7591 | bool setFresh() | |
d16e0461 TP |
7592 | |
7593 | Indicate that a domain has either been updated or refreshed | |
7594 | without the need for a retransfer. This causes the domain to | |
7595 | vanish from the vector modified by getUnfreshSlaveInfos(). | |
33ccb468 | 7596 | |
7597 | PDNS will always call startTransaction() before making calls to | |
d16e0461 TP |
7598 | feedRecord(). Although it is likely that abortTransaction() will be called |
7599 | in case of problems, backends should also be prepared to abort from their | |
7600 | destructor. | |
33ccb468 | 7601 | |
7602 | The actual code in PDNS is currently (1.99.9): | |
33ccb468 | 7603 | |
d16e0461 TP |
7604 | Resolver resolver; |
7605 | resolver.axfr(remote,domain.c_str()); | |
7606 | ||
7607 | db->startTransaction(domain, domain_id); | |
7608 | ||
7609 | L<<Logger::Error<<"AXFR started for '"<<domain<<"'"<<endl; | |
7610 | Resolver::res_t recs; | |
7611 | ||
7612 | while(resolver.axfrChunk(recs)) { | |
7613 | for(Resolver::res_t::const_iterator i=recs.begin();i!=recs.end();++i) { | |
7614 | db->feedRecord(*i); | |
7615 | } | |
7616 | } | |
7617 | db->commitTransaction(); | |
7618 | db->setFresh(domain_id); | |
7619 | L<<Logger::Error<<"AXFR done for '"<<domain<<"'"<<endl; | |
7620 | ||
7621 | ||
7622 | ---------------------------------------------------------------------- | |
7623 | ||
7624 | C.4.1. Supermaster/Superslave capability | |
7625 | ||
7626 | A backend that wants to act as a 'superslave' for a master should | |
7627 | implement the following method: | |
7628 | ||
7629 | class DNSBackend | |
7630 | { | |
7631 | virtual bool superMasterBackend(const string &ip, const string &domain, const vector<DNSResourceRecord>&nsset, string *account, DNSBackend **db) | |
7632 | }; | |
7633 | ||
7634 | ||
7635 | This function gets called with the IP address of the potential | |
7636 | supermaster, the domain it is sending a notification for and the set of NS | |
7637 | records for this domain at that IP address. | |
33ccb468 | 7638 | |
7639 | Using the supplied data, the backend needs to determine if this is a | |
d16e0461 TP |
7640 | bonafide 'supernotification' which should be honoured. If it decides that |
7641 | it should, the supplied pointer to 'account' needs to be filled with the | |
7642 | configured name of the supermaster (if accounting is desired), and the db | |
7643 | needs to be filled with a pointer to your backend. | |
33ccb468 | 7644 | |
d16e0461 TP |
7645 | Supermaster/superslave is a complicated concept, if this is all unclear |
7646 | see Section 13.2.1. | |
7647 | ||
7648 | ---------------------------------------------------------------------- | |
33ccb468 | 7649 | |
7650 | C.5. Read/write master-capable backends | |
7651 | ||
d16e0461 TP |
7652 | In order to be a useful master for a domain, notifies must be sent out |
7653 | whenever a domain is changed. Periodically, PDNS queries backends for | |
7654 | domains that may have changed, and sends out notifications for slave | |
7655 | nameservers. | |
33ccb468 | 7656 | |
d16e0461 TP |
7657 | In order to do so, PDNS calls the getUpdatedMasters() method. Like the |
7658 | getUnfreshSlaveInfos() function mentioned above, this should add changed | |
7659 | domain names to the vector passed. | |
33ccb468 | 7660 | |
d16e0461 | 7661 | The following excerpt from the DNSBackend shows the relevant functions: |
33ccb468 | 7662 | |
d16e0461 TP |
7663 | class DNSBackend { |
7664 | public: | |
7665 | /* ... */ | |
7666 | virtual void getUpdatedMasters(vector<DomainInfo>* domains); | |
7667 | virtual void setNotifed(int id, u_int32_t serial); | |
7668 | /* ... */ | |
7669 | } | |
7670 | ||
33ccb468 | 7671 | |
7672 | These functions all have a default implementation that returns false - | |
7673 | which explains that these methods can be omitted in simple backends. | |
7674 | Furthermore, unlike with simple backends, a slave capable backend must | |
d16e0461 TP |
7675 | make sure that the 'DNSBackend *db' field of the SOAData record is filled |
7676 | out correctly - it is used to determine which backend will house this | |
7677 | zone. | |
33ccb468 | 7678 | |
7679 | void getUpdatedMasters(vector<DomainInfo>* domains) | |
d16e0461 TP |
7680 | |
7681 | When called, the backend should examine its list of master domains | |
7682 | and add any changed ones to the DomainInfo vector | |
33ccb468 | 7683 | |
7684 | bool setNotified(int domain_id, u_int32_t serial) | |
33ccb468 | 7685 | |
d16e0461 TP |
7686 | Indicate that notifications have been queued for this domain and |
7687 | that it need not be considered 'updated' anymore | |
7688 | ||
7689 | ---------------------------------------------------------------------- | |
7690 | ||
7691 | Appendix D. Compiling PowerDNS | |
33ccb468 | 7692 | |
7693 | D.1. Compiling PowerDNS on Unix | |
7694 | ||
d16e0461 TP |
7695 | Note For now, see the Open Source PowerDNS site. ./configure ; make ; make |
7696 | install will do The Right Thing for most people. | |
7697 | ||
7698 | PowerDNS can becompiled with modules built in, or with modules designed to | |
7699 | be loaded at runtime. All that is configured before compiling using the | |
7700 | well known autoconf/automake system. | |
7701 | ||
7702 | To compile in modules, specify them as --with-modules="mod1 mod2 mod3", | |
7703 | substituting the desired module names. Each backend has a module name in | |
7704 | the table at the beginning of its section. | |
7705 | ||
7706 | To compile a module for inclusion at runtime, which is great if you are a | |
7707 | unix vendor, use --with-dynmodules="mod1 mod2 mod3". These modules then | |
7708 | end up as .so files in the compiled libdir. | |
7709 | ||
7710 | ---------------------------------------------------------------------- | |
7711 | ||
7712 | D.1.1. AIX | |
33ccb468 | 7713 | |
d16e0461 TP |
7714 | Known to compile with gcc, but only since 2.9.8. AIX lacks POSIX |
7715 | semaphores so they need to be emulated, as with MacOS X. | |
33ccb468 | 7716 | |
d16e0461 | 7717 | ---------------------------------------------------------------------- |
33ccb468 | 7718 | |
d16e0461 | 7719 | D.1.2. FreeBSD |
33ccb468 | 7720 | |
d16e0461 TP |
7721 | Works fine, but use gmake. Pipe backend is currently broken, for reasons, |
7722 | see Section A.1. Due to the threading model of FreeBSD, PowerDNS does not | |
7723 | benefit from additional CPUs on the system. | |
33ccb468 | 7724 | |
d16e0461 | 7725 | ---------------------------------------------------------------------- |
33ccb468 | 7726 | |
d16e0461 | 7727 | D.1.3. Linux |
33ccb468 | 7728 | |
d16e0461 TP |
7729 | Linux is probably the best supported platform as most of the main coders |
7730 | are Linux users. The static DEB distribution is known to have problems on | |
7731 | Debian 'Sid', but that doesn't matter as PowerDNS is a native part of | |
7732 | Debian 'Sid'. Just apt-get! | |
33ccb468 | 7733 | |
d16e0461 | 7734 | ---------------------------------------------------------------------- |
33ccb468 | 7735 | |
d16e0461 | 7736 | D.1.4. MacOS X |
33ccb468 | 7737 | |
d16e0461 TP |
7738 | Did compile at one point but maintenance has lapsed. Let us know if you |
7739 | can provide us with a login on MacOS X or if you want to help. | |
33ccb468 | 7740 | |
d16e0461 | 7741 | ---------------------------------------------------------------------- |
33ccb468 | 7742 | |
d16e0461 TP |
7743 | D.1.5. OpenBSD |
7744 | ||
fc2fb8ea AG |
7745 | Compiles but then does not work very well. We hear that it may work with |
7746 | more recent versions of gcc, please let us know on | |
7747 | <pdns-dev@mailman.powerdns.com>. | |
d16e0461 TP |
7748 | |
7749 | ---------------------------------------------------------------------- | |
7750 | ||
7751 | D.1.6. Solaris | |
7752 | ||
7753 | Solaris 7 is supported, but only just. AAAA records do not work on Solaris | |
7754 | 7. Solaris 8 and 9 work fine. The 'Sunpro' compiler has not been tried but | |
7755 | is reported to be lacking large parts of the Standard Template Library, | |
7756 | which PowerDNS relies on heavily. Use gcc and gmake (if available). | |
7757 | Regular Solaris make has some issues with some PowerDNS Makefile | |
7758 | constructs. | |
7759 | ||
fc2fb8ea AG |
7760 | When compiling, make sure that you have /usr/ccs/bin in your path. |
7761 | Furthermore, with some versions of MySQL, you may have to add | |
7762 | "LDFLAGS=-lz" before ./configure. | |
7763 | ||
d16e0461 | 7764 | ---------------------------------------------------------------------- |
33ccb468 | 7765 | |
7766 | D.2. Compiling PowerDNS on Windows | |
7767 | ||
d16e0461 TP |
7768 | By Michel Stol (<michel@powerdns.com>). |
7769 | ||
7770 | ---------------------------------------------------------------------- | |
33ccb468 | 7771 | |
d16e0461 | 7772 | D.2.1. Assumptions |
33ccb468 | 7773 | |
d16e0461 | 7774 | I will assume these things from you: |
33ccb468 | 7775 | |
7776 | You have the PowerDNS sources. | |
33ccb468 | 7777 | |
d16e0461 TP |
7778 | There's not much to compile without the source files, eh? :) |
7779 | ||
7780 | You are using Microsoft Visual C++. If you get it to compile using a free | |
7781 | compiler, please let us know! | |
7782 | ||
7783 | From the day that we began porting the UNIX PowerDNS sources to | |
7784 | Microsoft Windows we used Microsoft Visual C++ as our development | |
7785 | environment of choice. | |
33ccb468 | 7786 | |
d16e0461 TP |
7787 | We used Visual C++ 6.0 to compile all sources (both standard |
7788 | version and SP5). Other versions (including Visual C++ .NET) are | |
7789 | untested. | |
33ccb468 | 7790 | |
7791 | You are using Microsoft Windows NT, 2000 or XP | |
33ccb468 | 7792 | |
d16e0461 TP |
7793 | I will assume that the system where you want to compile the |
7794 | sources on is running Microsoft Windows NT, 2000 or XP. These are | |
7795 | the operating systems that where found running PowerDNS for | |
7796 | Windows. | |
33ccb468 | 7797 | |
d16e0461 TP |
7798 | Note You probably can compile the sources on other Windows |
7799 | versions too, but that is currently untested. | |
33ccb468 | 7800 | |
7801 | You are using an English Windows version. | |
33ccb468 | 7802 | |
d16e0461 TP |
7803 | Troughout this document I will use the English names for menu |
7804 | items, names etc., so if you are running a non-English Windows or | |
7805 | MSVC version you have to translate those things yourself. But I | |
7806 | don't think that would be a big problem. | |
33ccb468 | 7807 | |
d16e0461 | 7808 | ---------------------------------------------------------------------- |
33ccb468 | 7809 | |
d16e0461 | 7810 | D.2.2. Prequisites |
33ccb468 | 7811 | |
d16e0461 TP |
7812 | Although we tried to keep PowerDNS for Windows' dependencies down to a |
7813 | minimum, you will still need some programs and libraries to be able to | |
7814 | compile the sources. | |
33ccb468 | 7815 | |
d16e0461 | 7816 | ---------------------------------------------------------------------- |
33ccb468 | 7817 | |
d16e0461 | 7818 | D.2.2.1. pthreads for Windows |
33ccb468 | 7819 | |
d16e0461 TP |
7820 | The pthreads for Windows library is a Windows implementation of the POSIX |
7821 | threads specification, which is used a lot in UNIX programs. | |
33ccb468 | 7822 | |
d16e0461 TP |
7823 | PowerDNS uses pthreads too, and to ease the porting process we decided not |
7824 | to reinvent the wheel, but to use pthreads for Windows instead. | |
33ccb468 | 7825 | |
d16e0461 | 7826 | ---------------------------------------------------------------------- |
33ccb468 | 7827 | |
d16e0461 | 7828 | D.2.2.1.1. Getting pthreads for Windows |
33ccb468 | 7829 | |
d16e0461 TP |
7830 | Pthreads for Windows is available from anonymous ftp at |
7831 | ftp://sources.redhat.com/pub/pthreads-win32/. You should download the | |
7832 | latest pthreads-YYYY-MM-DD.exe file. | |
33ccb468 | 7833 | |
d16e0461 TP |
7834 | Note PowerDNS for Windows was tested with the snapshot of 2002-03-02 of |
7835 | the library. | |
33ccb468 | 7836 | |
d16e0461 TP |
7837 | For more information you can visit the pthreads for Windows homepage at |
7838 | http://sources.redhat.com/pthreads-win32/ | |
33ccb468 | 7839 | |
d16e0461 | 7840 | ---------------------------------------------------------------------- |
33ccb468 | 7841 | |
d16e0461 | 7842 | D.2.2.2. Installing pthreads for Windows |
33ccb468 | 7843 | |
d16e0461 TP |
7844 | To install the pthreads for Windows library you have to locate your |
7845 | pthreads-YYYY-MM-DD.exe file and start it. | |
33ccb468 | 7846 | |
d16e0461 TP |
7847 | After starting the executable a self-extractor dialog will show up where |
7848 | you can specify where to extract the contents of the file. When you | |
7849 | selected a location you can press the Extract button to extract all | |
7850 | content to the target directory. | |
33ccb468 | 7851 | |
d16e0461 TP |
7852 | The library is now installed, we still have to tell Visual C++ where it's |
7853 | located though, more on that later. | |
33ccb468 | 7854 | |
d16e0461 | 7855 | ---------------------------------------------------------------------- |
33ccb468 | 7856 | |
d16e0461 | 7857 | D.2.3. Nullsoft Installer |
33ccb468 | 7858 | |
d16e0461 TP |
7859 | For our installation program we used Nullsoft's Installer System (NSIS). |
7860 | We used NSIS because it's easy to use, versatile and free (and it uses | |
7861 | SuperPiMP(TM) technology, but they refuse to tell us what it is ;)). If | |
7862 | the name Nullsoft rings a bell, it's because they're the guys who made | |
7863 | winamp. | |
33ccb468 | 7864 | |
d16e0461 | 7865 | ---------------------------------------------------------------------- |
33ccb468 | 7866 | |
d16e0461 | 7867 | D.2.3.1. Getting the Nullsoft Installer |
33ccb468 | 7868 | |
d16e0461 TP |
7869 | The Nullsoft Installer can be downloaded at their website, which is |
7870 | located at http://www.nullsoft.com/free/nsis/. The file that you should | |
7871 | download is called nsisXXX.exe (where XXX is the latest version). | |
33ccb468 | 7872 | |
d16e0461 | 7873 | Note You can find the NSIS documentation at that website too. |
33ccb468 | 7874 | |
d16e0461 | 7875 | ---------------------------------------------------------------------- |
33ccb468 | 7876 | |
d16e0461 | 7877 | D.2.3.2. Installing the Nullsoft Installer |
33ccb468 | 7878 | |
d16e0461 TP |
7879 | Installing NSIS is easy. All there is to it is locating the installer and |
7880 | execute it. Then just follow the installation steps. | |
33ccb468 | 7881 | |
d16e0461 | 7882 | ---------------------------------------------------------------------- |
33ccb468 | 7883 | |
d16e0461 TP |
7884 | D.2.4. Setting up the build-environment |
7885 | ||
7886 | Before starting Microsoft Visual C++ and compile PowerDNS for Windows, you | |
7887 | first have to set up your build environment. | |
7888 | ||
7889 | ---------------------------------------------------------------------- | |
7890 | ||
7891 | D.2.4.1. Make Microsoft Visual C++ recognize *.cc and *.hh (optional) | |
7892 | ||
7893 | All PowerDNS source files are in the form name.cc, and all header files in | |
7894 | the form name.hh. These extensions aren't recognized by MSVC by default, | |
7895 | so you might want to change that first. | |
7896 | ||
7897 | Note Only perform this step if you want to be able to edit the *.cc and | |
7898 | *.hh files in MSVC. | |
7899 | ||
7900 | Caution If you decide to perform this step, remember that it requires | |
7901 | modification of the Windows registry, always make a backup before | |
7902 | modifying! | |
33ccb468 | 7903 | |
7904 | Ok, after that word of caution we can now proceed. You have to follow | |
7905 | these steps: | |
7906 | ||
d16e0461 TP |
7907 | 1. Start the registry editor by entering regedit.exe in the run prompt |
7908 | (Start->Run...). | |
7909 | ||
7910 | 2. Right click on HKEY_CLASSES_ROOT and select New->Key. A new key will | |
7911 | appear, change that key to ".cc", then change the default value to | |
7912 | "cppfile" | |
7913 | ||
33ccb468 | 7914 | Then perform the same step for ".hh" (use "hfile" instead of |
7915 | "cppfile"). | |
d16e0461 | 7916 | |
33ccb468 | 7917 | 3. Go to HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0\Build |
d16e0461 TP |
7918 | System\Components\Platforms\Win32 (x86)\Tools\32-bit C/C++ Compiler |
7919 | for 80x86. And add ";*.cc" to the Input_Spec value (so that it becomes | |
7920 | "*.c;*.cpp;*.cxx;*.cc"). | |
33ccb468 | 7921 | |
d16e0461 TP |
7922 | Note If you happen to use another platform (like alpha) to |
7923 | compile the sources, you have to do the step above for | |
7924 | that platform. | |
33ccb468 | 7925 | |
d16e0461 TP |
7926 | 4. Go to HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0\Search. And |
7927 | add ";*.cc;*.hh" to the FIF_Filter value (so that it becomes | |
33ccb468 | 7928 | "*.c;*.cpp;*.cxx;*.tli;*.h;*.tlh;*.inl;*.rc;*.cc;*.hh"). |
d16e0461 TP |
7929 | |
7930 | 5. Finally change HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0\Text | |
33ccb468 | 7931 | Editor\Tabs/Language Settings\C/C++. And add ";cc;hh" to the |
7932 | FileExtensions value (so that it becomes | |
7933 | "cpp;cxx;c;h;hxx;hpp;inl;tlh;tli;rc;rc2;hh;cc"). | |
d16e0461 | 7934 | |
33ccb468 | 7935 | 6. Close the registry editor. |
7936 | ||
7937 | Now should MSVC properly recognize the files as being C++. | |
33ccb468 | 7938 | |
d16e0461 TP |
7939 | ---------------------------------------------------------------------- |
7940 | ||
7941 | D.2.4.2. Setting Microsoft Visual C++'s directories | |
7942 | ||
7943 | MSVC needs to locate some include files, libraries and executables when it | |
7944 | has to build PowerDNS for Windows. We are now going to tell MSVC where to | |
7945 | find those. | |
7946 | ||
7947 | To enter the directory dialog you have to go to | |
7948 | Tools->Options...->Directories. | |
7949 | ||
7950 | ---------------------------------------------------------------------- | |
7951 | ||
7952 | D.2.4.2.1. Setting the pthreads directories | |
33ccb468 | 7953 | |
d16e0461 TP |
7954 | When you are in the directory dialog you can add the pthreads for Windows |
7955 | directory. | |
33ccb468 | 7956 | |
d16e0461 TP |
7957 | First add the include directory, to do this you have to select Include |
7958 | files from the Show directories for: combobox. Then press the New button | |
7959 | and browse to the include directory of pthreads (ie. C:\pthreads\include). | |
33ccb468 | 7960 | |
d16e0461 TP |
7961 | Then switch to Library files and add the library directory (ie. |
7962 | C:\pthreads\lib) using the same method as above. | |
33ccb468 | 7963 | |
d16e0461 | 7964 | ---------------------------------------------------------------------- |
33ccb468 | 7965 | |
d16e0461 | 7966 | D.2.4.2.2. Setting the Nullsoft Installer directory |
33ccb468 | 7967 | |
d16e0461 TP |
7968 | While still being in the directory dialog, switch to Executable files and |
7969 | add the Nullsoft Installer directory (ie. C:\Program Files\NSIS) to the | |
7970 | list. | |
33ccb468 | 7971 | |
d16e0461 | 7972 | ---------------------------------------------------------------------- |
33ccb468 | 7973 | |
d16e0461 | 7974 | D.2.5. Compilation |
33ccb468 | 7975 | |
d16e0461 TP |
7976 | Finally, after all the reading, installing and configuring we are ready to |
7977 | start compiling PowerDNS for Windows. | |
33ccb468 | 7978 | |
d16e0461 | 7979 | ---------------------------------------------------------------------- |
33ccb468 | 7980 | |
d16e0461 | 7981 | D.2.5.1. Starting the compilation |
33ccb468 | 7982 | |
d16e0461 TP |
7983 | To start the compilation you first have to open the PowerDNS workspace |
7984 | (powerdns.dsw) using explorer or from the File->Open Workspace... menu in | |
7985 | MSVC. | |
33ccb468 | 7986 | |
d16e0461 TP |
7987 | After you opened the workspace you can start compiling. Check all the |
7988 | checkboxes in the Build->Batch Build... menu and press the Build button. | |
33ccb468 | 7989 | |
d16e0461 TP |
7990 | Now cross your fingers and go make some coffee or tea while compiling |
7991 | PowerDNS for Windows. :) | |
33ccb468 | 7992 | |
d16e0461 | 7993 | ---------------------------------------------------------------------- |
33ccb468 | 7994 | |
d16e0461 | 7995 | D.2.5.2. Yay! It compiled |
33ccb468 | 7996 | |
d16e0461 | 7997 | Congratulations, you have now compiled PowerDNS for Windows! |
33ccb468 | 7998 | |
d16e0461 TP |
7999 | All the release builds of the binaries are in the Release directory |
8000 | (including the generated installer). The debug builds are in the, guess | |
8001 | what, Debug directory. | |
33ccb468 | 8002 | |
d16e0461 TP |
8003 | Now you can start installing PowerDNS, but that's beyond the scope of this |
8004 | document. See the online documentation for more information about that. | |
33ccb468 | 8005 | |
d16e0461 | 8006 | ---------------------------------------------------------------------- |
33ccb468 | 8007 | |
d16e0461 | 8008 | D.2.5.3. What if it went wrong? |
33ccb468 | 8009 | |
d16e0461 TP |
8010 | If the compilation fails, then try reading this article again, and again |
8011 | to see if you did something wrong. | |
33ccb468 | 8012 | |
d16e0461 TP |
8013 | If you are pretty sure that it's a bug, either in the PowerDNS sources, |
8014 | the build system or in this article, then please send an e-mail to | |
8015 | <pdns-dev@mailman.powerdns.com> describing your problem. We will then try | |
8016 | to fix it. | |
33ccb468 | 8017 | |
d16e0461 TP |
8018 | ---------------------------------------------------------------------- |
8019 | ||
8020 | D.2.6. Miscellaneous | |
8021 | ||
8022 | Some miscellaneous information. | |
8023 | ||
8024 | ---------------------------------------------------------------------- | |
8025 | ||
8026 | D.2.6.1. Credits | |
33ccb468 | 8027 | |
8028 | Michel Stol would like to thank these people: | |
8029 | ||
8030 | Bert Hubert | |
d16e0461 TP |
8031 | |
8032 | For writing the wonderfull PowerDNS software and learning me stuff | |
8033 | that I'd otherwise never had learned. | |
33ccb468 | 8034 | |
8035 | PowerDNS B.V. | |
d16e0461 TP |
8036 | |
8037 | For being great colleagues. | |
33ccb468 | 8038 | |
8039 | The pthreads-win32 crew (see the pthreads-win32 CONTRIBUTORS file). | |
d16e0461 TP |
8040 | |
8041 | For easing our porting process by writing a great Windows | |
8042 | implementation of pthreads. | |
33ccb468 | 8043 | |
8044 | The guys over at Nullsoft. | |
d16e0461 TP |
8045 | |
8046 | For creating the Nullsoft Installer System (NSIS), and Winamp, the | |
8047 | program we use every day to make a lot of noise in the office. | |
8048 | ||
8049 | ---------------------------------------------------------------------- | |
8050 | ||
8051 | D.2.6.2. Contact information | |
8052 | ||
8053 | If you have a comment, or a bug report concerning either this document or | |
8054 | the PowerDNS sources you can contact <pdns-dev@mailman.powerdns.com> | |
8055 | ||
8056 | For general information about PowerDNS, the pdns server, express, | |
8057 | documentation etc. I advice you to visit http://www.powerdns.com/ | |
8058 | ||
8059 | If you are interested in buying PowerDNS you can send a mail to | |
8060 | <sales@powerdns.com> or you can visit the PowerDNS website at | |
8061 | http://www.powerdns.com/pdns/ | |
8062 | ||
8063 | If you want to praise my work, ask me to marry you, deposit $1.000.000 on | |
8064 | my bank account or flame me to death, then you can mail me at | |
8065 | <michel@powerdns.com> :) | |
8066 | ||
8067 | ---------------------------------------------------------------------- | |
8068 | ||
8069 | D.2.6.3. Legal information | |
8070 | ||
8071 | Microsoft, Visual C++, Windows, Windows NT, Windows 2000, Windows XP and | |
8072 | Win32 are either registered trademarks or trademarks of Microsoft | |
8073 | Corporation in the U.S.A. and/or other countries. | |
8074 | ||
8075 | Other product and company names mentioned herein may be the trademarks of | |
8076 | their respective owners. | |
8077 | ||
8078 | ---------------------------------------------------------------------- | |
8079 | ||
8080 | Appendix E. PowerDNS license (GNU General Public License version 2) | |
8081 | ||
8082 | GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION | |
8083 | AND MODIFICATION | |
8084 | ||
8085 | \r 0. This License applies to any program or other work which contains a | |
8086 | notice placed by the copyright holder saying it may be distributed under | |
8087 | the terms of this General Public License. The "Program", below, refers to | |
8088 | any such program or work, and a "work based on the Program" means either | |
8089 | the Program or any derivative work under copyright law: that is to say, a | |
8090 | work containing the Program or a portion of it, either verbatim or with | |
8091 | modifications and/or translated into another language. (Hereinafter, | |
8092 | translation is included without limitation in the term "modification".) | |
8093 | Each licensee is addressed as "you". | |
8094 | ||
8095 | Activities other than copying, distribution and modification are not | |
8096 | covered by this License; they are outside its scope. The act of running | |
8097 | the Program is not restricted, and the output from the Program is covered | |
8098 | only if its contents constitute a work based on the Program (independent | |
8099 | of having been made by running the Program). Whether that is true depends | |
8100 | on what the Program does. | |
8101 | ||
8102 | 1. You may copy and distribute verbatim copies of the Program's source | |
8103 | code as you receive it, in any medium, provided that you conspicuously and | |
8104 | appropriately publish on each copy an appropriate copyright notice and | |
8105 | disclaimer of warranty; keep intact all the notices that refer to this | |
8106 | License and to the absence of any warranty; and give any other recipients | |
8107 | of the Program a copy of this License along with the Program. | |
8108 | ||
8109 | You may charge a fee for the physical act of transferring a copy, and you | |
8110 | may at your option offer warranty protection in exchange for a fee. | |
8111 | ||
8112 | 2. You may modify your copy or copies of the Program or any portion of it, | |
8113 | thus forming a work based on the Program, and copy and distribute such | |
8114 | modifications or work under the terms of Section 1 above, provided that | |
8115 | you also meet all of these conditions: | |
8116 | ||
8117 | a) You must cause the modified files to carry prominent notices stating | |
8118 | that you changed the files and the date of any change. | |
8119 | ||
8120 | b) You must cause any work that you distribute or publish, that in whole | |
8121 | or in part contains or is derived from the Program or any part thereof, to | |
8122 | be licensed as a whole at no charge to all third parties under the terms | |
8123 | of this License.\r | |
8124 | ||
8125 | c) If the modified program normally reads commands interactively when run, | |
8126 | you must cause it, when started running for such interactive use in the | |
8127 | most ordinary way, to print or display an announcement including an | |
8128 | appropriate copyright notice and a notice that there is no warranty (or | |
8129 | else, saying that you provide a warranty) and that users may redistribute | |
8130 | the program under these conditions, and telling the user how to view a | |
8131 | copy of this License. (Exception: if the Program itself is interactive but | |
8132 | does not normally print such an announcement, your work based on the | |
8133 | Program is not required to print an announcement.) These requirements | |
8134 | apply to the modified work as a whole. If identifiable sections of that | |
8135 | work are not derived from the Program, and can be reasonably considered | |
8136 | independent and separate works in themselves, then this License, and its | |
8137 | terms, do not apply to those sections when you distribute them as separate | |
8138 | works. But when you distribute the same sections as part of a whole which | |
8139 | is a work based on the Program, the distribution of the whole must be on | |
8140 | the terms of this License, whose permissions for other licensees extend to | |
8141 | the entire whole, and thus to each and every part regardless of who wrote | |
8142 | it. | |
8143 | ||
8144 | Thus, it is not the intent of this section to claim rights or contest your | |
8145 | rights to work written entirely by you; rather, the intent is to exercise | |
8146 | the right to control the distribution of derivative or collective works | |
8147 | based on the Program. | |
8148 | ||
8149 | In addition, mere aggregation of another work not based on the Program | |
8150 | with the Program (or with a work based on the Program) on a volume of a | |
8151 | storage or distribution medium does not bring the other work under the | |
8152 | scope of this License. | |
8153 | ||
8154 | 3. You may copy and distribute the Program (or a work based on it, under | |
8155 | Section 2) in object code or executable form under the terms of Sections 1 | |
8156 | and 2 above provided that you also do one of the following: | |
8157 | ||
8158 | a) Accompany it with the complete corresponding machine-readable source | |
8159 | code, which must be distributed under the terms of Sections 1 and 2 above | |
8160 | on a medium customarily used for software interchange; or, | |
8161 | ||
8162 | b) Accompany it with a written offer, valid for at least three years, to | |
8163 | give any third party, for a charge no more than your cost of physically | |
8164 | performing source distribution, a complete machine-readable copy of the | |
8165 | corresponding source code, to be distributed under the terms of Sections 1 | |
8166 | and 2 above on a medium customarily used for software interchange; or, | |
8167 | ||
8168 | \r c) Accompany it with the information you received as to the offer to | |
8169 | distribute corresponding source code. (This alternative is allowed only | |
8170 | for noncommercial distribution and only if you received the program in | |
8171 | object code or executable form with such an offer, in accord with | |
8172 | Subsection b above.) | |
8173 | ||
8174 | The source code for a work means the preferred form of the work for making | |
8175 | modifications to it. For an executable work, complete source code means | |
8176 | all the source code for all modules it contains, plus any associated | |
8177 | interface definition files, plus the scripts used to control compilation | |
8178 | and installation of the executable. However, as a special exception, the | |
8179 | source code distributed need not include anything that is normally | |
8180 | distributed (in either source or binary form) with the major components | |
8181 | (compiler, kernel, and so on) of the operating system on which the | |
8182 | executable runs, unless that component itself accompanies the executable. | |
8183 | ||
8184 | If distribution of executable or object code is made by offering access to | |
8185 | copy from a designated place, then offering equivalent access to copy the | |
8186 | source code from the same place counts as distribution of the source code, | |
8187 | even though third parties are not compelled to copy the source along with | |
8188 | the object code. 4. You may not copy, modify, sublicense, or distribute | |
8189 | the Program except as expressly provided under this License. Any attempt | |
8190 | otherwise to copy, modify, sublicense or distribute the Program is void, | |
8191 | and will automatically terminate your rights under this License. However, | |
8192 | parties who have received copies, or rights, from you under this License | |
8193 | will not have their licenses terminated so long as such parties remain in | |
8194 | full compliance. | |
8195 | ||
8196 | 5. You are not required to accept this License, since you have not signed | |
8197 | it. However, nothing else grants you permission to modify or distribute | |
8198 | the Program or its derivative works. These actions are prohibited by law | |
8199 | if you do not accept this License. Therefore, by modifying or distributing | |
8200 | the Program (or any work based on the Program), you indicate your | |
8201 | acceptance of this License to do so, and all its terms and conditions for | |
8202 | copying, distributing or modifying the Program or works based on it. | |
8203 | ||
8204 | 6. Each time you redistribute the Program (or any work based on the | |
8205 | Program), the recipient automatically receives a license from the original | |
8206 | licensor to copy, distribute or modify the Program subject to these terms | |
8207 | and conditions. You may not impose any further restrictions on the | |
8208 | recipients' exercise of the rights granted herein. You are not responsible | |
8209 | for enforcing compliance by third parties to this License. | |
8210 | ||
8211 | 7. If, as a consequence of a court judgment or allegation of patent | |
8212 | infringement or for any other reason (not limited to patent issues), | |
8213 | conditions are imposed on you (whether by court order, agreement or | |
8214 | otherwise) that contradict the conditions of this License, they do not | |
8215 | excuse you from the conditions of this License. If you cannot distribute | |
8216 | so as to satisfy simultaneously your obligations under this License and | |
8217 | any other pertinent obligations, then as a consequence you may not | |
8218 | distribute the Program at all. For example, if a patent license would not | |
8219 | permit royalty-free redistribution of the Program by all those who receive | |
8220 | copies directly or indirectly through you, then the only way you could | |
8221 | satisfy both it and this License would be to refrain entirely from | |
8222 | distribution of the Program. | |
8223 | ||
8224 | If any portion of this section is held invalid or unenforceable under any | |
8225 | particular circumstance, the balance of the section is intended to apply | |
8226 | and the section as a whole is intended to apply in other circumstances.\r | |
8227 | ||
8228 | It is not the purpose of this section to induce you to infringe any | |
8229 | patents or other property right claims or to contest validity of any such | |
8230 | claims; this section has the sole purpose of protecting the integrity of | |
8231 | the free software distribution system, which is implemented by public | |
8232 | license practices. Many people have made generous contributions to the | |
8233 | wide range of software distributed through that system in reliance on | |
8234 | consistent application of that system; it is up to the author/donor to | |
8235 | decide if he or she is willing to distribute software through any other | |
8236 | system and a licensee cannot impose that choice. | |
8237 | ||
8238 | This section is intended to make thoroughly clear what is believed to be a | |
8239 | consequence of the rest of this License. 8. If the distribution and/or use | |
8240 | of the Program is restricted in certain countries either by patents or by | |
8241 | copyrighted interfaces, the original copyright holder who places the | |
8242 | Program under this License may add an explicit geographical distribution | |
8243 | limitation excluding those countries, so that distribution is permitted | |
8244 | only in or among countries not thus excluded. In such case, this License | |
8245 | incorporates the limitation as if written in the body of this License. | |
8246 | ||
8247 | 9. The Free Software Foundation may publish revised and/or new versions of | |
8248 | the General Public License from time to time. Such new versions will be | |
8249 | similar in spirit to the present version, but may differ in detail to | |
8250 | address new problems or concerns. | |
8251 | ||
8252 | Each version is given a distinguishing version number. If the Program | |
8253 | specifies a version number of this License which applies to it and "any | |
8254 | later version", you have the option of following the terms and conditions | |
8255 | either of that version or of any later version published by the Free | |
8256 | Software Foundation. If the Program does not specify a version number of | |
8257 | this License, you may choose any version ever published by the Free | |
8258 | Software Foundation. | |
8259 | ||
8260 | 10. If you wish to incorporate parts of the Program into other free | |
8261 | programs whose distribution conditions are different, write to the author | |
8262 | to ask for permission. For software which is copyrighted by the Free | |
8263 | Software Foundation, write to the Free Software Foundation; we sometimes | |
8264 | make exceptions for this. Our decision will be guided by the two goals of | |
8265 | preserving the free status of all derivatives of our free software and of | |
8266 | promoting the sharing and reuse of software generally. | |
8267 | ||
8268 | NO WARRANTY | |
8269 | ||
8270 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY | |
8271 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN | |
8272 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES | |
8273 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED | |
8274 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | |
8275 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS | |
8276 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE | |
8277 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, | |
8278 | REPAIR OR CORRECTION.\r | |
8279 | ||
8280 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | |
8281 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR | |
8282 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, | |
8283 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES | |
8284 | ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT | |
8285 | LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES | |
8286 | SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE | |
8287 | WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN | |
8288 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. | |
8289 | ||
8290 | END OF TERMS AND CONDITIONS |