]> git.pld-linux.org Git - packages/pdns.git/blame - pdns.txt
- no longer requires libpq++-static
[packages/pdns.git] / pdns.txt
CommitLineData
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
24 1.3.1. Version 2.9.13
25
26 1.3.2. Version 2.9.12
27
28 1.3.3. Version 2.9.11
29
30 1.3.4. Version 2.9.10
31
32 1.3.5. Version 2.9.8
33
34 1.3.6. Version 2.9.7
35
36 1.3.7. Version 2.9.6
37
38 1.3.8. Version 2.9.5
39
40 1.3.9. Version 2.9.4
41
42 1.3.10. Version 2.9.3a
43
44 1.3.11. Version 2.9.2
45
46 1.3.12. Version 2.9.1
47
48 1.3.13. Version 2.9
49
50 1.3.14. Version 2.8
51
52 1.3.15. Version 2.7 and 2.7.1
53
54 1.3.16. Version 2.6.1
55
56 1.3.17. Version 2.6
57
58 1.3.18. Version 2.5.1
59
60 1.3.19. Version 2.5
61
62 1.3.20. Version 2.4
63
64 1.3.21. Version 2.3
65
66 1.3.22. Version 2.2
67
68 1.3.23. Version 2.1
69
70 1.3.24. Version 2.0.1
71
72 1.3.25. Version 2.0
73
74 1.3.26. Version 2.0 Release Candidate 2
75
76 1.3.27. Version 2.0 Release Candidate 1
77
78 1.3.28. Version 1.99.12 Prerelease
79
80 1.3.29. Version 1.99.11 Prerelease
81
82 1.3.30. Version 1.99.10 Prerelease
83
84 1.3.31. Version 1.99.9 Early Access Prerelease
85
86 1.3.32. Version 1.99.8 Early Access Prerelease
87
88 1.3.33. Version 1.99.7 Early Access Prerelease
89
90 1.3.34. Version 1.99.6 Early Access Prerelease
91
92 1.3.35. Version 1.99.5 Early Access Prerelease
93
94 1.3.36. Version 1.99.4 Early Access Prerelease
95
96 1.3.37. Version 1.99.3 Early Access Prerelease
97
98 1.3.38. Version 1.99.2 Early Access Prerelease
99
100 1.3.39. Version 1.99.1 Early Access Prerelease
101
102 1.4. Security
103
104 1.5. Acknowledgements
105
106 2. Installing on Unix
107
108 2.1. Possible problems at this point
109
110 2.2. Testing your install
111
112 2.2.1. Typical errors
113
114 2.3. Running PDNS on unix
115
116 3. Installing on Microsoft Windows
117
118 3.1. Configuring PDNS on Microsoft Windows
119
120 3.2. Running PDNS on Microsoft Windows
121
122 4. Configure database connectivity
123
124 4.1. Configuring MySQL
125
126 4.1.1. Common problems
127
128 5. Dynamic resolution using the PipeBackend
129
130 5.1. Deploying the PipeBackend with the BindBackend
131
132 6. Logging & Monitoring PDNS performance
133
134 6.1. Webserver
135
136 6.2. Via init.d commands
137
138 6.3. Operational logging using syslog
139
140 7. Security settings & considerations
141
142 7.1. Settings
143
144 7.1.1. Running as a less privileged identity
145
146 7.1.2. Jailing the process in a chroot
147
148 7.2. Considerations
149
150 8. Virtual hosting
151
152 9. Performance related settings
153
154 9.1. Packet Cache
155
156 9.2. Query Cache
157
158 10. Migrating to PDNS
159
160 10.1. Zone2sql
161
162 11. Recursion
163
164 11.1. Details
165
166 12. PowerDNS resolver/recursing nameserver
167
168 12.1. pdns_recursor settings
169
170 12.1.1. Verisign weirdness
171
172 12.2. Details
173
174 12.3. Statistics
175
176 13. Master/Slave operation & replication
177
178 13.1. Native replication
179
180 13.2. Slave operation
181
182 13.2.1. Supermaster automatic provisioning of
183 slaves
33ccb468 184
d16e0461 185 13.3. Master operation
33ccb468 186
d16e0461 187 14. Fancy records for seamless email and URL integration
33ccb468 188
d16e0461 189 15. Index of all settings
33ccb468 190
d16e0461 191 16. Index of all internal metrics
33ccb468 192
d16e0461 193 16.1. Counters & variables
33ccb468 194
d16e0461 195 16.1.1. Ring buffers
33ccb468 196
d16e0461 197 17. Supported record types and their storage
33ccb468 198
d16e0461 199 18. HOWTO & Frequently Asked Questions
33ccb468 200
d16e0461 201 18.1. Getting support, free and paid FAQ
33ccb468 202
d16e0461 203 18.2. Using and Compiling PowerDNS FAQ
33ccb468 204
d16e0461 205 18.3. Backend developer HOWTO
33ccb468 206
d16e0461 207 18.4. About PowerDNS.COM BV, 'the company'
33ccb468 208
d16e0461 209 A. Backends in detail
33ccb468 210
d16e0461 211 A.1. PipeBackend
33ccb468 212
d16e0461 213 A.1.1. PipeBackend protocol
33ccb468 214
d16e0461 215 A.2. MySQL backend
33ccb468 216
d16e0461 217 A.2.1. Configuration settings
33ccb468 218
d16e0461 219 A.2.2. Notes
33ccb468 220
d16e0461 221 A.3. Random Backend
33ccb468 222
d16e0461 223 A.4. MySQL PDNS backend
33ccb468 224
d16e0461 225 A.4.1. Notes
33ccb468 226
d16e0461 227 A.5. Generic MySQL and PgSQL backends
33ccb468 228
d16e0461 229 A.5.1. MySQL specifics
33ccb468 230
d16e0461 231 A.5.2. PostgresSQL specifics
33ccb468 232
d16e0461 233 A.5.3. Basic functionality
33ccb468 234
d16e0461 235 A.5.4. Master/slave queries
33ccb468 236
d16e0461 237 A.5.5. Fancy records
33ccb468 238
d16e0461 239 A.5.6. Settings and specifying queries
33ccb468 240
d16e0461 241 A.5.7. Native operation
33ccb468 242
d16e0461 243 A.5.8. Slave operation
33ccb468 244
d16e0461 245 A.5.9. Superslave operation
33ccb468 246
d16e0461 247 A.5.10. Master operation
33ccb468 248
d16e0461 249 A.6. Generic Oracle backend
33ccb468 250
d16e0461 251 A.6.1. Setting up Oracle for use with PowerDNS
33ccb468 252
d16e0461 253 A.7. Generic SQLite backend
33ccb468 254
d16e0461 255 A.7.1. Compiling the SQLite backend
33ccb468 256
d16e0461 257 A.7.2. Setting up the database
33ccb468 258
d16e0461 259 A.7.3. Using the SQLite backend
33ccb468 260
d16e0461 261 A.8. DB2 backend
33ccb468 262
d16e0461 263 A.9. Bind zone file backend
33ccb468 264
d16e0461 265 A.9.1. Operation
33ccb468 266
d16e0461 267 A.9.2. Pdns_control commands
33ccb468 268
d16e0461 269 A.9.3. Performance
33ccb468 270
d16e0461 271 A.9.4. Master/slave configuration
33ccb468 272
d16e0461 273 A.9.5. Commands
33ccb468 274
d16e0461 275 A.10. ODBC backend
33ccb468 276
d16e0461 277 A.11. XDB Backend
33ccb468 278
d16e0461 279 A.12. LDAP backend
33ccb468 280
d16e0461 281 B. PDNS internals
33ccb468 282
d16e0461 283 B.1. Controlsocket
33ccb468 284
d16e0461 285 B.1.1. pdns_control
33ccb468 286
d16e0461 287 B.2. Guardian
33ccb468 288
d16e0461 289 B.3. Modules & Backends
33ccb468 290
d16e0461 291 B.4. How PDNS translates DNS queries into backend queries
33ccb468 292
d16e0461 293 C. Backend writers' guide
33ccb468 294
d16e0461 295 C.1. Simple read-only native backends
33ccb468 296
d16e0461 297 C.1.1. A sample minimal backend
33ccb468 298
d16e0461 299 C.1.2. Interface definition
33ccb468 300
d16e0461 301 C.2. Reporting errors
33ccb468 302
d16e0461 303 C.3. Declaring and reading configuration details
33ccb468 304
d16e0461 305 C.4. Read/write slave-capable backends
33ccb468 306
d16e0461 307 C.4.1. Supermaster/Superslave capability
33ccb468 308
d16e0461 309 C.5. Read/write master-capable backends
33ccb468 310
d16e0461
TP
311 D. Compiling PowerDNS
312
313 D.1. Compiling PowerDNS on Unix
314
315 D.1.1. AIX
316
317 D.1.2. FreeBSD
318
319 D.1.3. Linux
320
321 D.1.4. MacOS X
322
323 D.1.5. OpenBSD
324
325 D.1.6. Solaris
326
327 D.2. Compiling PowerDNS on Windows
328
329 D.2.1. Assumptions
330
331 D.2.2. Prequisites
332
333 D.2.3. Nullsoft Installer
334
335 D.2.4. Setting up the build-environment
336
337 D.2.5. Compilation
338
339 D.2.6. Miscellaneous
340
341 E. PowerDNS license (GNU General Public License version 2)
33ccb468 342
343 List of Tables
d16e0461
TP
344
345 17-1. SOA fields
346
347 A-1. PipeBackend capabilities
348
349 A-2. MySQL backend capabilities
350
351 A-3. Random Backend capabilities
352
353 A-4. MySQL backend capabilities
354
355 A-5. Generic PgSQL and MySQL backend capabilities
356
357 A-6. Oracle backend capabilities
358
359 A-7. Generic SQLite backend capabilities
360
361 A-8. DB2 backend capabilities
362
363 A-9. Bind zone file backend capabilities
364
365 A-10. ODBC backend capabilities
366
367 A-11. LDAP backend capabilities
368
369 C-1. DNSResourceRecord class
370
371 C-2. SOAData struct
372
373 C-3. DomainInfo struct
374
375 ----------------------------------------------------------------------
376
377 Chapter 1. The PowerDNS dynamic nameserver
378
379 The PowerDNS daemon is a versatile nameserver which supports a large
380 number of backends. These backends can either be plain zonefiles or be
381 more dynamic in nature.
382
383 Prime examples of backends include relational databases, but also
384 loadbalancing and failover algorithms.
385
386 The company is called PowerDNS BV, the nameserver daemon is called PDNS.
387
388 ----------------------------------------------------------------------
33ccb468 389
3901.1. Function & design of PDNS
391
d16e0461
TP
392 PDNS is an authoritative only nameserver. It will answer questions about
393 domains it knows about, but will not go out on the net to resolve queries
394 about other domains. However, it can use a recursing backend to provide
395 that functionality.
33ccb468 396
d16e0461
TP
397 When PDNS answers a question, it comes out of the database, and can be
398 trusted as being authoritative. There is no way to pollute the cache or to
399 confuse the daemon.
33ccb468 400
d16e0461
TP
401 PDNS has been designed to serve both the needs of small installations by
402 being easy to setup, as well as for serving very large query volumes on
403 large numbers of domains.
33ccb468 404
d16e0461
TP
405 Another prime goal is security. By the use of language features, the PDNS
406 source code is very small (in the order of 10.000 lines) which makes
407 auditing easy. In the same way, library features have been used to
408 mitigate the risks of buffer overflows.
33ccb468 409
d16e0461
TP
410 Finally, PDNS is able to give a lot of statistics on its operation which
411 is both helpful in determining the scalability of an installation as well
412 as for spotting problems.
413
414 ----------------------------------------------------------------------
33ccb468 415
4161.2. About this document
417
d16e0461
TP
418 If you are reading this document from disk, you may want to check
419 http://doc.powerdns.com for updates. The PDF version is available on
420 http://doc.powerdns.com/pdf, a text file is on
421 http://doc.powerdns.com/txt/.
422
423 ----------------------------------------------------------------------
33ccb468 424
4251.3. Release notes
426
d16e0461
TP
427 Before proceeding, it is advised to check the release notes for your PDNS
428 version, as specified in the name of the distribution file.
429
430 ----------------------------------------------------------------------
431
432 1.3.1. Version 2.9.13
433
434 Big news! Windows is back! Our great friend Michel Stol found the time to
435 update the PowerDNS code so it works again under windows.
436
437 Furthermore, big thanks go out to Dell who quickly repaired my trusty
438 laptop.
439
440 His changes:
441
442 * Generic SQLite support added
443
444 * Removed the ODBC backend, replaced it by the Generic ODBC Backend,
445 which has all the cool configurability of the Generic MySQL and
446 PostgreSQL backends.
447
448 * The PowerDNS Recursor now runs as a Service. It defaults to running on
449 port 5300, PowerDNS itself is configured to expect the Recursor on
450 port 5300 now.
451
452 * The PowerDNS Service is now known as 'PowerDNS' to Windows.
453
454 * The Installer was redone, this time with NSIS2.
455
456 * General updates and fixes.
457
458 Other news:
459
460 Note There appears to be a problem with PowerDNS on Red Hat 7.3 with GCC
461 2.96 and self-compiled binaries. The symptoms are that PowerDNS works
462 on the foreground but fails as a daemon. We're working on it.
463
464 If you do note problems, let the list know, if you don't, please do
465 so as well. Tell us if you use the RPM or compiled yourself.
466
467 It is known that not compiling in MySQL support helps solve the
468 problem, but then you don't have MySQL.
469
470 There have been a number of reports on MySQL connections being dropped on
471 FreeBSD 4.x, which sometimes causes PowerDNS to give up and reload itself.
472 To combat this, MySQL error messages have been improved in some places in
473 hopes of figuring out what is up. The initial indication is that MySQL
474 itself sometimes terminates the connection and, amazingly, that switching
475 to a Unix domain socket instead of TCP solves the problem.
476
477 Bug fixes:
478
479 * allow-axfr-ips did not work for individual IP addresses (bug & fix by
480 Norbert Sendetzky)
481
482 Improvements:
483
484 * Opteron support! Thanks to Jeff Davey for providing a shell on an
485 Opteron. The fixes should also help PowerDNS on other platforms with a
486 64 bit userspace.
487
488 Btw, the PowerDNS team has a strong desire for an Opteron :-)
489
490 * pdns_recursor jumbles answers now. This means that you can do poor
491 man's roundrobin by supplying multiple A, MX or AAAA records for a
492 service, and get a random one on top each time. Interestingly, this
493 feature appeared out of nowhere, this change was made to the
494 authoritative code but due to the wonders of code-reuse had an effect
495 on pdns_recursor too.
496
497 * Big LDAP cleanup. Support for TLS was added. Zone2LDAP also gained the
498 ability to generate ldif files containing a tree or a list of entries.
499 (Norbert Sendetzky)
500
501 * Zone2sql is now somewhat clearer when reporting malformed line errors
502 - it did not always include the name of the file causing a problem,
503 especially for big installations. Problem noted by Thom May.
504
505 * pdns_recursor now survives the expiration of all its root records,
506 most often caused by prolonged disconnection from the net.
507
508 ----------------------------------------------------------------------
509
510 1.3.2. Version 2.9.12
511
512 Release rich in features. Work on Verisign oddities, addition of SQLite
513 backend, pdns_recursor maturity.
514
515 New features:
516
517 * --version command (requested by Mike Benoit)
518
519 * delegation-only, a Verisign special. See Section 12.1.1.
520
521 * Generic SQLite support, by Michel 'Who da man?' Stol. See Section A.7.
522
523 * init.d script for pdns_recursor
524
525 * Recursor now actually purges its cache, saving memory.
526
527 * Slave configuration now no longer falls over when presented with a
528 NULL master
529
530 * Bindbackend2 now has supermaster support (Mark Bergsma, untested)
531
532 * Answers are now shuffled! It turns out a few recursors don't do
533 shuffling (pdns_recursor, djbdns), so we do it now. Requested by Jorn
534 Ekkelenkamp of ISP-Services. This means that if you have multiple IP
535 addresses for one host, they will be returned in differing order every
536 once in a while.
537
538 Bugs:
539
540 * 0.0.0.0/0 didn't use to work (Norbert Sendetzky)
541
542 * pdns_recursor would try to resolve IP address which to bind to,
543 potentially causing chicken/egg problem
544
545 * gpgsql no longer reports as gmysql (Sherwin Daganoto)
546
547 * SRV would not be parsed right from disk (Christof Meerwald)
548
549 * An AXFR from a zone hosted on the LDAP backend no longer transmits all
550 the reverse entries too (Norbert Sendetzky)
551
552 * PostgreSQL backend now does error checking. It would be a bit too
553 trusting before.
554
555 Improvements, cleanups:
556
557 * PowerDNS now reports the numerical IP addresses it binds to instead of
558 the, possibly, alphanumeric names the operator passed.
33ccb468 559
d16e0461 560 * Removed only-soa hackery (noticed by Norbert Sendetzky)
33ccb468 561
d16e0461 562 * Debian packaging fixes (Wichert Akkerman)
33ccb468 563
d16e0461 564 * Some parameter descriptions were improved.
33ccb468 565
d16e0461
TP
566 * Cleanups by Norbert: getAuth moved to chopOff, arguments::contains
567 massive cleanup, more.
33ccb468 568
d16e0461 569 ----------------------------------------------------------------------
33ccb468 570
d16e0461 571 1.3.3. Version 2.9.11
33ccb468 572
d16e0461
TP
573 Yet another iteration, hopefully this will be the last silly release.
574
575 Warning There has been a change in behaviour whereby disable-axfr does
576 what it means now! From now on, setting allow-axfr-ips
577 automatically disables AXFR from unmentioned subnets.
578
579 This release enables AXFR again, disable-axfr did the opposite of what it
580 claimed. Furthermore, the pdns_recursor now cleans its cache, which should
581 save some memory in the long run. Norbert contributed some small LDAP work
582 which should come in useful in the future.
583
584 ----------------------------------------------------------------------
585
586 1.3.4. Version 2.9.10
587
588 Small bugfixes, LDAP update. Released 3rd of July 2003. Apologies for the
589 long delay, real life keeps interfering.
590
591 Warning Do not use or try to use 2.9.9, it was a botched release!
592
593 Warning There has been a change in behaviour whereby disable-axfr does
594 what it means now! From now on, setting allow-axfr-ips
595 automatically disables AXFR from unmentioned subnets.
596
597 * 2.9.8 was prone to crash on adding additional records. Thanks to
598 excellent debugging by PowerDNS users worldwide, the bug was found
599 quickly and is in fact present in all earlier PowerDNS releases, but
600 for some reason doesn't cause crashes there.
601
602 * Notifications now jump in front of the queue of domains that need to
603 be checked for changes, giving much greater perceived performance.
604 This is needed if you have tens of thousands of slave domains and your
605 master server is on a high latency link. Thanks to Mark Jeftovic of
606 EasyDNS for suggesting this change and testing it on their platform.
607
608 * Dean Mills reported that PowerDNS does confusing logging about
609 changing GIDs and UIDs, fixed. Cosmetic only.
610
611 * pdns_recursor may have logged empty lines for some users, fixed.
612 Solution suggested by Norbert Sendetzky.
613
614 * LDAP: DNS TTLs were random values (Norbert Sendetzky, Stefan
615 Pfetzing). New ldap-default-ttl option.
616
617 * LDAP: Now works with OpenLDAP 2.1 (Norbert Sendetzky)
618
619 * LDAP: error handling for invalid MX records implemented (Norbert
620 Sendetzky)
621
622 * LDAP: better exception handling (Norbert Sendetzky)
623
624 * LDAP: code cleanup of lookup() (Norbert Sendetzky)
625
626 * LDAP: added support for scoped searches (Norbert Sendetzky)
627
628 ----------------------------------------------------------------------
629
630 1.3.5. Version 2.9.8
631
632 Queen's day release! 30th of April 2003.
633
634 Added support for AIX, fixed negative SOA caching. Some other cleanups.
635 Not a major release but enough reasons to upgrade.
636
637 Bugs fixed:
638
639 * Recursor had problems expiring negatively cached entries, which wasted
640 memory and also led to the continued non-existence of hosts that since
641 had come into existence.
642
643 * The Generic SQL backends did not lowercase the names of records, which
644 led to new records not being found by case sensitive databases
645 (notably PostgreSQL). Found by Volker Goetz.
646
647 * NS queries for zones for which we did not carry authority, but only
648 had delegation information, had their NS records in the wrong section.
649 Minor detail, but a standards violation on etheless. Spotted by
650 Stephane Bortzmeyer.
651
652 Improvements:
653
654 * Removed crypt.h dependency from powerldap.hh, which was a problem on
655 some platforms (Richard Arends)
656
657 * PowerDNS can't parse so called binary labels which we now detect and
658 ignore, after printing a warning.
659
660 * Specifying allow-axfr-ips now automatically disables AXFR for all
661 non-mentioned addresses.
662
663 * A Solaris ready init.d script is now part of the tar.gz (contributed,
664 but I lost by whom).
665
666 * Added some fixes to PowerDNS can work on AIX (spotted by Markus
667 Heimhilcher).
668
669 * Norbert Sendetzky contributed zone2ldap.
670
671 * Everybody's favorite compiler warning from zone2sql.cc was removed!
672
673 * Recursor now listens on TCP!
674
675 ----------------------------------------------------------------------
676
677 1.3.6. Version 2.9.7
678
679 Released on 2003-03-20.
680
681 This is a sweeping release in the sense of cleanup. There are some new
682 features but mostly a lot of cleanup going on. Hiding inside is the
683 bind2backend, the next generation of the bind backend. A work in progress.
684 Those of you with overlapping zones, as mentioned in the changelog of
685 2.9.6, are invited to check it out by replacing launch=bind by
686 launch=bind2 and renaming all bind- parameters to bind2-. Be aware that if
687 you run with many small zones, this backend is faster, but if you run with
688 a few large ones, it is slower. This will improve.
689
690 Features:
691
692 * Mark Bergsma contributed query-local-address which allows the operator
693 to select which source address to use. This is useful on servers with
694 multiple source addresses and the operating system selecting an
695 unintended one, leading to remotes denying access.
696
697 * PowerDNS can now perform AAAA additional processing optionally, turned
698 on by setting do-ipv6-additional-processing. Thanks to Stephane
699 Bortzmeyer for pointing out the need.
700
701 * Bind2backend, which is almost in compliance with the new IETF
702 AXFR-clarify (some would say 'redefinition') draft.
703
704 This backend is not ready for primetime but you may want to try it if
705 you currently have overlapping zones and note problems. An overlapping
706 zone would be having "ipv6.powerdns.com" and "powerdns.com" zones on
707 one server.
708
709 Improvements:
710
711 * Zone2sql would happily try to read from a directory and not give a
712 useful error about this.
713
714 * PowerDNS now reports the case where it can't figure out any IP address
715 of slave nameservers for a zone
716
717 * Removed receiver-threads setting which was experimental and in fact
718 only made things worse.
719
720 * LDAP backend updates from its author Norbert Sendetzky. Reverse
721 lookups should work now too.
722
723 * An error message about unparseable packets did not include the
724 originating IP address (fixed by Mark Bergsma)
725
726 * PowerDNS can now be started via path resolution while running with a
727 guardian. Suggested by Maurice Nonnekes.
728
729 * pdns_recursor moved to sbin (reported by Norbert Sendetzky)
730
731 * Retuned some logger errorlevels, a lot of master/slave chatter was
732 logged as 'Error'. Reported by Willem de Groot.
733
734 Bugs fixed:
735
736 * zone2sql did not remove trailing dots in SOA records.
737
738 * ldapbackend did not include utility.hh which caused compilation
739 problems on Solaris (reported by Remco Post)
740
741 * pdns_control could leave behind remnants in case PowerDNS was not
742 running (reported by dG)
743
744 * Incoming AXFR did not work on Solaris and other big-endian systems
745 (Willem de Groot helped debugging this long standing problem).
746
747 * Recursor could crash on convoluted CNAME loops. Thanks to Dan Faerch
748 for delivering coredumps.
749
750 * Silly 'wuh' debugging output in zone2sql and bindbackend removed
751 (spotted by Ivo van der Wijk)
752
753 * Recursor neglected to differentiate between negative cache of NXDOMAIN
754 and NOERROR, leading to problems with IPv6 enabled Windows clients.
755 Thanks to Stuart Walsh for reporting this and testing the fix.
756
757 * PowerDNS set the 'aa' bit on serving NS records in a zone for which it
758 was authoritative. Most implementations drop the 'aa' bit in this case
759 and Stephane Bortzmeyer informed us of this. PowerDNS now also drops
760 the 'aa' bit in this case.
761
762 * The webserver tended to fail after prolonged operation on FreeBSD,
763 this was due to an uninitialised timeout, other platforms were lucky.
764 Thanks to G.P. de Boer for helping debug this.
765
766 * getAnswers() in dnspacket.cc could be forced to read bytes beyond the
767 end of the packet, leading to crashes in the PowerDNS recursor. This
768 is an ongoing project that needs more work. Reported by Dan Faerch,
769 with a coredump proving the problem.
770
771 ----------------------------------------------------------------------
772
773 1.3.7. Version 2.9.6
774
775 Two new backends - Generic ODBC (windows only) and LDAP. Furthermore, a
776 few important bugs have been fixed which may have hampered sites seeing a
777 lot of outgoing zonetransfers. Additionally, the pdns recursor now has
778 'query throttling' which is pretty cool. In short this makes sure that
779 PowerDNS does not send out heaps of queries if a nameserver is unable to
780 provide an answer. Many operators of authoritative setups are all too
781 aware of recursing nameservers that hammer them for zones they don't have,
782 PowerDNS won't do that anymore now, no matter what clients request of it.
783
784 Warning There is an unresolved issue with the BIND backend and
785 'overlapping' slave zones. So if you have 'example.com' and also
786 have a separate slave zone called 'external.example.com', things
787 may go wrong badly. Thanks to Christian Laursen for working with
788 us a lot in finding this issue. We hope to resolve it soon.
789
790 * BIND Backend now honours notifies, code to support this was
791 accidentally left out. Thanks to Christian Laursen for noticing this.
792
793 * Massive speedup for those of you using the slightly deprecated MBOXFW
794 records. Thanks to Jorn of ISP Services for helping and testing this
795 improvement.
796
797 * $GENERATE had an off-by-one bug where it would omit the last record to
798 be generated (Christian Laursen)
799
800 * Simultaneous AXFRs may have been problematic on some backends. Thanks
801 to Jorn of ISP-Services again for helping us resolve this issue.
802
803 * Added LDAP backend by Norbert Sendetzky, see Section A.12.
804
805 * Added Generic ODBC backend for Windows by Michel Stol.
806
807 * Simplified 'out of zone data' detection in incoming AXFR support,
808 hopefully removing a case sensitivity bug there. Thanks again to
809 Christian Laursen for reporting this issue.
810
811 * $include in-zonefile was broken under some circumstances, losing the
812 last character of a filename. Thanks to Joris Vandalon for noticing
813 this.
814
815 * The zoneparser was more case-sensitive than BIND, refusing to accept
816 'in' as well as 'IN'. Thanks to Joris Vandalon for noticing this.
817
818 ----------------------------------------------------------------------
819
820 1.3.8. Version 2.9.5
821
822 Released on 2002-02-03.
823
824 This version is almost entirely about recursion with major changes to both
825 the pdns recursor, which is renamed to 'pdns_recursor' and to the main
826 PowerDNS binary to make it interact better with the recursing component.
827
828 Sadly, due to technical reasons, compiling the pdns recursor and pdns
829 authoritative nameserver into one binary is not immediately possible.
830 During the release of 2.9.4 we stated that the recursing nameserver would
831 be integrated in the next release - this won't happen now.
832
833 However, this turns out to not be that bad at all. The recursor can now be
834 restarted without having to restart the rest of the nameserver, for
835 example. Cooperation between the both halves of PDNS is also almost
836 seamless. As a result, 'non-lazy recursion' has been dropped. See Chapter
837 11 for more details.
838
839 Furthermore, the recursor only works on Linux, Windows and Solaris (not
840 entirely). FreeBSD does not support the required functions. If you know
841 any important FreeBSD people, plea with them to support
842 set/get/swapcontext! Alternatively, FreeBSD coders could read the solution
843 presented here in figure 5.
844
845 The 'Contributor of the Month' award goes to Mark Bergsma who has
846 responded to our plea for help with the label compressor and contributed a
847 wonderfully simple and right fix that allows PDNS to compress just as well
848 as Other namerervers out there. An honorary mention goes to Ueli Heuer
849 who, despite having no C++ experience, submitted an excellent SRV record
850 implementation.
851
852 Excellent work was also performed by Michel Stol, the Windows guy, in
853 fixing all our non-portable stuff again. Christof Meerwald has also done
854 wonderful work in porting MTasker to Windows, which was then used by
855 Michel to get the recursor functioning on Windows.
856
857 Other changes:
858
859 * dnspacket.cc was cleaned up by factoring out common operations
860
861 * Heaps of work on the recursing nameserver. Has now achieved *days* of
862 uptime!
863
864 * Recursor renamed from syncres to pdns_recursor
865
866 * PowerDNS can now serve records it does not know about. To benefit from
867 this slightly undocumented feature, add 1024 to the numerical type of
868 a record and include the record in binary form in your database. Used
869 internally by the recursing nameserver but you can use it too.
870
871 * PowerDNS now knows about SIG and KEY records *names*. It does not
872 support them yet but can at least report so now.
873
874 * HINFO records can now be transferred from a master to PowerDNS (thanks
875 to Ueli Heuer for noticing it didn't work).
876
877 * Yet more UltraSPARC alignment issues fixed (Chris Andrews).
878
879 * Dropped non-lazy recursion, nobody was using it. Lazy recursion became
880 even more lazy after Dan Bernstein pointed out that additional
881 processing is not vital, so PowerDNS does its best to do additional
882 processing on recursive queries, but does not scream murder if it does
883 not succeed. Due to caching, the next identical query will be
884 successfully additionally processed.
885
886 * Label compression was improved so we can now fit all . records in 436
887 bytes, this used to be 460! (Code & formal proof of correctness by
888 Mark Bergsma).
889
890 * SRV support (incoming and outgoing), submitted by Ueli Heuer.
891
892 * Generic backends do not support SOA serial autocalculation, it
893 appears. Could lead to random SOA serials in case of a serial of 0 in
894 the database. Fixed so that 0 stays zero in that case. Don't set the
895 SOA serial to 0 when using Generic MySQL or Generic PostgreSQL!
896
897 * J root-server address was updated to its new location.
898
899 * SIGUSR1 now forces the recursor to print out statistics to the log.
900
901 * Meaning of recursor logging was changed a bit - a cache hit is now a
902 question that was answered with 0 outgoing packets needed. Used to be
903 a weighted average of internal cache hits.
904
905 * MySQL compilation did not include -lz which causes problems on some
906 platforms. Thanks to James H. Cloos Jr for reporting this.
907
908 * After a suggestion by Daniel Meyer and Florus Both, the built in
909 webserver now reports the configuration name when multiple PowerDNS
910 instances are active.
911
912 * Brad Knowles noticed that zone2sql had problems with the root.zone,
913 fixed. This also closes some other zone2sql annoyances with converting
914 single zones.
915
916 ----------------------------------------------------------------------
917
918 1.3.9. Version 2.9.4
919
920 Yet another grand release. Big news is the addition of a recursing
921 nameserver which has sprung into existence over the past week. It is in
922 use on several computers already but it is not ready for prime time.
923 Complete integration with PowerDNS is expected around 2.9.5, for now the
924 recursor is a separate program.
925
926 In preliminary tests, the recursor appears to be four times faster than
927 BIND 9 on a naive benchmark starting from a cold cache. BIND 9 managed to
928 get through to some slower nameservers however, which were given up on by
929 PowerDNS. We will continue to tune the recursor. See Chapter 12 for
930 further details.
931
932 The BIND Backend has also been tested (see the bind-domain-status item
933 below) rather heavily by several parties. After some discussion online,
934 one of the BIND authors ventured that the newsgroup
935 comp.protocols.dns.bind may now in fact be an appropriate venue for
936 discussing PowerDNS. Since this discussion, traffic to the PowerDNS pages
937 has increased sixfold and shows no signs of slowing down.
938
939 From this, it is apparent that far more people are interested in PowerDNS
940 than yet know about it. So spread the word!
941
942 In other news, we now have a security page at Section 1.4. Furthermore,
943 Maurice Nonnekes contributed an OpenBSD port! See his page for more
944 details!
945
946 New features and improvements:
33ccb468 947
948 * All SQL queries in the generic backends are now available for
d16e0461
TP
949 configuration. (Martin Klebermass/bert hubert). See Section A.5.
950
951 * A recursing nameserver! See Chapter 12.
952
33ccb468 953 * An incoming AXFR now only starts a backend zone replacement
d16e0461
TP
954 transaction after the first record arrived successfully, thus making
955 sure no work is done when a remote nameserver is unable/unwilling to
956 AXFR a zone to us.
957
958 * Zoneparser error messages were improved slightly (thanks to Stef van
959 Dessel for spotting this shortcoming)
960
961 * XS4ALL's Erik Bos checked how PowerDNS reacted to a BIND installation
962 with almost 60.000 domains, some of which with >100.000 records, and
963 he discovered the pdns_control bind-domain-status command became very
964 slow with larger numbers of domains. Fixed, 60.000 domains are now
965 listed in under one second.
966
967 * If a remote nameserver disconnects during an incoming AXFR, the update
968 is now rolled back, unless the AXFR was properly terminated.
969
33ccb468 970 * The migration chapter mentioned the use of deprecated backends.
971
972 A tremendous number of bugs were discovered and fixed:
973
974 * Zone parser would only accept $include and not $INCLUDE
d16e0461 975
33ccb468 976 * Zone parser had problems with $lines with comments on the end
d16e0461
TP
977
978 * Wildcard ANY queries were broken (thanks Colemarcus for spotting this)
979
33ccb468 980 * A connection failure with the Generic backends would lead to a
981 powerdns reload (cast of many)
d16e0461 982
33ccb468 983 * Generic backends had some semantic problems with slave support.
d16e0461
TP
984 Symptoms were oft-repeated notifications and transfers (thanks to Mark
985 Bergsma for helping resolve this).
986
987 * Solaris version compiles again. Thanks to Mohamed Lrhazi for reporting
988 that it didn't.
989
990 * Some UltraSPARC alignment fixes. Thanks to Mohamed Lrhazi for being
991 helpful in spotting these. One problem is still outstanding, Mohamed
992 sent a core dump that tells us where the problem is. Expect the fix to
993 be in 2.9.5. Volunteers can grep the source for 'UltraSPARC' to find
994 where the problem is.
995
996 * Our support of IPv6 on FreeBSD had phase of moon dependent bugs, fixed
997 by Peter van Dijk.
998
999 * Some crashes of and by pdns_control were fixed, thanks to Mark Bergsma
1000 for helping resolve these.
1001
1002 * Outgoing AXFR in pdns installations with multiple loaded backends was
1003 broken (thanks to Stuart Walsh for reporting this).
1004
33ccb468 1005 * A failed BIND Backend incoming AXFR would block the zone until it
1006 succeeded again.
d16e0461
TP
1007
1008 * Generic PostgreSQL backend wouldn't compile with newer libpq++, fixed
1009 by Julien Lemoine/SpeedBlue.
1010
33ccb468 1011 * Potential bug (not observed) when listening on multiple interfaces
1012 fixed.
d16e0461 1013
33ccb468 1014 * Some typos in manpages fixed (reported by Marco Davids).
33ccb468 1015
d16e0461 1016 ----------------------------------------------------------------------
33ccb468 1017
d16e0461 1018 1.3.10. Version 2.9.3a
33ccb468 1019
d16e0461 1020 Note 2.9.3a is identical to 2.9.3 except that zone2sql does work
33ccb468 1021
d16e0461
TP
1022 Broad range of huge improvements. We now have an all-static .rpm and .deb
1023 for Linux users and a a link to an OpenBSD port. Major news is that work
1024 on the Bind backend has progressed to the point that we've just retired
1025 our last Bind server and replaced it with PowerDNS in Bind mode! This
1026 server is operating a number of master and slave setups so it should
1027 stress the Bind backend somewhat.
33ccb468 1028
1029 This version is rapidly approaching the point where it is a
d16e0461
TP
1030 better-Bind-than-Bind and nearly a drop-in replacement for authoritative
1031 setups. PowerDNS is now equipped with a powerful master/slave apparatus
1032 that offers a lot of insight and control to the user, even when operating
1033 from Bind zonefiles and a Bind configuration. Observe.
33ccb468 1034
1035 After the SOA of ds9a.nl was raised:
33ccb468 1036
d16e0461
TP
1037 pdns[17495]: All slave domains are fresh
1038 pdns[17495]: 1 domain for which we are master needs notifications
1039 pdns[17495]: Queued notification of domain 'ds9a.nl' to 195.193.163.3
1040 pdns[17495]: Queued notification of domain 'ds9a.nl' to 213.156.2.1
1041 pdns[17520]: AXFR of domain 'ds9a.nl' initiated by 195.193.163.3
1042 pdns[17520]: AXFR of domain 'ds9a.nl' to 195.193.163.3 finished
1043 pdns[17521]: AXFR of domain 'ds9a.nl' initiated by 213.156.2.1
1044 pdns[17521]: AXFR of domain 'ds9a.nl' to 213.156.2.1 finished
1045 pdns[17495]: Removed from notification list: 'ds9a.nl' to 195.193.163.3 (was acknowledged)
1046 pdns[17495]: Removed from notification list: 'ds9a.nl' to 213.156.2.1 (was acknowledged)
1047 pdns[17495]: No master domains need notifications
1048
33ccb468 1049
1050 If however our slaves would ignore us, as some are prone to do, we can
1051 send some additional notifications:
33ccb468 1052
d16e0461
TP
1053 $ sudo pdns_control notify ds9a.nl
1054 Added to queue
1055 pdns[17492]: Notification request for domain 'ds9a.nl' received
1056 pdns[17492]: Queued notification of domain 'ds9a.nl' to 195.193.163.3
1057 pdns[17492]: Queued notification of domain 'ds9a.nl' to 213.156.2.1
1058 pdns[17495]: Removed from notification list: 'ds9a.nl' to 195.193.163.3 (was acknowledged)
1059 pdns[17495]: Removed from notification list: 'ds9a.nl' to 213.156.2.1 (was acknowledged)
1060
33ccb468 1061
1062 Conversely, if PowerDNS needs to be reminded to retrieve a zone from a
1063 master, a command is provided:
33ccb468 1064
d16e0461
TP
1065 $ sudo pdns_control retrieve forfun.net
1066 Added retrieval request for 'forfun.net' from master 212.187.98.67
1067 pdns[17495]: AXFR started for 'forfun.net', transaction started
1068 pdns[17495]: Zone 'forfun.net' (/var/cache/bind/forfun.net) reloaded
1069 pdns[17495]: AXFR done for 'forfun.net', zone committed
1070
1071
1072 Also, you can force PowerDNS to reload a zone from disk immediately with
1073 pdns_control bind-reload-now. All this happens 'live', per your
1074 instructions. Without instructions, the right things also happen, but the
1075 operator is in charge.
1076
1077 For more about all this coolness, see Section B.1.1 and Section A.9.2.
1078
1079 Warning Again some changes in compilation instructions. The hybrid pgmysql
1080 backend has been split up into 'gmysql' and 'gpgsql', sharing a
1081 common base within the PowerDNS server itself. This means that you
1082 can no longer compile --with-modules="pgmysql" --enable-mysql
1083 --enable-pgsql but that you should now use: --with-modules="gmysql
1084 gpgsql". The old launch-names remain available.
1085
1086 If you launch the Generic PgSQL backend as gpgsql2, all parameters
1087 will have gpsql2 as a prefix, for example pgsql2-dbname. If
1088 launched as gpsql, the regular names are in effect.
1089
1090 Warning The pdns_control protocol was changed which means that older
1091 pdns_controls cannot talk to 2.9.3. The other way around is broken
1092 too. This may lead to problems with automatic upgrade scripts, so
1093 pay attention if your daemon is truly restarted.
1094
1095 Also make sure no old pdns_control command is around to confuse
1096 things.
33ccb468 1097
1098 Improvements:
1099
1100 * Bind backend can now deal with missing files and try to find them
1101 later.
d16e0461
TP
1102
1103 * Bind backend is now explicitly master capable and triggers the sending
1104 of notifications.
1105
1106 * General robustness improvements in Bind backend - many errors are now
1107 non-fatal.
1108
33ccb468 1109 * Accessability, Serviceability. New pdns_server commands like
1110 bind-list-rejects (lists zones that could not be loaded, and the
d16e0461
TP
1111 reason why), bind-reload-now (reload a zone from disk NOW), rediscover
1112 (reread named.conf NOW). More is coming up.
1113
33ccb468 1114 * Added support for retrieving RP (Responsible Person) records from
1115 remote masters. Serving them was already possible.
d16e0461
TP
1116
1117 * Added support for LOC records, which encode the geographical location
1118 of a host, both serving and retrieving (thanks to Marco Davids using
1119 them on our last Bind server, forcing us to implement this silly
1120 record).
1121
33ccb468 1122 * Configuration file parser now strips leading spaces too, allowing
d16e0461
TP
1123 "chroot= /tmp" to work, as well as "chroot=/tmp" (Thanks to Hub Dohmen
1124 for reporting this for months on end).
1125
1126 * Added bind-domain-status command that shows the status of all domains
1127 (when/if they were parsed, any errors encountered while parsing them).
1128
1129 * Added bind-reload-now command that tries to reload a zone from disk
1130 NOW, and reports back errors to the operator immediatly.
1131
1132 * Added retrieve command that queues a request to retrieve a zone from
1133 its master.
1134
33ccb468 1135 * Zones retrieved from masters are now stored way smaller on disk
d16e0461
TP
1136 because the domain is stripped from records, which is derived from the
1137 configuration file. Retrieved zones are now prefixed with some
33ccb468 1138 information on where they came from.
1139
1140 Changes:
1141
1142 * gpgsql and gmysql backends split out of the hybrid pgmysqlbackend.
1143 This again changed compilation instructions!
d16e0461
TP
1144
1145 * pdns_control now uses the rarely seen SOCK_STREAM Unix Domain socket
1146 variety so it can transport large amounts of text, which is needed for
1147 the bind-domain-status command, for which see Section A.9.2. This
1148 breaks compatability with older pdns_control and pdns_server binaries!
1149
1150 * Bind backend now ignores 'hint' and 'forward' and other unsupported
1151 zone types.
1152
33ccb468 1153 * AXFRs are now logged more heavily by default. An AXFR is a heavy
d16e0461
TP
1154 operation anyhow, some more logging does not further increase the load
1155 materially. Does help in clearing up what slaves are doing.
1156
1157 * A lot of master/slave chatter has been silenced, making output more
1158 relevant. No more repetitive 'No master domains need notifications'
1159 etc, only changes are reported now.
33ccb468 1160
1161 Bugfixes:
1162
1163 * Windows version did not compile without minor changes.
d16e0461 1164
33ccb468 1165 * Confusing error reporting on Windows 98 (which does not support
1166 PowerDNS) fixed
d16e0461 1167
33ccb468 1168 * Potential crashes with shortened packets addressed. An upgrade is
1169 advised!
d16e0461 1170
33ccb468 1171 * notify (which was already there, just badly documented) no longer
1172 prints out debugging garbage.
33ccb468 1173
d16e0461
TP
1174 * pgmysql backend had problems launching when not compiled in but
1175 available as a module. Workaround for 2.9.2 is 'load-modules=pgmysql',
1176 but even then gpgsql would not work! gmysql would then, however. These
1177 modules are now split out, removing such issues.
1178
1179 ----------------------------------------------------------------------
1180
1181 1.3.11. Version 2.9.2
1182
1183 Bugfixes galore. Solaris porting created some issues on all platforms.
1184 Great news is that PowerDNS is now in Debian 'sid' (unstable). The 2.9.1
1185 packages in there currently aren't very good but the 2.9.2 ones will be.
1186 Many thanks to Wichert Akkerman, our 'downstream' for making this
1187 possible.
1188
1189 Warning The Generic MySQL backend, part of the Generic MySQL & PostgreSQL
1190 backend, is now the DEFAULT! The previous default, the 'mysql'
1191 backend (note the lack of 'g') is now DEPRECATED. This was the
1192 source of much confusion. The 'mysql' backend does not support
1193 MASTER or SLAVE operation. The Generic backends do.
1194
1195 To get back the mysql backend, add --with-modules="mysql" or
1196 --with-dynmodules="mysql" if you prefer to load your modules at
1197 runtime.
33ccb468 1198
1199 Bugs fixed:
1200
1201 * Silly debugging output removed from the webserver (found by Paul
1202 Wouters)
d16e0461 1203
33ccb468 1204 * SEVERE: due to Solaris portability fixes, qtypes<127 were broken.
d16e0461
TP
1205 These include NAPTR, ANY and AXFR. The upshot is that powerdns wasn't
1206 performing outgoing AXFRs nor ANY queries. These were the 'question
1207 for type -1' warnings in the log
1208
33ccb468 1209 * incoming AXFR could theoretically miss some trailing records (not
1210 observed, but could happen)
d16e0461
TP
1211
1212 * incoming AXFR did not support TXT records (spotted by Paul Wouters)
1213
33ccb468 1214 * with some remotes, an incoming AXFR would not terminate until a
1215 timeout occured (observed by Paul Wouters)
d16e0461 1216
33ccb468 1217 * Documentation bug, pgmysql != mypgsql
1218
1219 Documentation:
1220
d16e0461
TP
1221 * Documented the 'random backend', see Section A.3.
1222
33ccb468 1223 * Wichert Akkerman contributed three manpages.
d16e0461
TP
1224
1225 * Building PowerDNS on Unix is now documented somewhat more, see Section
1226 D.1.
33ccb468 1227
1228 Features:
1229
1230 * pdns init.d script is now +x by default
d16e0461
TP
1231
1232 * OpenBSD is on its way of becoming a supported platform! As of 2.9.2,
1233 PowerDNS compiles on OpenBSD but swiftly crashes. Help is welcome.
1234
1235 * ODBC backend (for Windows only) was missing from the distribution, now
1236 added.
1237
1238 * xdb backend added - see Section A.11. Designed for use by root-server
1239 operators.
1240
1241 * Dynamic modules are back which is good news for distributors who want
1242 to make a pdns packages that does not depend one every database under
1243 the sun.
1244
1245 ----------------------------------------------------------------------
1246
1247 1.3.12. Version 2.9.1
1248
1249 Thanks to the great enthusiasm from around the world, powerdns is now
1250 available for Solaris and FreeBSD users again! Furthermore, the Windows
1251 build is back. We are very grateful for the help of:
33ccb468 1252
1253 * Michel Stol
d16e0461 1254
33ccb468 1255 * Wichert Akkerman
d16e0461 1256
33ccb468 1257 * Edvard Tuinder
d16e0461 1258
33ccb468 1259 * Koos van den Hout
d16e0461 1260
33ccb468 1261 * Niels Bakker
d16e0461 1262
33ccb468 1263 * Erik Bos
d16e0461 1264
33ccb468 1265 * Alex Bleker
d16e0461 1266
33ccb468 1267 * steven stillaway
d16e0461 1268
33ccb468 1269 * Roel van der Made
d16e0461 1270
33ccb468 1271 * Steven Van Steen
1272
d16e0461
TP
1273 We are happy to have been able to work with the open source community to
1274 improve PowerDNS!
33ccb468 1275
1276 Changes:
1277
d16e0461
TP
1278 * The monitor command set no longer allows the changing of non-existant
1279 variables.
1280
1281 * IBM Universal Database DB2 backend now included in source distribution
1282 (untested!)
1283
1284 * Oracle backend now included in source distribution (sligthly tested!)
1285
33ccb468 1286 * configure script now searches for postgresql and mysql includes
d16e0461
TP
1287
1288 * Bind parser now no longer dies on records with a ' in them (Erik Bos)
1289
33ccb468 1290 * The pipebackend was accidentally left out of 2.9
d16e0461
TP
1291
1292 * FreeBSD fixes (with help from Erik Bos, Alex Bleeker, Niels Bakker)
1293
1294 * Heap of Solaris work (with help from Edvard Tuinder, Stefan Van Steen,
1295 Koos van den Hout, Roel van der Made and especially Mark Bakker). Now
1296 compiles in 2.7 and 2.8, haven't tried 2.9. May be a bit dysfunctional
1297 on 2.7 though - it won't do IPv6 and it won't serve AAAA. Patches
1298 welcome!
1299
1300 * Windows 32 build is back! Michel Stol updated his earlier work to the
1301 current version.
1302
33ccb468 1303 * S/Linux (Linux on Sparc) build works now (with help from steven
1304 stillaway).
d16e0461 1305
33ccb468 1306 * Silly debugging message ('sd.ttl from cache') removed
d16e0461 1307
33ccb468 1308 * .debs are back, hopefully in 'sid' soon! (Wichert Akkerman)
33ccb468 1309
d16e0461
TP
1310 * Removal of bzero and other less portable constructs. Discovered that
1311 recent Linux glibc's need -D_GNU_SOURCE (Wichert Akkerman).
33ccb468 1312
d16e0461
TP
1313 ----------------------------------------------------------------------
1314
1315 1.3.13. Version 2.9
1316
1317 Open source release. Do not deploy unless you know what you are doing.
1318 Stability is expected to return with 2.9.1, as are the binary builds.
33ccb468 1319
1320 * License changed to the GNU General Public License version 2.
d16e0461 1321
33ccb468 1322 * Cleanups by Erik Bos @ xs4all.
d16e0461 1323
33ccb468 1324 * Build improvements by Wichert Akkerman
d16e0461 1325
33ccb468 1326 * Lots of work on the build system, entirely revamped. By PowerDNS.
33ccb468 1327
d16e0461
TP
1328 ----------------------------------------------------------------------
1329
1330 1.3.14. Version 2.8
33ccb468 1331
d16e0461
TP
1332 From this release onwards, we'll concentrate on stabilising for the 3.0
1333 release. So if you have any must-have features, let us know soonest. The
1334 2.8 release fixes a bunch of small stability issues and add two new
1335 features. In the spirit of the move to stability, this release has already
1336 been running 24 hours on our servers before release.
33ccb468 1337
1338 * pipe backend gains the ability to restricts its invocation to a
1339 limited number of requests. This allows a very busy nameserver to
1340 still serve packets from a slow perl backend.
d16e0461 1341
33ccb468 1342 * pipe backend now honors query-logging, which also documents which
1343 queries were blocked by the regex.
d16e0461 1344
33ccb468 1345 * pipe backend now has its own backend chapter.
33ccb468 1346
d16e0461
TP
1347 * An incoming AXFR timeout at the wrong moment had the ability to crash
1348 the binary, forcing a reload. Thanks to our bug spotting champions
1349 Mike Benoit and Simon Kirby of NetNation for reporting this.
1350
1351 ----------------------------------------------------------------------
1352
1353 1.3.15. Version 2.7 and 2.7.1
1354
1355 This version fixes some very long standing issues and adds a few new
1356 features. If you are still running 2.6, upgrade yesterday. If you were
1357 running 2.6.1, an upgrade is still strongly advised.
33ccb468 1358
d16e0461
TP
1359 Features:
1360
1361 * The controlsocket is now readable and writable by the 'setgid' user.
1362 This allows for non-root access to PDNS which is nice for mrtg or
1363 cricket graphs.
33ccb468 1364
d16e0461
TP
1365 * MySQL backend (the non-generic one) gains the ability to read from a
1366 different table using the mysql-table setting.
33ccb468 1367
33ccb468 1368 * pipe backend now has a configurable timeout using the pipe-timeout
d16e0461
TP
1369 setting. Thanks fo Steve Bromwich for pointing out the need for this.
1370
33ccb468 1371 * Experimental backtraces. If PowerDNS crashes, it will log a lot of
1372 numbers and sometimes more to the syslog. If you see these, please
1373 report them to us. Only available under Linux.
1374
1375 Bugs:
1376
d16e0461
TP
1377 * 2.7 briefly broke the mysql backend, so don't use it if you use that.
1378 2.7.1 fixes this.
1379
33ccb468 1380 * SOA records could sometimes have the wrong TTL. Thanks to Jonas
1381 Daugaard for reporting this.
d16e0461
TP
1382
1383 * An ANY query might lead to duplicate SOA records being returned under
1384 exceptional circumstances. Thanks to Jonas Daugaard for reporting
33ccb468 1385 this.
33ccb468 1386
d16e0461
TP
1387 * Underlying the above bug, packet compression could sometimes suddenly
1388 be turned off, leading to overly large responses and non-removal of
1389 duplicate records.
1390
1391 * The allow-axfr-ips setting did not accept IP ranges (1.2.3.0/24) which
1392 the documentation claimed it did (thanks to Florus Both of Ascio
1393 technologies for being sufficiently persistent in reporting this).
1394
1395 * Killed backends were not being respawned, leading to suboptimal
1396 behaviour on intermittent database errors. Thanks to Steve Bromwich
1397 for reporting this.
1398
1399 * Corrupt packets during an incoming AXFR when acting as a slave would
1400 cause a PowerDNS reload instead of just failing that AXFR. Thanks to
1401 Mike Benoit and Simon Kirby of NetNation for reporting this.
1402
1403 * Label compression in incoming AXFR had problems with large offsets,
1404 causing the above mentioned errors. Thanks to Mike Benoit and Simon
1405 Kirby of NetNation for reporting this.
1406
1407 ----------------------------------------------------------------------
1408
1409 1.3.16. Version 2.6.1
33ccb468 1410
d16e0461 1411 Quick fix release for a big cache problem.
33ccb468 1412
d16e0461 1413 ----------------------------------------------------------------------
33ccb468 1414
d16e0461 1415 1.3.17. Version 2.6
33ccb468 1416
d16e0461
TP
1417 Performance release. A lot of work has been done to raise PDNS performance
1418 to staggering levels in order to take part in benchmarketing efforts.
1419 Together with our as yet unnamed partner, PDNS has been benchmarked at
1420 60.000 mostly cached queries/second on off the shelf PC hardware. Uncached
1421 performance was 17.000 uncached DNS queries/second on the .ORG domain.
33ccb468 1422
d16e0461
TP
1423 Performance has been increased by both making PDNS itself quicker but also
1424 by lowering the number of backend queries typically needed. Operators will
1425 typically see PDNS taking less CPU and the backend seeing less load.
33ccb468 1426
d16e0461
TP
1427 Furthermore, some real bugs were fixed. A couple of undocumented
1428 performance switches may appear in --help output but you are advised to
1429 stay away from these.
33ccb468 1430
d16e0461
TP
1431 Developers: this version needs the pdns-2.5.1 development kit, available
1432 on http://downloads.powerdns.com/releases/dev. See also Appendix C.
1433
1434 Performance:
1435
1436 * A big error in latency calculations - cached packets were weighed 50
1437 times less, leading to inflated latency reporting. Latency
1438 calculations are now correct and way lower - often in the microseconds
1439 range.
1440
1441 * It is now possible to run with 0 second cache TTLs. This used to cause
1442 very frequent cache cleanups, leading to performance degradation.
33ccb468 1443
33ccb468 1444 * Many tiny performance improvements, removing duplicate cache key
d16e0461
TP
1445 calculations, etc. The cache itself has also been reworked to be more
1446 efficient.
1447
1448 * First 'CNAME' backend query replaced by an 'ANY' query, which most of
1449 the time returns the actual record, preventing the need for a separate
1450 CNAME lookup, halving query load.
1451
33ccb468 1452 * Much of the same for same-level-NS records on queries needing
1453 delegation.
1454
1455 Bugs fixed:
1456
d16e0461
TP
1457 * Incidentally, the cache count would show 'unknown' packets, which was
1458 harmless but confusing. Thanks to Mike and Simon of NetNation for
1459 reporting this.
1460
33ccb468 1461 * SOA hostmaster with a . in the local-part would be cached wrongly,
1462 leading to a stray backslash in case of multiple successively SOA
1463 queries. Thanks to Ascio Techologies for spotting this bug.
d16e0461
TP
1464
1465 * zone2sql did not parse Verisign zonefiles correctly as these contained
1466 a $TTL statement in mid-record.
1467
1468 * Sometimes packets would not be accounted, leading to 'udp-queries' and
1469 'udp-answers' divergence.
33ccb468 1470
1471 Features:
1472
1473 * 'cricket' command added to init.d scripts that provides unadorned
1474 output for parsing by 'Cricket'.
33ccb468 1475
d16e0461 1476 ----------------------------------------------------------------------
33ccb468 1477
d16e0461 1478 1.3.18. Version 2.5.1
33ccb468 1479
d16e0461 1480 Brown paper bag release fixing a huge memory leak in the new Query Cache.
33ccb468 1481
d16e0461
TP
1482 Developers: this version needs the new pdns-2.5.1 development kit,
1483 available on http://downloads.powerdns.com/releases/dev. See also Appendix
1484 C.
1485
1486 And some small changes:
33ccb468 1487
1488 * Added support for RFC2038 compliant negative-answer caching. This
d16e0461
TP
1489 allows remotes to cache the fact that a domain does not exist and will
1490 not exist for a while. Thanks to Chris Thompson for pointing out how
1491 tiny our minds are. This feature may cause a noticeable reduction in
1492 query load.
1493
1494 * Small speedup to non-packet-cached queries, incidentally fixing the
1495 huge memory leak.
1496
33ccb468 1497 * pdns_control ccounts command outputs statistics on what is in the
1498 cache, which is useful to help optimize your caching strategy.
33ccb468 1499
d16e0461
TP
1500 ----------------------------------------------------------------------
1501
1502 1.3.19. Version 2.5
33ccb468 1503
d16e0461
TP
1504 An important release which has seen quite a lot of trial and error
1505 testing. As a result, PDNS can now run with a huge cache and concurrent
1506 invalidations. This is useful when running of a slower database or under
1507 high traffic load with a fast database.
33ccb468 1508
d16e0461
TP
1509 Furthermore, the gpgsql2 backend has been validated for use and will soon
1510 supplant the gpgsql backend entirely. This also bodes well for the gmysql
1511 backend which is the same code.
33ccb468 1512
d16e0461
TP
1513 Also, a large amount of issues biting large scale slave operators were
1514 addressed. Most of these issues would only show up after prolonged uptime.
33ccb468 1515
d16e0461 1516 New features:
33ccb468 1517
1518 * Query cache. The old Packet Cache only cached entire questions and
d16e0461
TP
1519 their answers. This is very CPU efficient but does not lead to maximum
1520 hitrate. Two packets both needing to resolve smtp.you.com internally
1521 would not benefit from any caching. Furthermore, many different DNS
1522 queries lead to the same backend queries, like 'SOA for .COM?'.
1523
1524 PDNS now also caches backend queries, but only those having no answer
1525 (the majority) and those having one answer (almost the rest).
1526
1527 In tests, these additional caches appear to halve the database backend
1528 load numerically and perhaps even more in terms of CPU load. Often,
1529 queries with no answer are more expensive than those having one.
1530
33ccb468 1531 The default ttls for the query-cache and negquery-cache are set to
d16e0461
TP
1532 safe values (20 and 60 seconds respectively), you should be seeing an
1533 improvement in behaviour without sacrificing a lot in terms of quick
1534 updates.
1535
33ccb468 1536 The webserver also displays the efficiency of the new Query Cache.
d16e0461
TP
1537
1538 The old Packet Cache is still there (and useful) but see Chapter 9 for
1539 more details.
1540
33ccb468 1541 * There is now the ability to shut off some logging at a very early
d16e0461
TP
1542 stage. High performance sites doing thousands of queries/second may in
1543 fact spend most of their CPU time on attempting to write out logging,
1544 even though it is ignored by syslog. The new flag log-dns-details, on
1545 by default, allows the operator to kill most informative-only logging
1546 before it takes any cpu.
1547
33ccb468 1548 * Flags which can be switched 'on' and 'off' can now also be set to
1549 'off' instead of only to 'no' to turn them off.
1550
1551 Enhancements:
1552
1553 * Packet Cache is now case insensitive, leading to a higher hitrate
d16e0461
TP
1554 because identical queries only differing in case now both match. Care
1555 is taken to restore the proper case in the answer sent out.
1556
33ccb468 1557 * Packet Cache stores packets more efficiently now, savings are
1558 estimated at 50%.
d16e0461
TP
1559
1560 * The Packet Cache is now asynchronous which means that PDNS continues
1561 to answer questions while the cache is busy being purged or queried.
1562 Incidentally this will mean a cache miss where previously the question
1563 would wait until the cache became available again.
1564
1565 The upshot of this is that operators can call pdns_control purge as
1566 often as desired without fearing performance loss. Especially the
1567 full, non-specific, purge was speeded up tremendously.
1568
33ccb468 1569 This optimization is of little merit for small sites but is very
d16e0461
TP
1570 important when running with a large packetcache, such as when using
1571 recursion under high load.
1572
1573 * AXFR log messages now all contain the word 'AXFR' to ease grepping.
1574
33ccb468 1575 * Linux static version now compiled with gcc 3.2 which is known to
1576 output better and faster code than the previously used 3.0.4.
1577
1578 Bugs fixed:
1579
d16e0461
TP
1580 * Packetcache would sometimes send packets back with slightly modified
1581 flags if these differed from the flags of the cached copy.
1582
33ccb468 1583 * Resolver code did bad things with filedescriptors leading to fd
d16e0461
TP
1584 exhaustion after prolonged uptimes and many slave SOA currency checks.
1585
1586 * Resolver code failed to properly log some errors, leading to operator
1587 uncertainty regarding to AXFR problems with remote masters.
1588
1589 * After prolonged uptime, slave code would try to use privileged ports
1590 for originating queries, leading to bad replication efficiency.
1591
1592 * Masters sending back answers in differing case from questions would
1593 lead to bogus 'Master tried to sneak in out-of-zone data' errors and
1594 failing AXFRs.
1595
1596 ----------------------------------------------------------------------
1597
1598 1.3.20. Version 2.4
1599
1600 Developers: this version is compatible with the pdns-2.1 development kit,
1601 available on http://downloads.powerdns.com/releases/dev. See also Appendix
1602 C.
1603
1604 This version fixes some stability issues with malformed or malcrafted
1605 packets. An upgrade is advised. Furthermore, there are interesting new
1606 features.
1607
1608 New features:
1609
1610 * Recursive queries are now also cached, but in a separate namespace so
1611 non-recursive queries don't get recursed answers and vice versa. This
1612 should mean way lower database load for sites running with the current
1613 default lazy-recursion. Up to now, each and every recursive query
1614 would lead to a large amount of SQL queries.
1615
33ccb468 1616 To prevent the packetcache from becoming huge, a separate
1617 recursive-cache-ttl can be specified.
d16e0461
TP
1618
1619 * The ability to change parameters at runtime was added. Currently, only
1620 the new query-logging flag can be changed.
1621
1622 * Added query-logging flag which hints a backend that it should output a
1623 textual representation of queries it receives. Currently only gmysql
1624 and gpgsql2 honor this flag.
1625
33ccb468 1626 * Gmysql backend can now also talk to PgSQL, leading to less code.
d16e0461
TP
1627 Currently, the old postgresql driver ('gpgsql') is still the default,
1628 the new driver is available as 'gpgsql2' and has the benefit that it
1629 does query logging. In the future, gpgsql2 will become the default
1630 gpgsql driver.
1631
1632 * DNS recursing proxy is now more verbose in logging odd events which
1633 may be caused by buggy recursing backends.
1634
33ccb468 1635 * Webserver now displays peak queries/second 1 minute average.
1636
1637 Bugs fixed:
1638
1639 * Failure to connect to database in master/slave communicator thread
1640 could lead to an unclean reload, fixed.
1641
1642 Documentation: added details for strict-rfc-axfrs. This feature can be
d16e0461
TP
1643 used if very old clients need to be able to do zone transfers with PDNS.
1644 Very slow.
1645
1646 ----------------------------------------------------------------------
33ccb468 1647
d16e0461 1648 1.3.21. Version 2.3
33ccb468 1649
d16e0461
TP
1650 Developers: this version is compatible with the pdns-2.1 development kit,
1651 available on http://downloads.powerdns.com/releases/dev. See also Appendix
1652 C.
33ccb468 1653
d16e0461
TP
1654 This release adds the Generic MySQL backend which allows full master/slave
1655 semantics with MySQL and InnoDB tables (or other tables that support
1656 transactions). See Section A.5.
33ccb468 1657
d16e0461 1658 Other new features:
33ccb468 1659
d16e0461
TP
1660 * Improved error messages in master/slave communicator will help down
1661 track problems.
1662
1663 * slave-cycle-interval setting added. Very large sites with thousands of
1664 slave domains may need to raise this value above the default of 60.
1665 Every cycle, domains in undeterminate state are checked for their
1666 condition. Depending on the health of the masters, this may entail
1667 many SOA queries or attempted AXFRs.
33ccb468 1668
1669 Bugs fixed:
1670
1671 * 'pdns_control purge domain' and 'pdns_control purge domain$' were
d16e0461
TP
1672 broken in version 2.2 and did not in fact purge the cache. There is a
1673 slight risk that domain-specific purge commands could force a reload
1674 in previous version. Thanks to Mike Benoit of NetNation for
33ccb468 1675 discovering this.
d16e0461 1676
33ccb468 1677 * Master/slave communicator thread got confused in case of delayed
1678 answers from slow masters. While not causing harm, this caused
1679 inefficient behaviour when testing large amounts of slave domains
d16e0461
TP
1680 because additional 'cycles' had to pass before all domains would have
1681 their status ascertained.
1682
33ccb468 1683 * Backends implementing special SOA semantics (currently only the
1684 undocumented 'pdns express backend', or homegrown backends) would
d16e0461
TP
1685 under some circumstances not answer the SOA record in case of an ANY
1686 query. This should put an end to the last DENIC problems. Thanks to
1687 DENIC for helping us find the problem.
33ccb468 1688
d16e0461 1689 ----------------------------------------------------------------------
33ccb468 1690
d16e0461
TP
1691 1.3.22. Version 2.2
1692
1693 Developers: this version is compatible with the pdns-2.1 development kit,
1694 available on http://downloads.powerdns.com/releases/dev. See also Appendix
1695 C.
1696
1697 Again a big release. PowerDNS is seeing some larger deployments in more
1698 demanding environments and these are helping shake out remaining issues,
1699 especially with recursing backends.
1700
1701 The big news is that wildcard CNAMEs are now supported, an oft requested
1702 feature and nearly the only part in which PDNS differed from BIND in
1703 authoritative capabilities.
1704
1705 If you were seeing signal 6 errors in PDNS causing reloads and
1706 intermittent service disruptions, please upgrade to this version.
1707
1708 For operators of PowerDNS Express trying to host .DE domains, the very
1709 special soa-serial-offset feature has been added to placate the new DENIC
1710 requirement that the SOA serial be at least six digits. PowerDNS Express
1711 uses the SOA serial as an actual serial and not to insert dates and hence
1712 often has single digit soa serial numbers, causing big problems with .DE
1713 redelegations.
1714
1715 Bugs fixed:
33ccb468 1716
d16e0461
TP
1717 * Malformed or shortened TCP recursion queries would cause a signal 6
1718 and a reload. Same for EOF from the TCP recursing backend. Thanks to
1719 Simon Kirby and Mike Benoit of NetNation for helping debug this.
33ccb468 1720
d16e0461
TP
1721 * Timeouts on the TCP recursing backend were far too long, leading to
1722 possible exhaustion of TCP resolving threads.
33ccb468 1723
d16e0461
TP
1724 * pdns_control purge domain accidentally cleaned all packets with that
1725 name as a prefix. Thanks to Simon Kirby for spotting this.
33ccb468 1726
d16e0461
TP
1727 * Improved exception error logging - in some circumstances PDNS would
1728 not properly log the cause of an exception, which hampered problem
1729 resolution.
33ccb468 1730
d16e0461
TP
1731 New features:
1732
1733 * Wildcard CNAMEs now work as expected!
1734
1735 * pdns_control purge can now also purge based on suffix, allowing
1736 operators to purge an entire domain from the packet cache instead of
1737 only specific records. See also Section B.1.1 Thanks to Mike Benoit
1738 for this suggestion.
33ccb468 1739
d16e0461
TP
1740 * soa-serial-offset for installations with small SOA serial numbers
1741 wishing to register .DE domains with DENIC which demands six-figure
1742 SOA serial numbers. See also Chapter 15.
1743
1744 ----------------------------------------------------------------------
1745
1746 1.3.23. Version 2.1
1747
1748 This is a somewhat bigger release due to pressing demands from customers.
1749 An upgrade is advised for installations using Recursion. If you are using
1750 recursion, it is vital that you are aware of changes in semantics.
1751 Basically, local data will now override data in your recursing backend
1752 under most circumstances. Old behaviour can be restored by turning
1753 lazy-recursion off.
1754
1755 Developers: this version has a new pdns-2.1 development kit, available on
1756 http://downloads.powerdns.com/releases/dev. See also Appendix C.
1757
1758 Warning Most users will run a static version of PDNS which has no
1759 dependencies on external libraries. However, some may need to run
1760 the dynamic version. This warning applies to these users.
1761
1762 To run the dynamic version of PDNS, which is needed for backend
1763 drivers which are only available in source form, gcc 3.0 is
1764 required. RedHat 7.2 comes with gcc 3.0 as an optional component,
1765 RedHat 7.3 does not. However, the RedHat 7.2 Update gcc rpms
1766 install just fine on RedHat 7.3. For Debian, we suggest running
1767 'woody' and installing the g++-3.0 package. We expect to release a
1768 FreeBSD dynamic version shortly.
33ccb468 1769
1770 Bugs fixed:
1771
d16e0461
TP
1772 * RPM releases sometimes overwrote previous configuration files. Thanks
1773 to Jorn Ekkelenkamp of Hubris/ISP Services for reporting this.
1774
33ccb468 1775 * TCP recursion sent out overly large responses due to a byteorder
d16e0461
TP
1776 mistake, confusing some clients. Thanks to the capable engineers of
1777 NetNation for bringing this to our attention.
1778
33ccb468 1779 * TCP recursion in combination with a recursing backend on a
1780 non-standard port did not work, leading to a non-functioning TCP
d16e0461
TP
1781 listener. Thanks to the capable engineers of NetNation for bringing
1782 this to our attention.
33ccb468 1783
1784 Unexpected behaviour:
1785
1786 * Wildcard URL records where not implemented because they are a
1787 performance penalty. To turn these on, enable wildcard-url in the
1788 configuration.
d16e0461
TP
1789
1790 * Unlike other nameservers, local data did not override the internet for
1791 recursing queries. This has mostly been brought into conformance with
1792 user expectations. If a recursive question can be answered entirely
1793 from local data, it is. To restore old behaviour, disable
1794 lazy-recursion. Also see Chapter 11.
33ccb468 1795
1796 Features:
1797
d16e0461
TP
1798 * Oracle support has been tuned, leading to the first public release of
1799 the Oracle backend. Zone2sql now outputs better SQL and the backend is
1800 now fully documented. Furthermore, the queries are compatible with the
1801 PowerDNS XML-RPC product, allowing PowerDNS express to run off Oracle.
1802 See Section A.6.
1803
1804 * Zone2sql now accepts --transactions to wrap zones in a transaction for
1805 PostgreSQL and Oracle output. This is a major speedup and also makes
1806 for better isolation of inserts. See Section 10.1.
1807
1808 * pdns_control now has the ability to purge the PowerDNS cache or parts
1809 of it. This enables operators to raise the TTL of the Packet Cache to
1810 huge values and only to invalidate the cache when changes are made.
1811 See also Chapter 9 and Section B.1.1.
1812
1813 ----------------------------------------------------------------------
1814
1815 1.3.24. Version 2.0.1
1816
1817 Maintenance release, fixing three small issues.
1818
1819 Developers: this version is compatible with 1.99.11 backends.
1820
1821 * PowerDNS ignored the logging-facility setting unless it was specified
1822 on the commandline. Thanks to Karl Obermayer from WebMachine
1823 Technologies for noticing this.
1824
1825 * Zone2sql neglected to preserve 'slaveness' of domains when converting
1826 to the slave capable PostgreSQL backend. Thanks to Mike Benoit of
1827 NetNation for reporting this. Zone2sql now has a --slave option.
1828
33ccb468 1829 * SOA Hostmaster addresses with dots in them before the @-sign were
1830 mis-encoded on the wire.
33ccb468 1831
d16e0461 1832 ----------------------------------------------------------------------
33ccb468 1833
d16e0461 1834 1.3.25. Version 2.0
33ccb468 1835
d16e0461 1836 Two bugfixes, one stability/security related. No new features.
33ccb468 1837
d16e0461 1838 Developers: this version is compatible with 1.99.11 backends.
33ccb468 1839
d16e0461
TP
1840 Bugfixes:
1841
1842 * zone2sql refused to work under some circumstances, taking 100% cpu and
1843 not functioning. Thanks to Andrew Clark and Mike Benoit for reporting
1844 this.
1845
1846 * Fixed a stability issue where malformed packets could force PDNS to
1847 reload. Present in all earlier 2.0 versions.
33ccb468 1848
d16e0461 1849 ----------------------------------------------------------------------
33ccb468 1850
d16e0461 1851 1.3.26. Version 2.0 Release Candidate 2
33ccb468 1852
d16e0461 1853 Mostly bugfixes, no really new features.
33ccb468 1854
d16e0461
TP
1855 Developers: this version is compatible with 1.99.11 backends.
1856
1857 Bugs fixed:
1858
1859 * chroot() works again - 2.0rc1 silently refused to chroot. Thanks to
1860 Hub Dohmen for noticing this.
33ccb468 1861
33ccb468 1862 * setuid() and setgid() security features were silently not being
1863 performed in 2.0rc1. Thanks to Hub Dohmen for noticing this.
d16e0461
TP
1864
1865 * MX preferences over 255 now work as intended. Thanks to Jeff Crowe for
1866 noticing this.
1867
1868 * IPv6 clients can now also benefit from the recursing backend feature.
1869 Thanks to Andy Furnell for proving beyond any doubt that this did not
1870 work.
1871
1872 * Extremely bogus code removed from DNS notification reception code -
1873 please test! Thanks to Jakub Jermar for working with us in figuring
1874 out just how broken this was.
1875
1876 * AXFR code improved to handle more of the myriad different zonetransfer
1877 dialects available. Specifically, interoperability with Bind 4 was
1878 improved, as well as Bind 8 in 'strict rfc conformance' mode. Thanks
1879 again for Jakub Jermar for running many tests for us. If your
1880 transfers failed with 'Unknown type 14!!' or words to that effect,
1881 this was it.
33ccb468 1882
1883 Features:
1884
1885 * Win32 version now has a zone2sql tool.
d16e0461 1886
33ccb468 1887 * Win32 version now has support for specifying how urgent messages
1888 should be before they go to the NT event log.
1889
1890 Remaining issues:
1891
1892 * One persistent report of the default 'chroot=./' configuration not
1893 working.
d16e0461
TP
1894
1895 * One report of disable-axfr and allow-axfr-ips not working as intended.
1896
1897 * Support for relative paths in zones and in Bind configuration is not
1898 bug-for-bug compatible with bind yet.
1899
1900 ----------------------------------------------------------------------
1901
1902 1.3.27. Version 2.0 Release Candidate 1
1903
1904 The MacOS X release! A very experimental OS X 10.2 build has been added.
1905 Furthermore, the Windows version is now in line with Unix with respect to
1906 capabilities. The ODBC backend now has the code to function as both a
1907 master and a slave.
1908
1909 Developers: this version is compatible with 1.99.11 backends.
1910
1911 * Implemented native packet response parsing code, allowing Windows to
1912 perform AXFR and NS and SOA queries.
1913
1914 * This is the first version for which we have added support for Darwin
1915 6.0, which is part of the forthcoming Mac OS X 10.2. Please note that
1916 although this version is marked RC1, that we have not done extensive
1917 testing yet. Consider this a technology preview.
1918
1919 * The Darwin version has been developed on Mac OS X 10.2 (6C35).
1920 Other versions may or may not work.
1921
1922 * Currently only the random, bind, mysql and pdns backends are
33ccb468 1923 included.
d16e0461
TP
1924
1925 * The menu based installer script does not work, you will have to
1926 edit pathconfig by hand as outlined in chapter 2.
1927
1928 * On Mac OS X Client, PDNS will fail to start because a system
33ccb468 1929 service is already bound to port 53.
d16e0461 1930
33ccb468 1931 This version is distributed as a compressed tar file. You should
1932 follow the generic UNIX installation instructions.
1933
1934 Bugs fixed:
1935
1936 * Zone2sql PostgreSQL mode neglected to lowercase $ORIGIN. Thanks to
1937 Maikel Verheijen of Ladot for spotting this.
d16e0461 1938
33ccb468 1939 * Zone2sql PostgreSQL mode neglected to remove a trailing dot from
d16e0461
TP
1940 $ORIGIN if present. Thanks to Thanks to Maikel Verheijen of Ladot for
1941 spotting this.
1942
33ccb468 1943 * Zonefile parser was not compatible with bind when $INCLUDING
d16e0461
TP
1944 non-absolute filenames. Thanks to Jeff Miller for working out how this
1945 should work.
33ccb468 1946
d16e0461
TP
1947 * Bind configuration parser was not compatible with bind when including
1948 non-absolute filenames. Thanks to Jeff Miller for working out how this
1949 should work.
1950
1951 * Documentation incorrectly listed the Bind backend as 'slave capable'.
1952 This is not yet true, now labeled 'experimental'.
1953
1954 Windows changes. We are indebted to Dimitry Andric who educated us in the
1955 ways of distributing Windows software.
33ccb468 1956
1957 * pdns.conf is now read if available.
d16e0461 1958
33ccb468 1959 * Console version responds to ^c now.
d16e0461 1960
33ccb468 1961 * Default pdns.conf added to distribution
d16e0461 1962
33ccb468 1963 * Uninstaller missed several files, leaving remnants behind
d16e0461 1964
33ccb468 1965 * DLLs are now installed locally, with the pdns executable.
d16e0461 1966
33ccb468 1967 * pdns_control is now also available on Windows
d16e0461 1968
33ccb468 1969 * ODBC backend can now act as master and slave. Experimental.
d16e0461 1970
33ccb468 1971 * The example zone missed indexes and had other faults.
33ccb468 1972
d16e0461
TP
1973 * A runtime DLL that is present on most windows systems (but not all!)
1974 was missing.
1975
1976 ----------------------------------------------------------------------
33ccb468 1977
d16e0461 1978 1.3.28. Version 1.99.12 Prerelease
33ccb468 1979
d16e0461
TP
1980 The Windows release! See Chapter 3. Beware, windows support is still very
1981 fresh and untested. Feedback is very welcome.
1982
1983 Developers: this version is compatible with 1.99.11 backends.
33ccb468 1984
1985 * Windows 2000 codebase merge completed. This resulted in quite some
1986 changes on the Unix end of things, so this may impact reliability
d16e0461
TP
1987
1988 * ODBC backend added for Windows. See Section A.10.
1989
1990 * IBM DB2 Universal Database backend available for Linux. See Section
1991 A.8.
1992
33ccb468 1993 * Zone2sql now understands $INCLUDE. Thanks to Amaze Internet for
1994 nagging about this
d16e0461 1995
33ccb468 1996 * The SOA Mininum TTL now has a configurable default
1997 (soa-minimum-ttl)value to placate the DENIC requirements.
d16e0461
TP
1998
1999 * Added a limit on the simultaneous numbers of TCP connections to accept
2000 (max-tcp-connections). Defaults to 10.
33ccb468 2001
2002 Bugs fixed:
2003
d16e0461
TP
2004 * When operating in virtual hosting mode (See Chapter 8), the additional
2005 init.d scripts would not function correctly and interface with other
2006 pdns instances.
2007
33ccb468 2008 * PDNS neglected to conserve case on answers. So a query for
2009 WwW.PoWeRdNs.CoM would get an answer listing the address of
d16e0461
TP
2010 www.powerdns.com. While this did not confuse resolvers, it is better
2011 to conserve case. This has semantical concequences for all backends,
2012 which the documentation now spells out.
2013
33ccb468 2014 * PostgreSQL backend was case sensitive and returned only answers in
d16e0461
TP
2015 case an exact match was found. The Generic PostgreSQL backend is now
2016 officially all lower case and zone2sql in PostgreSQL mode enforces
2017 this. Documentation has been been updated to reflect the case change.
2018 Thanks to Maikel Verheijen of Ladot for spotting this!
2019
33ccb468 2020 * Documentation bug - postgresql create/index statements created a
d16e0461
TP
2021 duplicate index. If you've previously copy pasted the commands and not
2022 noticed the error, execute CREATE INDEX rec_name_index ON
33ccb468 2023 records(name) to remedy. Thanks to Jeff Miller for reporting this.
2024 This also lead to depressingly slow 'ANY' lookups for those of you
2025 doing benchmarks.
2026
2027 Features:
2028
d16e0461
TP
2029 * pdns_control (see Section B.1.1) now opens the local end of its socket
2030 in /tmp instead of next to the remote socket (by default /var/run).
2031 This eases the way for allowing non-root access to pdns_control. When
2032 running chrooted (see Chapter 7), the local socket again moves back to
2033 /var/run.
33ccb468 2034
d16e0461 2035 * pdns_control now has a 'version' command. See Section B.1.1.
33ccb468 2036
d16e0461 2037 ----------------------------------------------------------------------
33ccb468 2038
d16e0461 2039 1.3.29. Version 1.99.11 Prerelease
33ccb468 2040
d16e0461
TP
2041 This release is important because it is the first release which is
2042 accompanied by an Open Source Backend Development Kit, allowing external
2043 developers to write backends for PDNS. Furthermore, a few bugs have been
2044 fixed:
33ccb468 2045
d16e0461
TP
2046 * Lines with only whitespace in zone files confused PDNS (thanks Henk
2047 Wevers)
33ccb468 2048
d16e0461
TP
2049 * PDNS did not properly parse TTLs with symbolic sufixes in zone files,
2050 ie 2H instead of 7200 (thanks Henk Wevers)
33ccb468 2051
d16e0461 2052 ----------------------------------------------------------------------
33ccb468 2053
d16e0461 2054 1.3.30. Version 1.99.10 Prerelease
33ccb468 2055
d16e0461
TP
2056 IMPORTANT: there has been a tiny license change involving free public
2057 webbased dns hosting, check out the changes before deploying!
2058
2059 PDNS is now feature complete, or very nearly so. Besides adding features,
2060 a lot of 'fleshing out' work is done now. There is an important
2061 performance bug fix which may have lead to disappointing benchmarks - so
2062 if you saw any of that, please try either this version or 1.99.8 which
2063 also does not have the bug.
2064
2065 This version has been very stable for us on multiple hosts, as was 1.99.9.
2066
2067 PostgreSQL users should be aware that while 1.99.10 works with the schema
2068 as presented in earlier versions, advanced features such as master or
2069 slave support will not work unless you create the new 'domains' table as
2070 well.
2071
2072 Bugs fixed:
2073
2074 * Wildcard AAAA queries sometimes received an NXDOMAIN error where they
2075 should have gotten an empty NO ERROR. Thanks to Jeroen Massar for
2076 spotting this on the .TK TLD!
2077
2078 * Do not disable the packetcache for 'recursion desired' packets unless
2079 a recursor was configured. Thanks to Greg Schueler for noticing this.
2080
2081 * A failing backend would not be reinstated. Thanks to 'Webspider' for
2082 discovering this problem with PostgreSQL connections that die after
2083 prolonged inactivity.
33ccb468 2084
33ccb468 2085 * Fixed loads of IPv6 transport problems. Thanks to Marco Davids and
2086 others for testing. Considered ready for production now.
d16e0461
TP
2087
2088 * Zone2sql printed a debugging statement on range $GENERATE commands.
2089 Thanks to Rene van Valkenburg for spotting this.
33ccb468 2090
2091 Features:
2092
2093 * PDNS can now act as a master, sending out notifications in case of
2094 changes and allowing slaves to AXFR. Big rewording of replication
2095 support, domains are now either 'native', 'master' or 'slave'. See
d16e0461
TP
2096 Chapter 13 for lots of details.
2097
2098 * Zone2sql in PostgreSQL mode now populates the 'domains' table for easy
2099 master, slave or native replication support.
2100
2101 * Ability to disable those annoying Windows DNS Dynamic Update messages
2102 from appearing in the log. See log-failed-updates in Chapter 15.
2103
33ccb468 2104 * Ability to run on IPv6 transport only
d16e0461
TP
2105
2106 * Logging can now happen under a 'facility' so all PDNS messages appear
2107 in their own file. See Section 6.3.
2108
2109 * Different OS releases of PDNS now get different install path defaults.
2110 Thanks to Mark Lastdrager for nagging about this and to Nero Imhard
2111 and Frederique Rijsdijk for suggesting saner defaults.
2112
33ccb468 2113 * Infrastructure for 'also-notify' statements added.
33ccb468 2114
d16e0461
TP
2115 ----------------------------------------------------------------------
2116
2117 1.3.31. Version 1.99.9 Early Access Prerelease
2118
2119 This is again a feature and an infrastructure release. We are nearly
2120 feature complete and will soon start work on the backends to make sure
2121 that they are all master, slave and 'superslave' capable.
2122
2123 Bugs fixed:
2124
2125 * PDNS sometimes sent out duplicate replies for packets passed to the
2126 recursing backend. Mostly a problem on SMP systems. Thanks to Mike
2127 Benoit for noticing this.
33ccb468 2128
d16e0461
TP
2129 * Out-of-bailiwick CNAMES (ie, a CNAME to a domain not in PDNS) caused a
2130 'ServFail' packet in 1.99.8, indicating failure, leading to hosts not
2131 resolving. Thanks to Martin Gillstrom for noticing this.
33ccb468 2132
d16e0461
TP
2133 * Zone2sql balked at zones editted under operating sytems terminating
2134 files with ^Z (Windows). Thanks Brian Willcott for reporting this.
33ccb468 2135
d16e0461
TP
2136 * PostgreSQL backend logged the password used to connect. Now only does
2137 so in case of failure to connect. Thanks to 'Webspider' for noticing
33ccb468 2138 this.
d16e0461 2139
33ccb468 2140 * Debian unstable distribution wrongly depended on home compiled
2141 PostgreSQL libraries. Thanks to Konrad Wojas for noticing this.
2142
2143 Features:
2144
d16e0461
TP
2145 * When operating as a slave, AAAA records are now supported in the zone.
2146 They were already supported in master zones.
2147
2148 * IPv6 transport support - PDNS can now listen on an IPv6 socket using
2149 the local-ipv6 setting.
2150
2151 * Very silly randombackend added which appears in the documentation as a
2152 sample backend. See Appendix C.
2153
2154 * When transferring a slave zone from a master, out of zone data is now
2155 rejected. Malicious operators might try to insert bad records
33ccb468 2156 otherwise.
d16e0461 2157
33ccb468 2158 * 'Supermaster' support for automatic provisioning from masters. See
d16e0461
TP
2159 Section 13.2.1.
2160
33ccb468 2161 * Recursing backend can now live on a non-standard (!=53) port. See
d16e0461
TP
2162 Chapter 11.
2163
2164 * Slave zone retrieval is now queued instead of immediate, which scales
2165 better and is more resilient to temporary failures.
2166
33ccb468 2167 * max-queue-length parameter. If this many packets are queued for
2168 database attention, consider the situation hopeless and respawn.
2169
2170 Internal:
2171
d16e0461
TP
2172 * SOA records are now 'special' and each backend can optionally generate
2173 them in special ways. PostgreSQL backend does so when operating as a
2174 slave.
2175
2176 * Writing backends is now a lot easier. See Appendix C.
2177
2178 * Added Bindbackend to internal regression tests, confirming that it is
2179 compliant.
2180
2181 ----------------------------------------------------------------------
2182
2183 1.3.32. Version 1.99.8 Early Access Prerelease
2184
2185 A lot of infrastructure work gearing up to 2.0. Some stability bugs fixed
2186 and a lot of new features.
2187
2188 Bugs fixed:
33ccb468 2189
d16e0461
TP
2190 * Bindbackend was overly complex and crashed on some systems on startup.
2191 Simplified launch code.
33ccb468 2192
d16e0461
TP
2193 * SOA fields were not always properly filled in, causing default values
2194 to go out on the wire
33ccb468 2195
d16e0461
TP
2196 * Obscure bug triggered by malicious packets (we know who you are) in
2197 SOA finding code fixed.
33ccb468 2198
33ccb468 2199 * Magic serial number calculation contained a double free leading to
2200 instability.
d16e0461 2201
33ccb468 2202 * Standards violation, questions for domains for which PDNS was
2203 unauthoritative now get a SERVFAIL answer. Thanks to the IETF
2204 Namedroppers list for helping out with this.
d16e0461
TP
2205
2206 * Slowly launching backends were being relaunched at a great rate when
2207 queries were coming in while launching backends.
2208
33ccb468 2209 * MySQL-on-unix-domain-socket on SMP systems was overwhelmed by the
2210 quick connection rate on launch, inserted a small 50ms delay.
d16e0461
TP
2211
2212 * Some SMP problems appear to be compiler related. Shifted to GCC 3.0.4
2213 for Linux.
2214
33ccb468 2215 * Ran ispell on documentation.
2216
2217 Feature enhancements:
2218
d16e0461
TP
2219 * Recursing backend. See Chapter 11. Allows recursive and authoritative
2220 DNS on the same IP address.
2221
2222 * NAPTR support, which is especially useful for the ENUM/E.164
33ccb468 2223 community.
d16e0461
TP
2224
2225 * Zone transfers can now be allowed per netmask instead of only per IP
2226 address.
2227
33ccb468 2228 * Preliminary support for slave operation included. Only for the
d16e0461
TP
2229 adventurous right now! See Section 13.2
2230
2231 * All record types now documented, see Chapter 17.
2232
2233 ----------------------------------------------------------------------
2234
2235 1.3.32.1. Known bugs
33ccb468 2236
d16e0461 2237 Wildcard CNAMES do not work as they do with bind.
33ccb468 2238
d16e0461
TP
2239 Recursion sometimes sends out duplicate packets (fixed in 1.99.9
2240 snapshots)
33ccb468 2241
d16e0461 2242 Some stability issues which are caught by the guardian
33ccb468 2243
d16e0461 2244 ----------------------------------------------------------------------
33ccb468 2245
d16e0461 2246 1.3.32.2. Missing features
33ccb468 2247
d16e0461
TP
2248 Features present in this document, but disabled or withheld from the
2249 current release:
33ccb468 2250
2251 * gmysqlbackend, oraclebackend
33ccb468 2252
d16e0461 2253 ----------------------------------------------------------------------
33ccb468 2254
d16e0461 2255 1.3.33. Version 1.99.7 Early Access Prerelease
33ccb468 2256
d16e0461
TP
2257 Named.conf parsing got a lot of work and many more bind configurations can
2258 now be parsed. Furthermore, error reporting was improved. Stability is
2259 looking good.
2260
2261 Bugs fixed:
33ccb468 2262
2263 * Bind parser got confused by filenames with underscores and colons.
d16e0461 2264
33ccb468 2265 * Bind parser got confused by spaces in quoted names
d16e0461 2266
33ccb468 2267 * FreeBSD version now stops and starts when instructed to do so.
d16e0461 2268
33ccb468 2269 * Wildcards were off by default, which violates standards. Now on by
2270 default.
d16e0461 2271
33ccb468 2272 * --oracle was broken in zone2sql
2273
2274 Feature enhancements:
2275
2276 * Line number counting goes on as it should when including files in
2277 named.conf
d16e0461 2278
33ccb468 2279 * Added --no-config to enable users to start the pdns daemon without
2280 parsing the configuration file.
d16e0461
TP
2281
2282 * zone2sql now has --bare for unformatted output which can be used to
2283 generate insert statements for different database layouts
2284
2285 * zone2sql now has --gpgsql, which is an alias for --mysql, to output in
2286 a format useful for the default Generic PgSQL backend
2287
33ccb468 2288 * zone2sql is now documented.
33ccb468 2289
d16e0461
TP
2290 ----------------------------------------------------------------------
2291
2292 1.3.33.1. Known bugs
2293
2294 Wildcard CNAMES do not work as they do with bind.
33ccb468 2295
d16e0461 2296 ----------------------------------------------------------------------
33ccb468 2297
d16e0461 2298 1.3.33.2. Missing features
33ccb468 2299
d16e0461
TP
2300 Features present in this document, but disabled or withheld from the
2301 current release:
33ccb468 2302
2303 * gmysqlbackend, oraclebackend
2304
d16e0461 2305 Some of these features will be present in newer releases.
33ccb468 2306
d16e0461 2307 ----------------------------------------------------------------------
33ccb468 2308
d16e0461 2309 1.3.34. Version 1.99.6 Early Access Prerelease
33ccb468 2310
d16e0461
TP
2311 This version is now running on dns-eu1.powerdns.net and working very well
2312 for us. But please remain cautious before deploying!
2313
2314 Bugs fixed:
33ccb468 2315
2316 * Webserver neglected to show log messages
d16e0461 2317
33ccb468 2318 * TCP question/answer miscounted multiple questions over one socket.
2319 Fixed misnaming of counter
d16e0461 2320
33ccb468 2321 * Packetcache now detects clock skew and times out entries
d16e0461
TP
2322
2323 * named.conf parser now reports errors with line number and offending
2324 token
2325
33ccb468 2326 * Filenames in named.conf can now contain :
2327
2328 Feature enhancements:
2329
2330 * The webserver now by default does not print out configuration
2331 statements, which might contain database backends. Use
2332 webserver-print-arguments to restore the old behaviour.
d16e0461 2333
33ccb468 2334 * Generic PostgreSQL backend is now included. Still rather beta.
33ccb468 2335
d16e0461
TP
2336 ----------------------------------------------------------------------
2337
2338 1.3.34.1. Known bugs
33ccb468 2339
d16e0461 2340 FreeBSD version does not stop when requested to do so.
33ccb468 2341
d16e0461 2342 Wildcard CNAMES do not work as they do with bind.
33ccb468 2343
d16e0461 2344 ----------------------------------------------------------------------
33ccb468 2345
d16e0461
TP
2346 1.3.34.2. Missing features
2347
2348 \r Features present in this document, but disabled or withheld from the
2349 current release:
33ccb468 2350
2351 * gmysqlbackend, oraclebackend
2352
d16e0461
TP
2353 Some of these features will be present in newer releases.
2354
2355 ----------------------------------------------------------------------
33ccb468 2356
d16e0461 2357 1.3.35. Version 1.99.5 Early Access Prerelease
33ccb468 2358
d16e0461
TP
2359 The main focus of this release is stability and TCP improvements. This is
2360 the first release PowerDNS-the-company actually considers for running on
2361 its production servers!
33ccb468 2362
d16e0461 2363 Major bugs fixed:
33ccb468 2364
2365 * Zone2sql received a floating point division by zero error on
2366 named.confs with less than 100 domains.
d16e0461
TP
2367
2368 * Huffman encoder failed without specific error on illegal characters in
2369 a domain
2370
33ccb468 2371 * Fixed huge memory leaks in TCP code.
d16e0461 2372
33ccb468 2373 * Removed further file descriptor leaks in guardian respawning code
d16e0461 2374
33ccb468 2375 * Pipebackend was too chatty.
d16e0461 2376
33ccb468 2377 * pdns_server neglected to close fds 0, 1 & 2 when daemonizing
2378
2379 Feature enhancements:
2380
2381 * bindbackend can be instructed not to check the ctime of a zone by
2382 specifying bind-check-interval=0, which is also the new default.
d16e0461 2383
33ccb468 2384 * pdns_server --list-modules lists all available modules.
2385
2386 Performance enhancements:
2387
2388 * TCP code now only creates a new database connection for AXFR.
33ccb468 2389
d16e0461
TP
2390 * TCP connections timeout rather quickly now, leading to less load on
2391 the server.
33ccb468 2392
d16e0461 2393 ----------------------------------------------------------------------
33ccb468 2394
d16e0461 2395 1.3.35.1. Known bugs
33ccb468 2396
d16e0461 2397 FreeBSD version does not stop when requested to do so.
33ccb468 2398
d16e0461
TP
2399 Wildcard CNAMES do not work as they do with bind.
2400
2401 ----------------------------------------------------------------------
2402
2403 1.3.35.2. Missing features
2404
2405 \r Features present in this document, but disabled or withheld from the
2406 current release:
33ccb468 2407
2408 * gmysqlbackend, oraclebackend, gpgsqlbackend
2409
d16e0461
TP
2410 Some of these features will be present in newer releases.
2411
2412 ----------------------------------------------------------------------
33ccb468 2413
d16e0461 2414 1.3.36. Version 1.99.4 Early Access Prerelease
33ccb468 2415
d16e0461
TP
2416 A lot of new named.confs can now be parsed, zone2sql & bindbackend have
2417 gained features and stability.
33ccb468 2418
d16e0461 2419 Major bugs fixed:
33ccb468 2420
2421 * Label compression was not always enabled, leading to large reply
2422 packets sometimes.
d16e0461 2423
33ccb468 2424 * Database errors on TCP server lead to a nameserver reload by the
2425 guardian.
d16e0461 2426
33ccb468 2427 * MySQL backend neglected to close its connection properly.
d16e0461 2428
33ccb468 2429 * BindParser miss parsed some IP addresses and netmasks.
d16e0461
TP
2430
2431 * Truncated answers were also truncated on the packetcache, leading to
2432 truncated TCP answers.
33ccb468 2433
2434 Feature enhancements:
2435
2436 * Zone2sql and the bindbackend now understand the Bind $GENERATE{}
2437 syntax.
d16e0461 2438
33ccb468 2439 * Zone2sql can optionally gloss over non-existing zones with
2440 --on-error-resume-next.
d16e0461
TP
2441
2442 * Zone2sql and the bindbackend now properly expand @ also on the right
2443 hand side of records.
2444
33ccb468 2445 * Zone2sql now sets a default TTL.
d16e0461 2446
33ccb468 2447 * DNS UPDATEs and NOTIFYs are now logged properly and sent the right
2448 responses.
2449
2450 Performance enhancements:
2451
d16e0461
TP
2452 * 'Fancy records' are no longer queried for on ANY queries - this is a
2453 big speedup.
33ccb468 2454
d16e0461 2455 ----------------------------------------------------------------------
33ccb468 2456
d16e0461 2457 1.3.36.1. Known bugs
33ccb468 2458
d16e0461 2459 FreeBSD version does not stop when requested to do so.
33ccb468 2460
d16e0461 2461 Zone2sql refuses named.confs with less than 100 domains.
33ccb468 2462
d16e0461 2463 Wildcard CNAMES do not work as they do with bind.
33ccb468 2464
d16e0461
TP
2465 ----------------------------------------------------------------------
2466
2467 1.3.36.2. Missing features
2468
2469 \r Features present in this document, but disabled or withheld from the
2470 current release:
33ccb468 2471
2472 * gmysqlbackend, oraclebackend, gpgsqlbackend
2473
d16e0461 2474 Some of these features will be present in newer releases.
33ccb468 2475
d16e0461 2476 ----------------------------------------------------------------------
33ccb468 2477
d16e0461 2478 1.3.37. Version 1.99.3 Early Access Prerelease
33ccb468 2479
d16e0461
TP
2480 The big news in this release is the BindBackend which is now capable of
2481 parsing many more named.conf Bind configurations. Furthermore, PDNS has
2482 successfully parsed very large named.confs with large numbers of small
2483 domains, as well as small numbers of large domains (TLD).
33ccb468 2484
d16e0461
TP
2485 Zone transfers are now also much improved.
2486
2487 Major bugs fixed:
33ccb468 2488
2489 * zone2sql leaked file descriptors on each domain, used wrong Bison
d16e0461
TP
2490 recursion leading to parser stack overflows. This limited the amount
2491 of domains that could be parsed to 1024.
2492
2493 * zone2sql can now read all known zonefiles, with the exception of those
2494 containing $GENERATE
2495
33ccb468 2496 * Guardian relaunching a child lost two file descriptors
d16e0461 2497
33ccb468 2498 * Don't die on a connection reset by peer during zone transfer.
d16e0461 2499
33ccb468 2500 * Webserver does not crash anymore on ringbuffer resize
2501
2502 Feature enhancements:
2503
2504 * AXFR can now be disabled, and re-enabled per IP address
d16e0461
TP
2505
2506 * --help accepts a parameter, will then show only help items with that
2507 prefix.
2508
33ccb468 2509 * zone2sql now accepts a --zone-name parameter
d16e0461 2510
33ccb468 2511 * BindBackend maturing - 9500 zones parsed in 3.5 seconds. No longer
2512 case sensitive.
2513
2514 Performance enhancements:
2515
d16e0461
TP
2516 * Implemented RFC-breaking AXFR format (which is the industry standard).
2517 Zone transfers now zoom along at wirespeed (many megabits/s).
2518
2519 ----------------------------------------------------------------------
2520
2521 1.3.37.1. Known bugs
33ccb468 2522
d16e0461 2523 FreeBSD version does not stop when requested to do so.
33ccb468 2524
d16e0461 2525 BindBackend cannot parse zones with $GENERATE statements.
33ccb468 2526
d16e0461 2527 ----------------------------------------------------------------------
33ccb468 2528
d16e0461 2529 1.3.37.2. Missing features
33ccb468 2530
d16e0461
TP
2531 \r Features present in this document, but disabled or withheld from the
2532 current release:
33ccb468 2533
2534 * gmysqlbackend, oraclebackend, gpgsqlbackend
2535
d16e0461 2536 Some of these features will be present in newer releases.
33ccb468 2537
d16e0461 2538 ----------------------------------------------------------------------
33ccb468 2539
d16e0461
TP
2540 1.3.38. Version 1.99.2 Early Access Prerelease
2541
2542 Major bugs fixed:
33ccb468 2543
2544 * Database backend reload does not hang the daemon anymore
d16e0461
TP
2545
2546 * Buffer overrun in local socket address initialisation may have caused
2547 binding problems
2548
33ccb468 2549 * setuid changed the uid to the gid of the selected user
33ccb468 2550
d16e0461
TP
2551 * zone2sql doesn't coredump on invocation anymore. Fixed lots of small
2552 issues.
2553
2554 * Don't parse configuration file when creating configuration file. This
2555 was a problem with reinstalling.
2556
2557 Performance improvements:
33ccb468 2558
2559 * removed a lot of unnecessary gettimeofday calls
d16e0461 2560
33ccb468 2561 * removed needless select(2) call in case of listening on only one
2562 address
d16e0461 2563
33ccb468 2564 * removed 3 useless syscalls in the fast path
2565
2566 Having said that, more work may need to be done. Testing on a 486 saw
d16e0461
TP
2567 packet rates in a simple setup (question/wait/answer/question..) improve
2568 from 200 queries/second to over 400.
33ccb468 2569
2570 Usability improvements:
2571
2572 * Fixed error checking in init.d script (show, mrtg)
d16e0461 2573
33ccb468 2574 * Added 'uptime' to the mrtg output
d16e0461
TP
2575
2576 * removed further GNUisms from installer and init.d scripts for use on
2577 FreeBSD
2578
33ccb468 2579 * Debian package and apt repository, thanks to Wichert Akkerman.
d16e0461 2580
33ccb468 2581 * FreeBSD /usr/ports, thanks to Peter van Dijk (in progress).
2582
2583 Stability may be an issue as well as performance. This version has a
2584 tendency to log a bit too much which slows the nameserver down a lot.
33ccb468 2585
d16e0461
TP
2586 ----------------------------------------------------------------------
2587
2588 1.3.38.1. Known bugs
33ccb468 2589
d16e0461
TP
2590 Decreasing a ringbuffer on the website is a sure way to crash the daemon.
2591 Zone2sql, while improved, still has problems with a zone in the following
2592 format:
33ccb468 2593
d16e0461
TP
2594 name IN A 1.2.3.4
2595 IN A 1.2.3.5
2596
33ccb468 2597
d16e0461 2598 To fix, add 'name' to the second line.
33ccb468 2599
2600 Zone2sql does not close filedescriptors.
2601
d16e0461
TP
2602 \r
2603
33ccb468 2604 FreeBSD version does not stop when requested via the init.d script.
33ccb468 2605
d16e0461
TP
2606 \r
2607
2608 ----------------------------------------------------------------------
33ccb468 2609
d16e0461
TP
2610 1.3.38.2. Missing features
2611
2612 Features present in this document, but disabled or withheld from the
2613 current release:
33ccb468 2614
2615 * gmysqlbackend, oraclebackend, gpgsqlbackend
d16e0461 2616
33ccb468 2617 * fully functioning bindbackend - will try to parse named.conf, but
2618 probably fail
2619
d16e0461 2620 Some of these features will be present in newer releases.
33ccb468 2621
d16e0461 2622 ----------------------------------------------------------------------
33ccb468 2623
d16e0461 2624 1.3.39. Version 1.99.1 Early Access Prerelease
33ccb468 2625
d16e0461
TP
2626 This is the first public release of what is going to become PDNS 2.0. As
2627 such, it is not of production quality. Even PowerDNS-the-company does not
2628 run this yet.
33ccb468 2629
d16e0461
TP
2630 Stability may be an issue as well as performance. This version has a
2631 tendency to log a bit too much which slows the nameserver down a lot.
2632
2633 ----------------------------------------------------------------------
2634
2635 1.3.39.1. Known bugs
33ccb468 2636
d16e0461
TP
2637 Decreasing a ringbuffer on the website is a sure way to crash the daemon.
2638 Zone2sql is very buggy.
33ccb468 2639
d16e0461 2640 ----------------------------------------------------------------------
33ccb468 2641
d16e0461
TP
2642 1.3.39.2. Missing features
2643
2644 Features present in this document, but disabled or withheld from the
2645 current release:
33ccb468 2646
2647 * gmysqlbackend, oraclebackend, gpgsqlbackend
d16e0461 2648
33ccb468 2649 * fully functioning bindbackend - will not parse configuration files
2650
d16e0461
TP
2651 Some of these features will be present in newer releases.
2652
2653 ----------------------------------------------------------------------
33ccb468 2654
26551.4. Security
2656
d16e0461
TP
2657 As of the 8th of January 2003, no actual security problems with PowerDNS
2658 2.9.4 or later are known about. This page will be updated with all bugs
2659 which are deemed to be security problems, or could conceivably lead to
2660 those. Any such notifications will also be sent to all PowerDNS
2661 mailinglists and BUGTRAQ.
2662
2663 All versions of PowerDNS before 2.9 are known to suffer from remote denial
2664 of service problems which can disrupt operation. Please upgrade to 2.9.4
2665 as this page will only contain detailed security information from 2.9.4
2666 onwards.
33ccb468 2667
d16e0461
TP
2668 If you have a security problem to report, please email us at both
2669 <powerdns@powerdns.com> and at <ahu@ds9a.nl>. We adhere to the Rain Forest
2670 Puppy Full Disclosure Policy (RFPolicy) v2.0 and we ask you to do the
2671 same.
33ccb468 2672
d16e0461
TP
2673 We remind PowerDNS users that under the terms of the GNU General Public
2674 License, PowerDNS comes with ABSOLUTELY NO WARRANTY. This license is
2675 included in the distribution and in this documentation, see Appendix E.
33ccb468 2676
d16e0461 2677 ----------------------------------------------------------------------
33ccb468 2678
26791.5. Acknowledgements
2680
d16e0461 2681 PowerDNS is grateful for the help of the following people or institutions:
33ccb468 2682
2683 * Dave Aaldering
d16e0461 2684
33ccb468 2685 * Wichert Akkerman
d16e0461 2686
33ccb468 2687 * Antony Antony
d16e0461 2688
33ccb468 2689 * Mike Benoit (NetNation Communication Inc.)
d16e0461 2690
33ccb468 2691 * Peter van Dijk
d16e0461 2692
33ccb468 2693 * Koos van den Hout
d16e0461 2694
33ccb468 2695 * Andre Koopal
d16e0461 2696
33ccb468 2697 * Eric Veldhuyzen
d16e0461 2698
33ccb468 2699 * Paul Wouters
d16e0461 2700
33ccb468 2701 * Thomas Wouters
d16e0461 2702
33ccb468 2703 * IETF Namedroppers mailinglist
2704
d16e0461
TP
2705 Thanks!
2706
2707 (these people don't share the blame for any errors or mistakes in powerdns
2708 - those are all ours)
2709
2710 ----------------------------------------------------------------------
33ccb468 2711
d16e0461 2712 Chapter 2. Installing on Unix
33ccb468 2713
d16e0461
TP
2714 You will typically install PDNS > 2.9 via source or via a package. Earlier
2715 versions used a clumsy binary installer.
33ccb468 2716
d16e0461 2717 ----------------------------------------------------------------------
33ccb468 2718
27192.1. Possible problems at this point
2720
d16e0461 2721 At this point some things may have gone wrong. Typical errors include:
33ccb468 2722
d16e0461
TP
2723 error while loading shared libraries: libstdc++.so.x: cannot open shared
2724 object file: No such file or directory
2725
2726 Errors looking like this indicate a mismatch between your PDNS
2727 distribution and your Unix operating system. Download the static
2728 PDNS distribution for your operating system and try again. Please
2729 contact <pdns@powerdns.com> if this is impractical.
2730
2731 ----------------------------------------------------------------------
33ccb468 2732
27332.2. Testing your install
2734
d16e0461
TP
2735 After installing, it is a good idea to test the basic functionality of the
2736 software before configuring database backends. For this purpose, PowerDNS
2737 contains the 'bindbackend' which has a domain built in example.com, which
2738 is officially reserved for testing. To test, edit pdns.conf and add the
2739 following if not already present:
2740
2741 launch=bind
2742 bind-example-zones
2743
2744
2745 This configures powerdns to 'launch' the bindbackend, and enable the
2746 example zones. To fire up PDNS in testing mode, execute: /etc/init.d/pdns
2747 monitor, where you may have to substitute the location of your SysV init.d
2748 location you specified earlier. In monitor mode, the pdns process runs in
2749 the foreground and is very verbose, which is perfect for testing your
2750 install. If everything went all right, you can query the example.com
2751 domain like this:
2752
2753 host www.example.com 127.0.0.1
2754
2755
2756 www.example.com should now have IP address 1.2.3.4. The host command can
2757 usually be found in the dnsutils package of your operating system.
2758 Alternate command is: dig www.example.com A @127.0.0.1 or even nslookup
2759 www.example.com 127.0.0.1, although nslookup is not advised for DNS
2760 diagnostics.
33ccb468 2761
2762 * example.com SOA record
d16e0461 2763
33ccb468 2764 * example.com NS record pointing to ns1.example.com
d16e0461 2765
33ccb468 2766 * example.com NS record pointing to ns2.example.com
d16e0461 2767
33ccb468 2768 * example.com MX record pointing to mail.example.com
d16e0461 2769
33ccb468 2770 * example.com MX record pointing to mail1.example.com
d16e0461 2771
33ccb468 2772 * mail.example.com A record pointing to 4.3.2.1
d16e0461 2773
33ccb468 2774 * mail1.example.com A record pointing to 5.4.3.2
d16e0461 2775
33ccb468 2776 * ns1.example.com A record pointing to 4.3.2.1
d16e0461 2777
33ccb468 2778 * ns2.example.com A record pointing to 5.4.3.2
d16e0461 2779
33ccb468 2780 * host-0 to host-9999.example.com A record pointing to 2.3.4.5
2781
d16e0461
TP
2782 When satisfied that basic functionality is there, type QUIT to exit the
2783 monitor mode. The adventurous may also type SHOW * to see some internal
2784 statistics. In case of problems, you will want to read the following
2785 section.
2786
2787 ----------------------------------------------------------------------
33ccb468 2788
d16e0461 2789 2.2.1. Typical errors
33ccb468 2790
d16e0461 2791 At this point some things may have gone wrong. Typical errors include:
33ccb468 2792
2793 binding to UDP socket: Address already in use
d16e0461
TP
2794
2795 This means that another nameserver is listening on port 53
2796 already. You can resolve this problem by determining if it is safe
2797 to shutdown the nameserver already present, and doing so. If
2798 uncertain, it is also possible to run PDNS on another port. To do
2799 so, add local-port=5300 to pdns.conf, and try again. This however
2800 implies that you can only test your nameserver as clients expect
2801 the nameserver to live on port 53.
33ccb468 2802
2803 binding to UDP socket: Permission denied
d16e0461
TP
2804
2805 You must be superuser in order to be able to bind to port 53. If
2806 this is not a possibility, it is also possible to run PDNS on
2807 another port. To do so, add local-port=5300 to pdns.conf, and try
2808 again. This however implies that you can only test your nameserver
2809 as clients expect the nameserver to live on port 53.
33ccb468 2810
2811 Unable to launch, no backends configured for querying
d16e0461
TP
2812
2813 PDNS did not find the launch=bind instruction in pdns.conf.
33ccb468 2814
2815 Multiple IP addresses on your server, PDNS sending out answers on the
d16e0461
TP
2816 wrong one, Massive amounts of 'recvfrom gave error, ignoring: Connection
2817 refused'
2818
2819 If you have multiple IP addresses on the internet on one machine,
2820 UNIX often sends out answers over another interface than which the
2821 packet came in on. In such cases, use local-address to bind to
2822 specific IP addresses, which can be comma separated. The second
2823 error comes from remotes disregarding answers to questions it
2824 didn't ask to that IP address and sending back ICMP errors.
2825
2826 ----------------------------------------------------------------------
33ccb468 2827
28282.3. Running PDNS on unix
2829
d16e0461
TP
2830 PDNS is normally controlled via a SysV-style init.d script, often located
2831 in /etc/init.d or /etc/rc.d/init.d. This script accepts the following
2832 commands:
33ccb468 2833
2834 monitor
d16e0461
TP
2835
2836 Monitor is a special way to view the daemon. It executes PDNS in
2837 the foreground with a lot of logging turned on, which helps in
2838 determining startup problems. Besides running in the foreground,
2839 the raw PDNS control socket is made available. All external
2840 communication with the daemon is normally sent over this socket.
2841 While useful, the control console is not an officially supported
2842 feature. Commands which work are: QUIT, SHOW *, SHOW varname,
2843 RPING.
33ccb468 2844
2845 start
d16e0461
TP
2846
2847 Start PDNS in the background. Launches the daemon but makes no
2848 special effort to determine success, as making database
2849 connections may take a while. Use status to query success. You can
2850 safely run start many times, it will not start additional PDNS
2851 instances.
33ccb468 2852
2853 restart
d16e0461
TP
2854
2855 Restarts PDNS if it was running, starts it otherwise.
33ccb468 2856
2857 status
d16e0461
TP
2858
2859 Query PDNS for status. This can be used to figure out if a launch
2860 was successful. The status found is prefixed by the PID of the
2861 main PDNS process.
33ccb468 2862
2863 stop
d16e0461
TP
2864
2865 Requests that PDNS stop. Again, does not confirm success. Success
2866 can be ascertained with the status command.
33ccb468 2867
2868 dump
d16e0461
TP
2869
2870 Dumps a lot of statistics of a running PDNS daemon. It is also
2871 possible to single out specific variable by using the show
2872 command.
33ccb468 2873
2874 show variable
d16e0461
TP
2875
2876 Show a single statistic, as present in the output of the dump.
33ccb468 2877
2878 mrtg
33ccb468 2879
d16e0461 2880 See the performance monitoring Chapter 6.
33ccb468 2881
d16e0461 2882 ----------------------------------------------------------------------
33ccb468 2883
d16e0461 2884 Chapter 3. Installing on Microsoft Windows
33ccb468 2885
d16e0461
TP
2886 Note PowerDNS support for Windows is, as of 1.99.12, very recent and
2887 therefore quite 'beta'. For reliability, we currently advise the use
2888 of the Unix versions. Furthermore there is no support for master or
2889 slave operation in the ODBC backend, which is the only one provided
2890 currently. This will be fixed soon.
2891
2892 As of 1.99.12, PowerDNS supports Windows natively. PDNS can act as an NT
2893 service and works with any ODBC drivers you may have.
33ccb468 2894
2895 To install PowerDNS for Windows you should check if your PC meets the
2896 following requirements:
2897
d16e0461
TP
2898 * A PC running Microsoft NT (with a recent servicepack and at least mdac
2899 2.5), 2000 or XP.
33ccb468 2900
d16e0461
TP
2901 * An ODBC source containing valid zone information (an example MS Access
2902 database is supplied in the form of powerdns.mdb).
33ccb468 2903
d16e0461
TP
2904 If your system meets these requirements, download the installer from
2905 http://www.powerdns.com/pdns/. After downloading the file begin the
2906 installation procedure by starting powerdns-VERSION.exe.
33ccb468 2907
d16e0461
TP
2908 After installing the software you should create a valid ODBC source. To do
2909 this you have open the ODBC sources dialog: Start->Settings->Control
2910 Panel->Administrative Tools->Data Sources (ODBC).
33ccb468 2911
d16e0461
TP
2912 We'll use the example zone database that is included in the installation
2913 to explain how to create a source.
33ccb468 2914
d16e0461 2915 \r When you are in the ODBC sources dialog you activate the System DSN tab.
33ccb468 2916
d16e0461
TP
2917 Note It is important to create a System DSN instead of an User DNS,
2918 otherwise the ODBC backend cannot function.
33ccb468 2919
2920 Press Add..., then you have to select a driver.
2921
2922 Select Microsoft Access Driver (*.mdb).
2923
2924 Use PowerDNS as the DSN name, you can leave the description empty.
2925
2926 Then press Select... to select the database (ie. C:\Program
2927 Files\PowerDNS\powerdns.mdb).
2928
2929 Press Ok and you should be done.
2930
d16e0461
TP
2931 For more information, see Section A.10.
2932
2933 ----------------------------------------------------------------------
33ccb468 2934
29353.1. Configuring PDNS on Microsoft Windows
2936
d16e0461
TP
2937 \r You can specify program parameters in the pdns.conf file which should be
2938 located in pdns directory (ie. C:\Program Files\PowerDNS\).
33ccb468 2939
d16e0461 2940 \r To see a list of available parameters you can run pdns.exe --help.
33ccb468 2941
d16e0461
TP
2942 Note \r A default configuration file has been supplied with the
2943 installation.
33ccb468 2944
d16e0461 2945 ----------------------------------------------------------------------
33ccb468 2946
29473.2. Running PDNS on Microsoft Windows
2948
d16e0461
TP
2949 If you installed pdns on Windows NT, 2000 or XP you can run pdns as a
2950 service.
33ccb468 2951
d16e0461
TP
2952 This is how to do it: Go to services (Start->Settings->Control
2953 Panel->Administrative Tools->Services) and locate PDNS (you should have
2954 registered the program as a NT service during the installation).
33ccb468 2955
d16e0461
TP
2956 Double-click on PDNS and push the start button. You should now see a
2957 progress bar that gets to the end and see the status change to 'Started'.
33ccb468 2958
d16e0461 2959 This is the same as starting pdns like this: pdns.exe --ntservice
33ccb468 2960
d16e0461
TP
2961 If you haven't registered pdns as a service during the installation you
2962 can do so from the commandline by starting pdns like this: pdns.exe
2963 --register-service
33ccb468 2964
d16e0461
TP
2965 You can run pdns as a standard console program by using a command prompt
2966 or Start->Run... This way you can specify command-line parameters (see the
2967 documentation for commandline options).
33ccb468 2968
d16e0461
TP
2969 If you chose to add a PowerDNS menu to the start menu during the
2970 installation you can start pdns using the pdns shortcut in that menu.
33ccb468 2971
d16e0461 2972 ----------------------------------------------------------------------
33ccb468 2973
d16e0461 2974 Chapter 4. Configure database connectivity
33ccb468 2975
d16e0461
TP
2976 This chapter shows you how to configure the Generic MySQL backend, which
2977 we like a lot. But feel free to use any of the myriad other backends. This
2978 backend is called 'gmysql', and needs to be configured in pdns.conf. Add
2979 the following lines, adjusted for your local setup:
33ccb468 2980
d16e0461
TP
2981 launch=gmysql
2982 gmysql-host=127.0.0.1
2983 gmysql-user=root
2984 gmysql-dbname=pdnstest
2985
33ccb468 2986
d16e0461
TP
2987 Remove any earlier launch statements. Also remove the bind-example-zones
2988 statement as the bind module is no longer launched.
33ccb468 2989
d16e0461
TP
2990 Warning Make sure that you can actually resolve the hostname of your
2991 database without accessing the database! It is advised to supply
2992 an IP address here to prevent chicken/egg problems!
33ccb468 2993
d16e0461
TP
2994 Warning Be very very sure that you configure the *g*mysql backend and not
2995 the mysql backend. See Section A.5. If you use the 'mysql' backend
2996 things will only appear to work.
33ccb468 2997
2998 Now start PDNS using the monitor command:
d16e0461
TP
2999
3000 # /etc/init.d/pdns monitor
3001 (...)
3002 15:31:30 PowerDNS 1.99.0 (Mar 12 2002, 15:00:28) starting up
3003 15:31:30 About to create 3 backend threads
3004 15:31:30 [gMySQLbackend] Failed to connect to database: Error: Unknown database 'pdnstest'
3005 15:31:30 [gMySQLbackend] Failed to connect to database: Error: Unknown database 'pdnstest'
3006 15:31:30 [gMySQLbackend] Failed to connect to database: Error: Unknown database 'pdnstest'
3007
3008
3009 This is as to be expected - we did not yet add anything to MySQL for PDNS
3010 to read from. At this point you may also see other errors which indicate
3011 that PDNS either could not find your MySQL server or was unable to connect
3012 to it. Fix these before proceeding.
33ccb468 3013
3014 General MySQL knowledge is assumed in this chapter, please do not
3015 interpret these commands as DBA advice!
d16e0461
TP
3016
3017 ----------------------------------------------------------------------
33ccb468 3018
30194.1. Configuring MySQL
3020
d16e0461
TP
3021 Connect to MySQL as a user with sufficient privileges and issue the
3022 following commands:
3023
3024 create table domains (
3025 id INT auto_increment,
3026 name VARCHAR(255) NOT NULL,
3027 master VARCHAR(20) DEFAULT NULL,
3028 last_check INT DEFAULT NULL,
3029 type VARCHAR(6) NOT NULL,
3030 notified_serial INT DEFAULT NULL,
3031 account VARCHAR(40) DEFAULT NULL,
3032 primary key (id)
3033 )type=InnoDB;
3034
3035 CREATE UNIQUE INDEX name_index ON domains(name);
3036
3037 CREATE TABLE records (
3038 id INT auto_increment,
3039 domain_id INT DEFAULT NULL,
3040 name VARCHAR(255) DEFAULT NULL,
3041 type VARCHAR(6) DEFAULT NULL,
3042 content VARCHAR(255) DEFAULT NULL,
3043 ttl INT DEFAULT NULL,
3044 prio INT DEFAULT NULL,
3045 change_date INT DEFAULT NULL,
3046 primary key(id)
3047 )type=InnoDB;
3048
3049 CREATE INDEX rec_name_index ON records(name);
3050 CREATE INDEX nametype_index ON records(name,type);
3051 CREATE INDEX domain_id ON records(domain_id);
3052
3053 create table supermasters (
3054 ip VARCHAR(25) NOT NULL,
3055 nameserver VARCHAR(255) NOT NULL,
3056 account VARCHAR(40) DEFAULT NULL
3057 );
3058
3059 GRANT SELECT ON supermasters TO pdns;
3060 GRANT ALL ON domains TO pdns;
3061 GRANT ALL ON records TO pdns;
3062
3063
3064 Now we have a database and an empty table. PDNS should now be able to
3065 launch in monitor mode and display no errors:
3066
3067 # /etc/init.d/pdns monitor
3068 (...)
3069 15:31:30 PowerDNS 1.99.0 (Mar 12 2002, 15:00:28) starting up
3070 15:31:30 About to create 3 backend threads
3071 15:39:55 [gMySQLbackend] MySQL connection succeeded
3072 15:39:55 [gMySQLbackend] MySQL connection succeeded
3073 15:39:55 [gMySQLbackend] MySQL connection succeeded
3074
33ccb468 3075
3076 A sample query sent to the database should now return quickly without
3077 data:
d16e0461
TP
3078
3079 $ host www.test.com 127.0.0.1
3080 www.test.com A record currently not present at localhost
3081
33ccb468 3082
3083 And indeed, the control console now shows:
d16e0461
TP
3084
3085 Mar 12 15:41:12 We're not authoritative for 'www.test.com', sending unauth normal response
3086
33ccb468 3087
3088 Now we need to add some records to our database:
d16e0461
TP
3089
3090 # mysql pdnstest
3091 mysql> INSERT INTO domains (name, type) values ('test.com', 'NATIVE');
3092 INSERT INTO records (domain_id, name, content, type,ttl,prio)
3093 VALUES (1,'test.com','localhost ahu@ds9a.nl 1','SOA',86400,NULL);
3094 INSERT INTO records (domain_id, name, content, type,ttl,prio)
3095 VALUES (1,'test.com','dns-us1.powerdns.net','NS',86400,NULL);
3096 INSERT INTO records (domain_id, name, content, type,ttl,prio)
3097 VALUES (1,'test.com','dns-eu1.powerdns.net','NS',86400,NULL);
3098 INSERT INTO records (domain_id, name, content, type,ttl,prio)
3099 VALUES (1,'www.test.com','199.198.197.196','A',120,NULL);
3100 INSERT INTO records (domain_id, name, content, type,ttl,prio)
3101 VALUES (1,'mail.test.com','195.194.193.192','A',120,NULL);
3102 INSERT INTO records (domain_id, name, content, type,ttl,prio)
3103 VALUES (1,'localhost.test.com','127.0.0.1','A',120,NULL);
3104 INSERT INTO records (domain_id, name, content, type,ttl,prio)
3105 VALUES (1,'test.com','mail.test.com','MX',120,25);
3106
33ccb468 3107
3108 If we now requery our database, www.test.com should be present:
d16e0461
TP
3109
3110 $ host www.test.com 127.0.0.1
3111 www.test.com A 199.198.197.196
3112
3113 $ host -v -t mx test.com 127.0.0.1
3114 Address: 127.0.0.1
3115 Aliases: localhost
3116
3117 Query about test.com for record types MX
3118 Trying test.com ...
3119 Query done, 1 answer, authoritative status: no error
3120 test.com 120 IN MX 25 mail.test.com
3121 Additional information:
3122 mail.test.com 120 IN A 195.194.193.192
3123
3124
3125 To confirm what happened, issue the command SHOW * to the control console:
3126
3127 % show *
3128 corrupt-packets=0,latency=0,packetcache-hit=2,packetcache-miss=5,packetcache-size=0,
3129 qsize-a=0,qsize-q=0,servfail-packets=0,tcp-answers=0,tcp-queries=0,
3130 timedout-packets=0,udp-answers=7,udp-queries=7,
3131 %
3132
3133
3134 The actual numbers will vary somewhat. Now enter QUIT and start PDNS as a
3135 regular daemon, and check launch status:
3136
3137 # /etc/init.d/pdns start
3138 pdns: started
3139 # /etc/init.d/pdns status
3140 pdns: 8239: Child running
3141 # /etc/init.d/pdns dump
3142 pdns: corrupt-packets=0,latency=0,packetcache-hit=0,packetcache-miss=0,
3143 packetcache-size=0,qsize-a=0,qsize-q=0,servfail-packets=0,tcp-answers=0,
3144 tcp-queries=0,timedout-packets=0,udp-answers=0,udp-queries=0,
3145
3146
3147 You now have a working database driven nameserver! To convert other zones
3148 already present, use the zone2sql described in Appendix A.
3149
3150 ----------------------------------------------------------------------
3151
3152 4.1.1. Common problems
3153
3154 Most problems involve PDNS not being able to connect to the database.
3155
3156 Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
3157
3158 Your MySQL installation is probably defaulting to another location
3159 for its socket. Can be resolved by figuring out this location
3160 (often /var/run/mysqld.sock), and specifying it in the
3161 configuration file with the gmysql-socket parameter.
3162
3163 Another solution is to not connect to the socket, but to
3164 127.0.0.1, which can be achieved by specifying
3165 gmysql-host=127.0.0.1.
33ccb468 3166
3167 Host 'x.y.z.w' is not allowed to connect to this MySQL server
33ccb468 3168
d16e0461
TP
3169 These errors are generic MySQL errors. Solve them by trying to
3170 connect to your MySQL database with the MySQL console utility
3171 mysql with the parameters specified to PDNS. Consult the MySQL
3172 documentation.
33ccb468 3173
d16e0461 3174 ----------------------------------------------------------------------
33ccb468 3175
d16e0461 3176 Chapter 5. Dynamic resolution using the PipeBackend
33ccb468 3177
d16e0461
TP
3178 Also included in the PDNS distribution is the PipeBackend. The PipeBackend
3179 is primarily meant for allowing rapid development of new backends without
3180 tight integration with PowerDNS. It allows end-users to write PDNS
3181 backends in any language. A perl sample is provided. The PipeBackend is
3182 also very well suited for dynamic resolution of queries. Example
3183 applications include DNS based loadbalancing, geo-direction, DNS based
3184 failover with low TTLs.
33ccb468 3185
d16e0461
TP
3186 The Pipe Backend also has a separate chapter in the backends appendix, see
3187 Section A.1.
33ccb468 3188
d16e0461
TP
3189 Note The Pipe Backend currently does not function under FreeBSD 4.x and
3190 5.x, probably due to unfavorable interactions between its threading
3191 implementation and the fork system call.
3192
3193 Interestingly, the Linux PowerDNS binary running under the
3194 Linuxulator on FreeBSD does work.
3195
3196 ----------------------------------------------------------------------
33ccb468 3197
31985.1. Deploying the PipeBackend with the BindBackend
3199
d16e0461
TP
3200 Included with the PDNS distribution is the example.pl backend which has
3201 knowledge of the example.com zone, just like the BindBackend. To install
3202 both, add the following to your pdns.conf:
3203
3204 launch=pipe,bind
3205 bind-example-zones
3206 pipe-command=location/of/backend.pl
3207
33ccb468 3208
d16e0461
TP
3209 Please adjust the pipe-command statement to the location of the unpacked
3210 PDNS distribution. If your backend is slow, raise pipe-timeout from its
3211 default of 2000ms. Now launch PDNS in monitor mode, and perform some
3212 queries. Note the difference with the earlier experiment where only the
3213 BindBackend was loaded. The PipeBackend is launched first and thus gets
3214 queried first. The sample backend.pl script knows about:
33ccb468 3215
d16e0461 3216 * webserver.example.com A records pointing to 1.2.3.4, 1.2.3.5, 1.2.3.6
33ccb468 3217
33ccb468 3218 * www.example.com CNAME pointing to webserver.example.com
d16e0461
TP
3219
3220 * MBOXFW (mailbox forward) records pointing to powerdns@example.com. See
3221 the smtpredir documentation for information about MBOXFW.
33ccb468 3222
3223 For more information about how to write exciting backends with the
3224 PipeBackend, see Appendix A.
33ccb468 3225
d16e0461
TP
3226 ----------------------------------------------------------------------
3227
3228 Chapter 6. Logging & Monitoring PDNS performance
33ccb468 3229
d16e0461
TP
3230 In a production environment, you will want to be able to monitor PDNS
3231 performance. For this purpose, currently two methods are available, the
3232 webserver and the init.d dump, show and mrtg, commands. Furthermore, PDNS
3233 can perform a configurable amount of operational logging. This chapter
3234 also explains how to configure syslog for best results.
3235
3236 ----------------------------------------------------------------------
33ccb468 3237
32386.1. Webserver
3239
d16e0461
TP
3240 To launch the internal webserver, add a webserver statement to the
3241 pdns.conf. This will instruct the PDNS daemon to start a webserver on
3242 localhost at port 8081, without password protection. Only local users (on
3243 the same host) will be able to access the webserver by default. The
3244 webserver lists a lot of information about the PDNS process, including
3245 frequent queries, frequently failing queries, lists of remote hosts
3246 sending queries, hosts sending corrupt queries etc. The webserver does not
3247 allow remote management of the daemon. The following nameserver related
3248 configuration items are available:
33ccb468 3249
3250 webserver
d16e0461
TP
3251
3252 If set to anything but 'no', a webserver is launched.
33ccb468 3253
3254 webserver-address
d16e0461
TP
3255
3256 Address to bind the webserver to. Defaults to 127.0.0.1, which
3257 implies that only the local computer is able to connect to the
3258 nameserver! To allow remote hosts to connect, change to 0.0.0.0 or
3259 the physical IP address of your nameserver.
33ccb468 3260
3261 webserver-password
d16e0461
TP
3262
3263 If set, viewers will have to enter this plaintext password in
3264 order to gain access to the statistics.
33ccb468 3265
3266 webserver-port
d16e0461
TP
3267
3268 Port to bind the webserver to. Defaults to 8081.
3269
3270 ----------------------------------------------------------------------
33ccb468 3271
32726.2. Via init.d commands
3273
d16e0461
TP
3274 As mentioned before, the init.d commands dump, show and mrtg fetch data
3275 from a running PDNS process. Especially mrtg is powerful - it outputs data
3276 in a format that is ready for processing by the MRTG graphing tool.
3277
3278 MRTG can make insightful graphics on the performance of your nameserver,
3279 enabling the operator to easily spot trends. MRTG can be found on
3280 http://people.ee.ethz.ch/~oetiker/webtools/mrtg/mrtg.html
3281
3282 A sample mrtg.conf:
3283
3284 Interval: 5
3285 WorkDir: /var/www/mrtg
3286 WriteExpires: yes
3287 Options[_]: growright,nopercent
3288 XSize[_]: 600
3289
3290 #---------------------------------------------------------------
3291
3292 Target[udp-queries]: `/etc/init.d/pdns mrtg udp-queries udp-answers`
3293 Options[udp-queries]: growright,nopercent,perminute
3294 MaxBytes[udp-queries]: 600000
3295 AbsMax[udp-queries]: 600000
3296 Title[udp-queries]: Queries per minute
3297 PageTop[udp-queries]: <H2>Queries per minute</H2>
3298 WithPeak[udp-queries]: ymwd
3299 YLegend[udp-queries]: queries/minute
3300 ShortLegend[udp-queries]: q/m
3301 LegendI[udp-queries]: udp-questions
3302 LegendO[udp-queries]: udp-answers
3303
3304
3305 Target[perc-failed]: `/etc/init.d/pdns mrtg udp-queries udp-answers`
3306 Options[perc-failed]: growright,dorelpercent,perminute
3307 MaxBytes[perc-failed]: 600000
3308 AbsMax[perc-failed]: 600000
3309 Title[perc-failed]: Queries per minute, with percentage success
3310 PageTop[perc-failed]: <H2>Queries per minute, with percentage success</H2>
3311 WithPeak[perc-failed]: ymwd
3312 YLegend[perc-failed]: queries/minute
3313 ShortLegend[perc-failed]: q/m
3314 LegendI[perc-failed]: udp-questions
3315 LegendO[perc-failed]: udp-answers
3316
3317
3318 Target[packetcache-rate]: `/etc/init.d/pdns mrtg packetcache-hit udp-queries`
3319 Options[packetcache-rate]: growright,dorelpercent,perminute
3320 Title[packetcache-rate]: packetcache hitrate
3321 MaxBytes[packetcache-rate]: 600000
3322 AbsMax[packetcache-rate]: 600000
3323 PageTop[packetcache-rate]: <H2>packetcache hitrate</H2>
3324 WithPeak[packetcache-rate]: ymwd
3325 YLegend[packetcache-rate]: queries/minute
3326 ShortLegend[packetcache-rate]: q/m
3327 LegendO[packetcache-rate]: total
3328 LegendI[packetcache-rate]: hit
3329
3330 Target[packetcache-missrate]: `/etc/init.d/pdns mrtg packetcache-miss udp-queries`
3331 Options[packetcache-missrate]: growright,dorelpercent,perminute
3332 Title[packetcache-missrate]: packetcache MISSrate
3333 MaxBytes[packetcache-missrate]: 600000
3334 AbsMax[packetcache-missrate]: 600000
3335 PageTop[packetcache-missrate]: <H2>packetcache MISSrate</H2>
3336 WithPeak[packetcache-missrate]: ymwd
3337 YLegend[packetcache-missrate]: queries/minute
3338 ShortLegend[packetcache-missrate]: q/m
3339 LegendO[packetcache-missrate]: total
3340 LegendI[packetcache-missrate]: MISS
3341
3342 Target[latency]: `/etc/init.d/pdns mrtg latency`
3343 Options[latency]: growright,nopercent,gauge
3344 MaxBytes[latency]: 600000
3345 AbsMax[latency]: 600000
3346 Title[latency]: Query/answer latency
3347 PageTop[latency]: <H2>Query/answer latency</H2>
3348 WithPeak[latency]: ymwd
3349 YLegend[latency]: usec
3350 ShortLegend[latency]: usec
3351 LegendO[latency]: latency
3352 LegendI[latency]: latency
3353
3354 Target[recursing]: `/etc/init.d/pdns mrtg recursing-questions recursing-answers`
3355 Options[recursing]: growright,nopercent,gauge
3356 MaxBytes[recursing]: 600000
3357 AbsMax[recursing]: 600000
3358 Title[recursing]: Recursive questions/answers
3359 PageTop[recursing]: <H2>Recursing questions/answers</H2>
3360 WithPeak[recursing]: ymwd
3361 YLegend[recursing]: queries/minute
3362 ShortLegend[recursing]: q/m
3363 LegendO[recursing]: recursing-questions
3364 LegendI[recursing]: recursing-answers
3365
3366
3367
3368 ----------------------------------------------------------------------
33ccb468 3369
33706.3. Operational logging using syslog
3371
d16e0461 3372 (logging-facility is available from 1.99.10 and onwards)
33ccb468 3373
d16e0461
TP
3374 This chapter assumes familiarity with syslog, the unix logging device.
3375 PDNS logs messages with different levels. The more urgent the message, the
3376 lower the 'priority'. By default, PDNS will only log messages with an
3377 urgency of 3 or lower, but this can be changed using the loglevel setting
3378 in the configuration file. Setting it to 0 will eliminate all logging, 9
3379 will log everything.
33ccb468 3380
d16e0461
TP
3381 By default, logging is performed under the 'DAEMON' facility which is
3382 shared with lots of other programs. If you regard nameserving as
3383 important, you may want to have it under a dedicated facility so PDNS can
3384 log to its own files, and not clutter generic files.
33ccb468 3385
d16e0461
TP
3386 For this purpose, syslog knows about 'local' facilities, numbered from
3387 LOCAL0 to LOCAL7. To move PDNS logging to LOCAL0, add logging-facility=0
3388 to your configuration.
33ccb468 3389
d16e0461
TP
3390 Furthermore, you may want to have separate files for the differing
3391 prioties - preventing lower priority messages from obscuring important
3392 ones.
33ccb468 3393
d16e0461
TP
3394 A sample syslog.conf might be:
3395
3396 local0.info -/var/log/pdns.info
3397 local0.warn -/var/log/pdns.warn
3398 local0.err /var/log/pdns.err
3399
33ccb468 3400
3401 Where local0.err would store the really important messages. For
d16e0461
TP
3402 performance and diskspace reasons, it is advised to audit your syslog.conf
3403 for statements also logging PDNS activities. Many syslog.confs have a
3404 '*.*' statement to /var/log/syslog, which you may want to remove.
3405
3406 For performance reasons, be especially certain that no large amounts of
3407 synchronous logging take place. Under Linux, this is indicated by
3408 filenames not starting with a '-' - indicating a synchronous log, which
3409 hurts performance.
33ccb468 3410
d16e0461 3411 ----------------------------------------------------------------------
33ccb468 3412
d16e0461 3413 Chapter 7. Security settings & considerations
33ccb468 3414
34157.1. Settings
3416
d16e0461
TP
3417 PDNS has several options to easily allow it to run more securely. Most
3418 notable are the chroot, setuid and setgid options which can be specified.
3419
3420 ----------------------------------------------------------------------
3421
3422 7.1.1. Running as a less privileged identity
3423
3424 By specifying setuid and setgid, PDNS changes to this identity shortly
3425 after binding to the privileged DNS ports. These options are highly
3426 recommended. It is suggested that a separate identity is created for PDNS
3427 as the user 'nobody' is in fact quite powerful on most systems.
3428
3429 Both these parameters can be specified either numerically or as real
3430 names. You should set these parameters immediately if they are not set!
3431
3432 ----------------------------------------------------------------------
3433
3434 7.1.2. Jailing the process in a chroot
3435
3436 The chroot option secures PDNS to its own directory so that even if it
3437 should become compromised and under control of external influences, it
3438 will have a hard time affecting the rest of the system.
3439
3440 Even though this will hamper hackers a lot, chroot jails have been known
3441 to be broken.
3442
3443 When chrooting PDNS, take care that backends will be able to get to their
3444 files. Many databases need access to a UNIX domain socket which should
3445 live within the chroot. It is often possible to hardlink such a socket
3446 into the chroot dir.
3447
3448 The default PDNS configuration is best chrooted to ./, which boils down to
3449 the configured location of the controlsocket.
3450
3451 This is achieved by adding the following to pdns.conf: chroot=./, and
3452 restarting PDNS.
3453
3454 ----------------------------------------------------------------------
3455
34567.2. Considerations
3457
3458 In general, make sure that the PDNS process is unable to execute commands
3459 on your backend database. Most database backends will only need SELECT
3460 privilege. Take care to not connect to your database as the 'root' or 'sa'
3461 user, and configure the chosen user to have very slight privileges.
3462
3463 Databases empathic-ally do not need to run on the same machine that runs
3464 PDNS! In fact, in benchmarks it has been discovered that having a separate
3465 database machine actually improves performance.
3466
3467 Separation will enhance your database security highly. Recommended.
3468
3469 ----------------------------------------------------------------------
3470
3471 Chapter 8. Virtual hosting
3472
3473 It may be advantageous to run multiple separate PDNS installations on a
3474 single host, for example to make sure that different customers cannot
3475 affect each others zones. PDNS fully supports running multiple instances
3476 on one host.
3477
3478 To generate additional PDNS instances, copy the init.d script pdns to
3479 pdns-name, where name is the name of your virtual configuration. Must not
3480 contain a - as this will confuse the script.
3481
3482 When you launch PDNS via this renamed script, it will seek configuration
3483 instructions not in pdns.conf but in pdns-name.conf, allowing for separate
3484 specification of parameters.
3485
3486 Be aware however that the init.d force-stop will kill all PDNS instances!
3487
3488 ----------------------------------------------------------------------
3489
3490 Chapter 9. Performance related settings
3491
3492 Different backends will have different characteristics - some will want to
3493 have more parallel instances than others. In general, if your backend is
3494 latency bound, like most relational databases are, it pays to open more
3495 backends.
3496
3497 This is done with the distributor-threads setting. Of special importance
3498 is the choice between 1 or more backends. In case of only 1 thread, PDNS
3499 reverts to unthreaded operation which may be a lot faster, depending on
3500 your operating system and architecture.
3501
3502 Another very important setting cache-ttl. PDNS caches entire packets it
3503 sends out so as to save the time to query backends to assemble all data.
3504 The default setting of 10 seconds may be low for high traffic sites, a
3505 value of 60 seconds rarely leads to problems.
3506
3507 Some PDNS operators set cache-ttl to many hours or even days, and use
3508 pdns_control purge to selectively or globally notify PDNS of changes made
3509 in the backend. Also look at the Query Cache described in this chapter. It
3510 may materially improve your performance.
3511
3512 To determine if PDNS is unable to keep up with packets, determine the
3513 value of the qsize-q variable. This represents the number of packets
3514 waiting for database attention. During normal operations the queue should
3515 be small.
3516
3517 If it is known that backends will not contain CNAME records, the
3518 skip-cname setting can be used to prevent the normally mandatory CNAME
3519 lookup that is needed at least once for each DNS query.
3520
3521 Much the same holds for the wildcards setting. On by default, each
3522 non-existent query will lead to a number of additional wildcard queries.
3523 If it is known that the backends do not contain wildcard records,
3524 performance can be improved by adding wildcards=no to pdns.conf.
3525
3526 Logging truly kills performance as answering a question from the cache is
3527 an order of magnitude less work than logging a line about it. Busy sites
3528 will prefer to turn log-dns-details and log-failed-updates off.
3529
3530 ----------------------------------------------------------------------
3531
35329.1. Packet Cache
3533
3534 PDNS by default uses the 'Packet Cache' to recognise identical questions
3535 and supply them with identical answers, without any further processing.
3536 The default time to live is 10 seconds. It has been observed that the
3537 utility of the packet cache increases with the load on your nameserver.
3538
3539 Not all backends may benefit from the packetcache. If your backend is
3540 memory based and does not lead to context switches, the packetcache may
3541 actually hurt performance.
3542
3543 The size of the packetcache can be observed with /etc/init.d/pdns show
3544 packetcache-size
3545
3546 ----------------------------------------------------------------------
3547
35489.2. Query Cache
3549
3550 Besides entire packets, PDNS can also cache individual backend queries.
3551 Each DNS query leads to a number of backend queries, the most obvious
3552 additional backend query is the check for a possible CNAME. So, when a
3553 query comes in for the 'A' record for 'www.powerdns.com', PDNS must first
3554 check for a CNAME for 'www.powerdns.com'.
3555
3556 The Query Cache caches these backend queries, many of which are quite
3557 repetitive. PDNS only caches queries with no answer, or with exactly one.
3558 In the future this may be expanded but this lightweight solution is very
3559 simple and therefore fast.
3560
3561 Most gain is made from caching negative entries, ie, queries that have no
3562 answer. As these take little memory to store and are typically not a real
3563 problem in terms of speed-of-propagation, the default TTL for negative
3564 queries is a rather high 60 seconds.
3565
3566 This only is a problem when first doing a query for a record, adding it,
3567 and immediately doing a query for that record again. It may then take up
3568 to 60 seconds to appear. Changes to existing records however do not fall
3569 under the negative query ttl ( negquery-cache-ttl), but under the generic
3570 query-ttl which defaults to 20 seconds.
3571
3572 The default values should work fine for many sites. When tuning, keep in
3573 mind that the Query Cache mostly saves database access but that the Packet
3574 Cache also saves a lot of CPU because 0 internal processing is done when
3575 answering a question from the Packet Cache.
3576
3577 ----------------------------------------------------------------------
3578
3579 Chapter 10. Migrating to PDNS
3580
3581 Before migrating to PDNS a few things should be considered.
3582
3583 PDNS is not a recursing nameserver on its own
3584
3585 If PDNS receives a question for which it is not authoritative, it
3586 can't go out on the net to figure out an answer. However, because
3587 many installations are expected to be both authoritative and
3588 recursing, PDNS can use a separate recursing backend to provide
3589 non-authoritative answers. See Chapter 11 for more details.
3590
3591 PDNS does not operate as a 'slave' or 'master' server with all backends
3592
3593 Only the Generic PostgreSQL, Generic MySQL and BIND backends have
3594 the ability to act as master or slave.
3595
3596 To migrate, the zone2sql tool is provided.
3597
3598 ----------------------------------------------------------------------
3599
360010.1. Zone2sql
3601
3602 Zone2sql parses Bind named.conf files and zonefiles and outputs SQL on
3603 standard out, which can then be fed to your database.
3604
3605 Zone2sql understands the Bind master file extension '$GENERATE' and will
3606 also honour '$ORIGIN' and '$TTL'.
33ccb468 3607
d16e0461
TP
3608 For backends supporting slave operation (currently only the Generic
3609 PostgreSQL, Generic MySQL and BIND backend), there is also an option to
3610 keep slave zones as slaves, and not convert them to native operation.
33ccb468 3611
d16e0461
TP
3612 By default, zone2sql outputs code suitable for the mysqlbackend, but it
3613 can also generate SQL for the Generic PostgreSQL, Generic MySQL and Oracle
3614 backends. The following commands are available:
33ccb468 3615
d16e0461
TP
3616 --bare
3617
3618 Output in a bare format, suitable for further parsing. The output
3619 is formatted as follows:
3620
3621 domain_id<TAB>'qname'<TAB>'qtype'<TAB>'content'<TAB>prio<TAB>ttl
3622
3623
3624 --gmysql
3625
3626 Output in format suitable for the default configuration of the
3627 Generic MySQL backend.
3628
3629 --gpgsql
3630
3631 Output in format suitable for the default configuration of the
3632 Generic PostgreSQL backend.
3633
3634 --help
3635
3636 List options.
3637
3638 --mysql
3639
3640 Output in format suitable for the default configuration of the
3641 MySQL backend. Default.
3642
3643 --named-conf=...
3644
3645 Parse this named.conf to find locations of zones.
3646
3647 --on-error-resume-next
3648
3649 Ignore missing files during parsing. Dangerous.
3650
3651 --oracle
3652
3653 Output in format suitable for the default configuration of the
3654 Generic Oracle backend.
3655
3656 --slave
3657
3658 Maintain slave status of zones listed in named.conf as being
3659 slaves. The default behaviour is to convert all zones to native
3660 operation.
3661
3662 --startid
3663
3664 Supply a value for the first domain_id generated. Defaults at 0.
3665
3666 --transactions
33ccb468 3667
d16e0461
TP
3668 For Oracle and PostgreSQL output, wrap each domain in a
3669 transaction for higher speed and integrity.
33ccb468 3670
d16e0461
TP
3671 --verbose
3672
3673 Be verbose during conversion.
3674
3675 --zone=...
3676
3677 Parse only this zone file. Conflicts with --named-conf parameter.
3678
3679 --zone-name=...
3680
3681 When parsing a single zone without $ORIGIN statement, set this as
3682 the zone name.
3683
3684 ----------------------------------------------------------------------
3685
3686 Chapter 11. Recursion
3687
3688 (only available from 1.99.8 and onwards, recursing component available
3689 since 2.9.5)
3690
3691 From 2.9.5 onwards, PowerDNS offers both authoritative nameserving
3692 capabilities and a recursive nameserver component. These two halves are
3693 normally separate but many users insist on combining both recursion and
3694 authoritative service on one IP address. This can be likened to running
3695 Apache and Squid both on port 80.
3696
3697 However, many sites want to do this anyhow and some with good reason. For
3698 example, a setup like this allows the creation of fake domains which only
3699 exist for local users. Such domains often don't end on ".com" or ".org"
3700 but on ".intern" or ".name-of-isp".
3701
3702 PowerDNS can cooperate with either its own recursor or any other you have
3703 available to deliver recursive service on its port.
3704
3705 By specifying the recursor option in the configuration file, questions
3706 requiring recursive treatment will be handed over to the IP address
3707 specified. An example configuration might be recursor=130.161.180.1, which
3708 designates 130.161.180.1 as the nameserver to handle recursive queries.
3709
3710 As of 2.9.5, the recursing component of PowerDNS is a bit young and
3711 relatively untested but we hope people will want to use it anyhow. As an
3712 alternative, we highly advise the use of the DJBDNS dnscache
3713 (http://cr.yp.to/djbdns/dnscache.html).
33ccb468 3714
d16e0461
TP
3715 Take care not to point recursor to PDNS, which leads to a very tight
3716 packet loop!
33ccb468 3717
d16e0461
TP
3718 By specifying allow-recursion, recursion can be restricted to netmasks
3719 specified. The default is to allow recursion from everywhere. Example:
3720 allow-recursion=192.168.0.0/24, 10.0.0.0/8, 1.2.3.4.
33ccb468 3721
d16e0461
TP
3722 ----------------------------------------------------------------------
3723
372411.1. Details
3725
3726 Questions carry a number of flags. One of these is called 'Recursion
3727 Desired'. If PDNS is configured to allow recursion, AND such a flag is
3728 seen, AND the IP address of the client is allowed to recurse via PDNS,
3729 then the packet may be handed to the recursing backend.
3730
3731 If a Recursion Desired packet arrives and PDNS is configured to allow
3732 recursion, but not to the IP address of the client, resolution will
3733 proceed as if the RD flag were unset and the answer will indicate that
3734 recursion was not available.
3735
3736 It is also possible to use a resolver living on a different port. To do
3737 so, specify a recursor like this: recursor=130.161.180.1:5300.
3738
3739 If the backend does not answer a question within a large amount of time,
3740 this is logged as 'Recursive query for remote 10.96.0.2 with internal id 0
3741 was not answered by backend within timeout, reusing id'. This may happen
3742 when using 'BIND' as a recursor as it is prone to drop queries which it
3743 can't answer immediately.
3744
3745 To make sure that the local authoritative database overrides recursive
3746 information, PowerDNS first tries to answer a question from its own
3747 database. If that succeeds, the answer packet is sent back immediately
3748 without involving the recursor in any way.
3749
3750 Some packets, like those asking for MX records which are needed for SMTP
3751 transport of email, can be subject to 'additional processing'. This means
3752 that a recursing nameserver is obliged to try to add A records (IP
3753 addresses) for any of the mailservers mentioned in the packet, should it
3754 have these addresses available.
3755
3756 If PowerDNS encounters records needing such processing and finds that it
3757 does not have the data in its authoritative database, it will send an
3758 opportunistic quick query to the recursing component to see if it perhaps
3759 has such data. This question is worded such that the recursing nameserver
3760 should return immediately such as not to block the authoritative
3761 nameserver.
3762
3763 This marks a change from pre-2.9.5 behaviour where a packet was handed
3764 wholesale to the recursor in case it needed additional processing which
3765 could not proceed from the authoritative database.
3766
3767 ----------------------------------------------------------------------
3768
3769 Chapter 12. PowerDNS resolver/recursing nameserver
3770
3771 As of 2.9.4, a small recursor comes with PowerDNS. The algorithm is
3772 influenced by the works of Dan J. Bernstein although all mistakes are
3773 ours. Here are the current faults, so nobody can accuse us of false
3774 advertising:
3775
3776 * Only compiles on Linux, Windows and possibly Solaris. FreeBSD 4.x
3777 decided not to support the POSIX get/set/swapcontext functions. Bug
3778 your favorite FreeBSD kernel or libc maintainer for a fix, or ask him
3779 to port MTasker (see below) to your operating system.
3780
3781 * May have big problems with truncated packets.
3782
3783 To compile, add --enable-recursor to configure and the file pdns_recursor
3784 will be compiled. To run on a different port, use ./syncres
3785 --local-port=53. To bind to another address, use the local-address
3786 setting.
3787
3788 Note PowerDNS author bert hubert has the pdns recursor in production and
3789 browsing with it works for him. Furthermore, the LARTC mailinglist
3790 (2000 subscribers) is using the pdns recursing nameserver.
3791
3792 Good points:
3793
3794 * Uses MTasker (homepage)
3795
3796 * Can handle thousands of concurrent questions
3797
3798 * Code is written linearly, sequentially, which means that there are no
3799 problems with 'query restart' or anything.
3800
3801 * Relies heavily on Standard C++ Library infrastructure, which makes for
3802 little code (406 core lines).
3803
3804 * Is very verbose in showing how recursion actually works.
33ccb468 3805
d16e0461 3806 * The algorithm is simple and quite nifty.
33ccb468 3807
d16e0461 3808 ----------------------------------------------------------------------
33ccb468 3809
d16e0461 381012.1. pdns_recursor settings
33ccb468 3811
d16e0461
TP
3812 At startup, the recursing nameserver reads the file recursor.conf from the
3813 configuration directory, often /etc/powerdns or /usr/local/etc.
33ccb468 3814
d16e0461 3815 The following settings can be configured:
33ccb468 3816
d16e0461 3817 aaaa-additional-processing
33ccb468 3818
d16e0461
TP
3819 If turned on, the recursor will attempt to add AAAA IPv6 records
3820 to questions for MX records and NS records. Can be quite slow as
3821 absence of these records in earlier answers does not guarantee
3822 their non-existance. Can double the amount of queries needed. Off
3823 by default.
33ccb468 3824
d16e0461 3825 config-dir
33ccb468 3826
d16e0461 3827 Directory where the configuration file can be found.
33ccb468 3828
d16e0461 3829 daemon
33ccb468 3830
d16e0461 3831 Operate in the background, which is the default.
33ccb468 3832
d16e0461 3833 delegation-only
33ccb468 3834
d16e0461 3835 A Verisign special, see Section 12.1.1.
33ccb468 3836
d16e0461 3837 local-address
33ccb468 3838
d16e0461 3839 Local IP address (singular) to bind to. Defaults to all addresses.
33ccb468 3840
d16e0461 3841 local-port
33ccb468 3842
d16e0461 3843 Local port (singular) to bind to. Defaults to 53.
33ccb468 3844
d16e0461 3845 quiet
33ccb468 3846
d16e0461 3847 Don't log queries.
33ccb468 3848
d16e0461 3849 trace
33ccb468 3850
d16e0461
TP
3851 If turned on, output impressive heaps of logging. May destroy
3852 performance under load.
33ccb468 3853
d16e0461 3854 ----------------------------------------------------------------------
33ccb468 3855
d16e0461 3856 12.1.1. Verisign weirdness
33ccb468 3857
d16e0461
TP
3858 Verisign, the current operator of the COM and NET zones, decided to add a
3859 wildcard record so as to draw all queries for non-existing domains to
3860 their own page, which lists domains you might want to visist instead.
33ccb468 3861
d16e0461
TP
3862 To reinstate old behaviour, add delegation-only=com,net to your recursor
3863 configuration.
33ccb468 3864
d16e0461
TP
3865 What this does is reject all authoritative answers from the COM and NET
3866 servers. ISC, the current maintainers of BIND, have implemented this
3867 feature first, PowerDNS has mostly copied their algorithm. Thanks!
33ccb468 3868
d16e0461
TP
3869 Verisign might decide to evade our tactic with wildcard NS records, by
3870 which time other measures will be needed to restore the old behaviour.
33ccb468 3871
d16e0461 3872 ----------------------------------------------------------------------
33ccb468 3873
d16e0461 387412.2. Details
33ccb468 3875
d16e0461
TP
3876 PowerDNS implements a very simple but effective nameserver. Care has been
3877 taken not to overload remote servers in case of overly active clients.
33ccb468 3878
d16e0461
TP
3879 This is implemented using the 'throttle'. This accounts all recent traffic
3880 and prevents queries that have been sent out recently from going out
3881 again.
33ccb468 3882
d16e0461 3883 There are three levels of throttling.
33ccb468 3884
d16e0461
TP
3885 * If a remote server indicates that it is lame for a zone, the exact
3886 question won't be repeated in the next 60 seconds.
33ccb468 3887
d16e0461
TP
3888 * After 4 ServFail responses in 60 seconds, the query gets throttled
3889 too.
33ccb468 3890
d16e0461 3891 * 5 timeouts in 20 seconds also lead to query suppression.
33ccb468 3892
d16e0461 3893 ----------------------------------------------------------------------
33ccb468 3894
d16e0461 389512.3. Statistics
33ccb468 3896
d16e0461
TP
3897 Every half our or so, the recursor outputs a line with statistics. More
3898 infrastructure is planned so as to allow for Cricket or MRTG graphs. To
3899 force the output of statistics, send the process a SIGUSR1. A line of
3900 statistics looks like this:
33ccb468 3901
d16e0461 3902 Feb 10 14:16:03 stats: 125784 questions, 13971 cache entries, 309 negative entries, 84% cache hits, outpacket/query ratio 37%, 12% throttled
33ccb468 3903
d16e0461
TP
3904 This means that there are 13791 different names cached, which each may
3905 have multiple records attached to them. There are 309 items in the
3906 negative cache, items of which it is known that don't exist and won't do
3907 so for the near future. 84% of incoming questions could be answered
3908 without any additional queries going out to the net.
33ccb468 3909
d16e0461
TP
3910 The outpacket/query ratio means that on average, 0.37 packets were needed
3911 to answer a question. Initially this ratio may be well over 100% as
3912 additional queries may be needed to actually recurse the DNS and figure
3913 out the addresses of nameservers.
33ccb468 3914
d16e0461
TP
3915 Finally, 12% of queries were not performed because identical queries had
3916 gone out previously, saving load servers worldwide.
33ccb468 3917
d16e0461 3918 ----------------------------------------------------------------------
33ccb468 3919
d16e0461 3920 Chapter 13. Master/Slave operation & replication
33ccb468 3921
d16e0461
TP
3922 PDNS offers full master and slave semantics for replicating domain
3923 information. Furthermore, PDNS can benefit from native database
3924 replication.
33ccb468 3925
d16e0461 3926 ----------------------------------------------------------------------
33ccb468 3927
d16e0461 392813.1. Native replication
33ccb468 3929
d16e0461
TP
3930 Native replication is the default, unless other operation is specifically
3931 configured. Native replication basically means that PDNS will not send out
3932 DNS update notifications, nor will react to them. PDNS assumes that the
3933 backend is taking care of replication unaided.
33ccb468 3934
d16e0461
TP
3935 MySQL replication has proven to be very robust and well suited, even over
3936 transatlantic connections between badly peering ISPs. Other PDNS users
3937 employ Oracle replication which also works very well.
33ccb468 3938
d16e0461
TP
3939 To use native replication, configure your backend storage to do the
3940 replication and do not configure PDNS to do so.
33ccb468 3941
d16e0461 3942 ----------------------------------------------------------------------
33ccb468 3943
d16e0461 394413.2. Slave operation
33ccb468 3945
d16e0461
TP
3946 On launch, PDNS requests from all backends a list of domains which have
3947 not been checked recently for changes. This should happen every 'refresh'
3948 seconds, as specified in the SOA record. All domains that are unfresh are
3949 then checked for changes over at their master. If the SOA serial number
3950 there is higher, the domain is retrieved and inserted into the database.
3951 In any case, after the check the domain is declared 'fresh', and will only
3952 be checked again after 'refresh' seconds have passed.
33ccb468 3953
d16e0461
TP
3954 Warning Slave support is OFF by default, turn it on by adding slave to the
3955 configuration. The same holds for master operation. Both can be on
3956 simultaneously.
33ccb468 3957
d16e0461
TP
3958 PDNS also reacts to notifies by immediately checking if the zone has
3959 updated and if so, retransfering it.
33ccb468 3960
d16e0461
TP
3961 All backends which implement this feature must make sure that they can
3962 handle transactions so as to not leave the zone in a half updated state.
3963 MySQL configured with either BerkeleyDB or InnoDB meets this requirement,
3964 as do PostgreSQL and Oracle. The Bindbackend implements transaction
3965 semantics by renaming files if and only if they have been retrieved
3966 completely and parsed correctly.
33ccb468 3967
d16e0461
TP
3968 Slave operation can also be programmed using several pdns_control
3969 commands, see Section B.1.1. The 'retrieve' command is especially useful
3970 as it triggers an immediate retrieval of the zone from the configured
3971 master.
33ccb468 3972
d16e0461 3973 ----------------------------------------------------------------------
33ccb468 3974
d16e0461 3975 13.2.1. Supermaster automatic provisioning of slaves
33ccb468 3976
d16e0461
TP
3977 PDNS can recognize so called 'supermasters'. A supermaster is a host which
3978 is master for domains and for which we are to be a slave. When a master
3979 (re)loads a domain, it sends out a notification to its slaves. Normally,
3980 such a notification is only accepted if PDNS already knows that it is a
3981 slave for a domain.
33ccb468 3982
d16e0461
TP
3983 However, a notification from a supermaster carries more persuasion. When
3984 PDNS determines that a notification comes from a supermaster and it is
3985 bonafide, PDNS can provision the domain automatically, and configure
3986 itself as a slave for that zone.
33ccb468 3987
d16e0461
TP
3988 To enable this feature, a backend needs to know about the IP address of
3989 the supermaster, and how PDNS will be listed in the set of NS records
3990 remotely, and the 'account' name of your supermaster. There is no need to
3991 fill this out but it does help keep track of where a domain comes from.
33ccb468 3992
d16e0461 3993 ----------------------------------------------------------------------
33ccb468 3994
d16e0461 399513.3. Master operation
33ccb468 3996
d16e0461
TP
3997 When operating as a master, PDNS sends out notifications of changes to
3998 slaves, which react to these notifications by querying PDNS to see if the
3999 zone changed, and transferring its contents if it has. Notifications are a
4000 way to promptly propagate zone changes to slaves, as described in RFC
4001 1996.
33ccb468 4002
d16e0461
TP
4003 Warning Master support is OFF by default, turn it on by adding master to
4004 the configuration. The same holds for slave operation. Both can be
4005 on simultaneously.
33ccb468 4006
d16e0461
TP
4007 Left open by RFC 1996 is who is to be notified - which is harder to figure
4008 out than it sounds. All slaves for this domain must receive a notification
4009 but the nameserver only knows the names of the slaves - not the IP
4010 addresses, which is where the problem lies. The nameserver itself might be
4011 authoritative for the name of its secondary, but not have the data
4012 available.
33ccb468 4013
d16e0461
TP
4014 To resolve this issue, PDNS tries multiple tactics to figure out the IP
4015 addresses of the slaves, and notifies everybody. In contrived
4016 configurations this may lead to duplicate notifications being sent out,
4017 which shouldn't hurt.
33ccb468 4018
d16e0461
TP
4019 Some backends may be able to detect zone changes, others may chose to let
4020 the operator indicate which zones have changed and which haven't. Consult
4021 the documentation for your backend to see how it processes changes in
4022 zones.
33ccb468 4023
d16e0461
TP
4024 To help deal with slaves that may have missed notifications, or have
4025 failed to respond to them, several override commands are available via the
4026 pdns_control tool (Section B.1.1):
33ccb468 4027
4028 pdns_control notify domain
d16e0461
TP
4029
4030 This instructs PDNS to notify all IP addresses it considers to be
4031 slaves of this domain.
33ccb468 4032
4033 pdns_control notify-host domain ip-address
33ccb468 4034
d16e0461
TP
4035 This is truly an override and sends a notification to an arbitrary
4036 IP address. Can be used in 'also-notify' situations or when PDNS
4037 has trouble figuring out who to notify - which may happen in
4038 contrived configurations.
4039
4040 ----------------------------------------------------------------------
33ccb468 4041
d16e0461 4042 Chapter 14. Fancy records for seamless email and URL integration
33ccb468 4043
d16e0461
TP
4044 PDNS also supports so called 'fancy' records. A Fancy Record is actually
4045 not a DNS record, but it is translated into one. Currently, two fancy
4046 records are implemented, but not very useful without additional unreleased
4047 software. For completeness, they are listed here. The software will become
4048 available later on and is part of the Express and PowerMail suite of
4049 programs.
4050
4051 These records imply extra database lookups which has a performance impact.
4052 Therefore fancy records are only queried for if they are enabled with the
4053 fancy-records command in pdns.conf.
33ccb468 4054
4055 MBOXFW
33ccb468 4056
d16e0461
TP
4057 This record denotes an email forward. A typical entry looks like
4058 this:
33ccb468 4059
d16e0461
TP
4060 support@yourdomain.com MBOXFW you@yourcompany.com
4061
33ccb468 4062
d16e0461
TP
4063 When PDNS encounters a request for an MX record for yourdomain.com
4064 it will, if fancy records are enabled, also check for the
4065 existence of an MBOXFW record ending on '@yourdomain.com', in
4066 which case it will hand out a record containing the configured
4067 smtpredirector. This server should then also be able to access the
4068 PDNS database to figure out where mail to support@yourdomain.com
4069 should go to.
33ccb468 4070
4071 URL
33ccb468 4072
d16e0461
TP
4073 URL records work in much the same way, but for HTTP. A sample
4074 record:
4075
4076 yourdomain.com URL http://somewhere.else.com/yourdomain
4077
33ccb468 4078
d16e0461
TP
4079 A URL record is converted into an A record containing the IP
4080 address configured with the urlredirector setting. On that IP
4081 address a webserver should live that knows how to redirect
4082 yourdomain.com to http://somewhere.else.com/yourdomain.
33ccb468 4083
d16e0461 4084 ----------------------------------------------------------------------
33ccb468 4085
d16e0461 4086 Chapter 15. Index of all settings
33ccb468 4087
d16e0461
TP
4088 All PDNS settings are listed here, excluding those that originate from
4089 backends, which are documented in the relevant chapters.
33ccb468 4090
4091 allow-axfr-ips=...
d16e0461
TP
4092
4093 Behaviour pre 2.9.10: When not allowing AXFR (disable-axfr), DO
4094 allow from these IP addresses or netmasks.
4095
4096 Behaviour post 2.9.10: If set, only these IP addresses or netmasks
4097 will be able to perform AXFR.
33ccb468 4098
4099 allow-recursion=...
d16e0461
TP
4100
4101 By specifying allow-recursion, recursion can be restricted to
4102 netmasks specified. The default is to allow recursion from
4103 everywhere. Example: allow-recursion=192.168.0.0/24, 10.0.0.0/8,
4104 1.2.3.4.
33ccb468 4105
4106 cache-ttl=...
d16e0461
TP
4107
4108 Seconds to store packets in the PacketCache. See Section 9.1.
33ccb468 4109
4110 chroot=...
d16e0461
TP
4111
4112 If set, chroot to this directory for more security. See Chapter 7.
33ccb468 4113
4114 config-dir=...
d16e0461
TP
4115
4116 Location of configuration directory (pdns.conf)
33ccb468 4117
4118 config-name=...
d16e0461
TP
4119
4120 Name of this virtual configuration - will rename the binary image.
4121 See Chapter 8.
33ccb468 4122
4123 control-console=...
d16e0461
TP
4124
4125 Debugging switch - don't use.
33ccb468 4126
4127 daemon=...
d16e0461
TP
4128
4129 Operate as a daemon
33ccb468 4130
4131 default-soa-name=...
d16e0461
TP
4132
4133 name to insert in the SOA record if none set in the backend
33ccb468 4134
4135 disable-axfr=...
d16e0461
TP
4136
4137 Do not allow zone transfers. Before 2.9.10, this could be
4138 overridden by allow-axfr-ips.
33ccb468 4139
4140 disable-tcp=...
d16e0461
TP
4141
4142 Do not listen to TCP queries. Breaks RFC compliance.
33ccb468 4143
4144 distributor-threads=...
d16e0461
TP
4145
4146 Default number of Distributor (backend) threads to start. See
4147 Chapter 9.
33ccb468 4148
4149 fancy-records=...
d16e0461
TP
4150
4151 Process URL and MBOXFW records. See Chapter 14.
33ccb468 4152
4153 guardian | --guardian=yes | --guardian=no
d16e0461
TP
4154
4155 Run within a guardian process. See Section B.2.
33ccb468 4156
4157 help
d16e0461
TP
4158
4159 Provide a helpful message
33ccb468 4160
4161 launch=...
d16e0461
TP
4162
4163 Which backends to launch and order to query them in. See Section
4164 B.3.
33ccb468 4165
4166 lazy-recursion=...
d16e0461
TP
4167
4168 On by default as of 2.1. Checks local data first before recursing.
4169 See Chapter 11.
33ccb468 4170
4171 load-modules=...
d16e0461
TP
4172
4173 Load this module - supply absolute or relative path. See Section
4174 B.3.
33ccb468 4175
4176 local-address=...
d16e0461
TP
4177
4178 Local IP address to which we bind. You can specify multiple
4179 addresses separated by commas or whitespace. It is highly advised
4180 to bind to specific interfaces and not use the default 'bind to
4181 any'. This causes big problems if you have multiple IP addresses.
4182 Unix does not provide a way of figuring out what IP address a
4183 packet was sent to when binding to any.
33ccb468 4184
4185 local-port=...
d16e0461
TP
4186
4187 The port on which we listen. Only one port possible.
33ccb468 4188
4189 log-failed-updates=...
d16e0461
TP
4190
4191 If set to 'no', failed Windows Dynamic Updates will not be logged.
33ccb468 4192
4193 log-dns-details=...
d16e0461
TP
4194
4195 If set to 'no', informative-only DNS details will not even be sent
4196 to syslog, improving performance. Available from 2.5 and onwards.
33ccb468 4197
4198 logging-facility=...
d16e0461
TP
4199
4200 If set to a a digit, logging is performed under this LOCAL
4201 facility. See Section 6.3. Available from 1.99.9 and onwards.
33ccb468 4202
4203 loglevel=...
d16e0461
TP
4204
4205 Amount of logging. Higher is more. Do not set below 3
33ccb468 4206
4207 max-queue-length=...
d16e0461
TP
4208
4209 If this many packets are waiting for database attention, consider
4210 the situation hopeless and respawn.
33ccb468 4211
4212 module-dir=...
d16e0461
TP
4213
4214 Default directory for modules. See Section B.3.
33ccb468 4215
4216 negquery-cache-ttl=...
d16e0461
TP
4217
4218 Seconds to store queries with no answer in the Query Cache. See
4219 Section 9.2.
33ccb468 4220
4221 no-config
d16e0461
TP
4222
4223 Do not attempt to read the configuration file.
33ccb468 4224
4225 out-of-zone-additional-processing |
d16e0461
TP
4226 --out-of-zone-additional-processing=yes |
4227 --out-of-zone-additional-processing=no
4228
4229 Do out of zone additional processing
33ccb468 4230
4231 query-cache-ttl=...
d16e0461
TP
4232
4233 Seconds to store queries with an answer in the Query Cache. See
4234 Section 9.2.
33ccb468 4235
4236 queue-limit=...
d16e0461
TP
4237
4238 Maximum number of miliseconds to queue a query. See Chapter 9.
4239
4240 query-local-address=...
4241
4242 The IP address to use as a source address for sending queries.
4243 Useful if you have multiple IPs and pdns is not bound to the IP
4244 address your operating system uses by default for outgoing
4245 packets.
33ccb468 4246
4247 query-logging | query-logging=yes | query-logging=no
d16e0461
TP
4248
4249 Hints to a backend that it should log a textual representation of
4250 queries it performs. Can be set at runtime.
33ccb468 4251
4252 recursive-cache-ttl=...
d16e0461
TP
4253
4254 Seconds to store recursive packets in the PacketCache. See Section
4255 9.1.
33ccb468 4256
4257 recursor=...
d16e0461
TP
4258
4259 If set, recursive queries will be handed to the recursor specified
4260 here. See Chapter 11.
33ccb468 4261
4262 setgid=...
d16e0461
TP
4263
4264 If set, change group id to this gid for more security. See Chapter
4265 7.
33ccb468 4266
4267 setuid=...
d16e0461
TP
4268
4269 If set, change user id to this uid for more security. See Chapter
4270 7.
33ccb468 4271
4272 skip-cname | --skip-cname=yes | --skip-cname=no
d16e0461
TP
4273
4274 Do not perform CNAME indirection for each query. Has performance
4275 implications. See Chapter 7.
33ccb468 4276
4277 slave-cycle-interval=60
d16e0461
TP
4278
4279 Schedule slave up-to-date checks of domains whose status is
4280 unknown every .. seconds. See Chapter 14.
33ccb468 4281
4282 smtpredirector=...
d16e0461
TP
4283
4284 Our smtpredir MX host. See Chapter 14.
33ccb468 4285
4286 soa-serial-offset=...
d16e0461
TP
4287
4288 If your database contains single-digit SOA serials and you need to
4289 host .DE domains, this setting can help placate their 6-digit SOA
4290 serial requirements. Suggested value is to set this to 1000000
4291 which adds 1000000 to all SOA Serials under that offset.
33ccb468 4292
4293 socket-dir=...
d16e0461
TP
4294
4295 Where the controlsocket will live. See Section B.1.
33ccb468 4296
4297 strict-rfc-axfrs | --strict-rfc-axfrs=yes | --strict-rfc-axfrs=no
d16e0461
TP
4298
4299 Perform strictly RFC conformant AXFRs, which are slow, but needed
4300 to placate some old client tools.
33ccb468 4301
4302 urlredirector=...
d16e0461
TP
4303
4304 Where we send hosts to that need to be url redirected. See Chapter
4305 14.
33ccb468 4306
4307 webserver | --webserver=yes | --webserver=no
d16e0461
TP
4308
4309 Start a webserver for monitoring. See Chapter 6.
33ccb468 4310
4311 webserver-address=...
d16e0461
TP
4312
4313 IP Address of webserver to listen on. See Chapter 6.
33ccb468 4314
4315 webserver-password=...
d16e0461
TP
4316
4317 Password required for accessing the webserver. See Chapter 6.
33ccb468 4318
4319 webserver-port=...
d16e0461
TP
4320
4321 Port of webserver to listen on. See Chapter 6.
33ccb468 4322
4323 wildcard-url=...
d16e0461
TP
4324
4325 Check for wildcard URL records.
33ccb468 4326
4327 wildcards=...
33ccb468 4328
d16e0461
TP
4329 Honor wildcards in the database. On by default. Turning this off
4330 has performance implications, see Chapter 9.
4331
4332 ----------------------------------------------------------------------
4333
4334 Chapter 16. Index of all internal metrics
4335
4336 ----------------------------------------------------------------------
33ccb468 4337
d16e0461 433816.1. Counters & variables
33ccb468 4339
d16e0461
TP
4340 A number of counters and variables are set during PDNS operation. These
4341 can be queried with the init.d dump, show and mrtg commands, or viewed
4342 with the webserver.
33ccb468 4343
4344 corrupt-packets
d16e0461
TP
4345
4346 Number of corrupt packets received
33ccb468 4347
4348 latency
d16e0461
TP
4349
4350 Average number of microseconds a packet spends within PDNS
33ccb468 4351
4352 packetcache-hit
d16e0461
TP
4353
4354 Number of packets which were answered out of the cache
33ccb468 4355
4356 packetcache-miss
d16e0461
TP
4357
4358 Number of times a packet could not be answered out of the cache
33ccb468 4359
4360 packetcache-size
d16e0461
TP
4361
4362 Amount of packets in the packetcache
33ccb468 4363
4364 qsize-a
d16e0461
TP
4365
4366 Size of the queue before the transmitting socket.
33ccb468 4367
4368 qsize-q
d16e0461
TP
4369
4370 Number of packets waiting for database attention
33ccb468 4371
4372 servfail-packets
d16e0461
TP
4373
4374 Amount of packets that could not be answered due to database
4375 problems
33ccb468 4376
4377 tcp-answers
d16e0461
TP
4378
4379 Number of answers sent out over TCP
33ccb468 4380
4381 tcp-questions
d16e0461
TP
4382
4383 Number of questions received over TCP
33ccb468 4384
4385 timedout-questions
d16e0461
TP
4386
4387 Amount of packets that were dropped because they had to wait too
4388 long internally
33ccb468 4389
4390 udp-answers
d16e0461
TP
4391
4392 Number of answers sent out over UDP
33ccb468 4393
4394 udp-questions
33ccb468 4395
d16e0461 4396 Number of questions received over UDP
33ccb468 4397
d16e0461 4398 ----------------------------------------------------------------------
33ccb468 4399
d16e0461 4400 16.1.1. Ring buffers
33ccb468 4401
d16e0461
TP
4402 Besides counters, PDNS also maintains the ringbuffers. A ringbuffer
4403 records events, each new event gets a place in the buffer until it is
4404 full. When full, earlier entries get overwritten, hence the name 'ring'.
4405
4406 By counting the entries in the buffer, statistics can be generated. These
4407 statistics can currently only be viewed using the webserver and are in
4408 fact not even collected without the webserver running.
4409
4410 The following ringbuffers are available:
33ccb468 4411
4412 Log messages (logmessages)
d16e0461
TP
4413
4414 All messages logged
33ccb468 4415
4416 Queries for existing records but for a type we don't have
d16e0461
TP
4417 (noerror-queries)
4418
4419 Queries for, say, the AAAA record of a domain, when only an A is
4420 available. Queries are listed in the following format: name/type.
4421 So an AAA query for pdns.powerdns.com looks like
4422 pdns.powerdns.com/AAAA.
4423
4424 Queries for non-existing records within existing domains(nxdomain-queries)
4425
4426 If PDNS knows it is authoritative over a domain, and it sees a
4427 question for a record in that domain that does not exist, it is
4428 able to send out an authoritative 'no such domain' message.
4429 Indicates that hosts are trying to connect to services really not
4430 in your zone.
33ccb468 4431
4432 UDP queries received (udp-queries)
d16e0461
TP
4433
4434 All UDP queries seen.
33ccb468 4435
4436 Remote server IP addresses (remotes)
d16e0461
TP
4437
4438 Hosts querying PDNS. Be aware that UDP is anonymous - person A can
4439 send queries that appear to be coming from person B.
33ccb468 4440
4441 Remotes sending corrupt packets (remote-corrupts)
d16e0461
TP
4442
4443 Hosts sending PDNS broken packets, possibly meant to disrupt
4444 service. Be aware that UDP is anonymous - person A can send
4445 queries that appear to be coming from person B.
33ccb468 4446
4447 Remotes querying domains for which we are not auth (remote-unauth)
d16e0461
TP
4448
4449 It may happen that there are misconfigured hosts on the internet
4450 which are configured to think that a PDNS installation is in fact
4451 a resolving nameserver. These hosts will not get useful answers
4452 from PDNS. This buffer lists hosts sending queries for domains
4453 which PDNS does not know about.
33ccb468 4454
4455 Queries that could not be answered due to backend errors
d16e0461
TP
4456 (servfail-queries)
4457
4458 For one reason or another, a backend may be unable to extract
4459 answers for a certain domain from its storage. This may be due to
4460 a corrupt database or to inconsistent data. When this happens,
4461 PDNS sends out a 'servfail' packet indicating that it was unable
4462 to answer the question. This buffer shows which queries have been
4463 causing servfails.
33ccb468 4464
4465 Queries for domains that we are not authoritative for (unauth-queries)
33ccb468 4466
d16e0461
TP
4467 If a domain is delegated to a PDNS instance, but the backend is
4468 not made aware of this fact, questions come in for which no answer
4469 is available, nor is the authority. Use this ringbuffer to spot
4470 such queries.
4471
4472 ----------------------------------------------------------------------
33ccb468 4473
d16e0461
TP
4474 Chapter 17. Supported record types and their storage
4475
4476 This chapter lists all record types PDNS supports, and how they are stored
4477 in backends. The list is mostly alphabetical but some types are grouped.
33ccb468 4478
4479 A
d16e0461
TP
4480
4481 The A record contains an IP address. It is stored as a decimal
4482 dotted quad string, for example: '213.244.168.210'.
33ccb468 4483
4484 AAAA
d16e0461
TP
4485
4486 The AAAA record contains an IPv6 address. An example:
4487 '3ffe:8114:2000:bf0::1'.
33ccb468 4488
4489 CNAME
d16e0461
TP
4490
4491 The CNAME record specifies the canonical name of a record. It is
4492 stored plainly. Like all other records, it is not terminated by a
4493 dot. A sample might be 'webserver-01.yourcompany.com'.
33ccb468 4494
4495 HINFO
d16e0461
TP
4496
4497 Hardware Info record, used to specify CPU and operating system.
4498 Stored with a single space separating these two, example: 'i386
4499 Linux'.
33ccb468 4500
4501 MX
d16e0461
TP
4502
4503 The MX record specifies a mail exchanger host for a domain. Each
4504 mail exchanger also has a priority or preference. This should be
4505 specified in the separate field dedicated for that purpose, often
4506 called 'prio'.
33ccb468 4507
4508 NAPTR
33ccb468 4509
d16e0461 4510 \r Naming Authority Pointer, RFC 2915. Stored as follows:
33ccb468 4511
d16e0461
TP
4512 '100 50 "s" "z3950+I2L+I2C" "" _z3950._tcp.gatech.edu'.
4513
33ccb468 4514
d16e0461
TP
4515 The fields are: order, preference, flags, service, regex,
4516 replacement. Note that the replacement is not enclosed in quotes,
4517 and should not be. The replacement may be omitted, in which case
4518 it is empty. See also RFC 2916 for how to use NAPTR for ENUM
4519 (E.164) purposes.
33ccb468 4520
4521 NS
d16e0461
TP
4522
4523 Nameserver record. Specifies nameservers for a domain. Stored
4524 plainly: 'ns1.powerdns.com', as always without a terminating dot.
33ccb468 4525
4526 PTR
d16e0461
TP
4527
4528 Reverse pointer, used to specify the host name belonging to an IP
4529 or IPv6 address. Name is stored plainly: 'www.powerdns.com'. As
4530 always, no terminating dot.
33ccb468 4531
4532 RP
d16e0461
TP
4533
4534 Responsible Person record, as described in RFC 1183. Stored with a
4535 single space between the mailbox name and the more-information
4536 pointer. Example 'peter.powerdns.com peter.people.powerdns.com',
4537 to indicate that peter@powerdns.com is responsible and that more
4538 information about peter is available by querying the TXT record of
4539 peter.people.powerdns.com.
33ccb468 4540
4541 SOA
33ccb468 4542
d16e0461
TP
4543 The Start of Authority record is one of the most complex
4544 available. It specifies a lot about a domain: the name of the
4545 master nameserver ('the primary'), the hostmaster and a set of
4546 numbers indicating how the data in this domain expires and how
4547 often it needs to be checked. Further more, it contains a serial
4548 number which should rise on each change of the domain.
4549
4550 The stored format is:
4551
4552 primary hostmaster serial refresh retry expire default_ttl
4553
4554
4555 Besides the primary and the hostmaster, all fields are numerical.
4556 PDNS has a set of default values:
4557
4558 Table 17-1. SOA fields
4559
4560 +-----------------------------------------------------+
4561 | primary | default-soa-name configuration option |
4562 |-------------+---------------------------------------|
4563 | hostmaster | hostmaster@domain-name |
4564 |-------------+---------------------------------------|
4565 | serial | 0 |
4566 |-------------+---------------------------------------|
4567 | refresh | 10800 (3 hours) |
4568 |-------------+---------------------------------------|
4569 | retry | 3600 (1 hour) |
4570 |-------------+---------------------------------------|
4571 | expire | 604800 (1 week) |
4572 |-------------+---------------------------------------|
4573 | default_ttl | 3600 (1 hour) |
4574 +-----------------------------------------------------+
4575
4576 The fields have complicated and sometimes controversial meanings.
4577 The 'serial' field is special. If left at 0, the default, PDNS
4578 will perform an internal list of the domain to determine highest
4579 change_date field of all records within the zone, and use that as
4580 the zone serial number. This means that the serial number is
4581 always raised when changes are made to the zone, as long as the
4582 change_date field is being set.
4583
4584 SRV
4585
4586 SRV records can be used to encode the location and port of
4587 services on a domain name. When encoding, the priority field is
4588 used to encode the priority. For example,
4589 '_ldap._tcp.dc._msdcs.conaxis.ch SRV 0 100 389 mars.conaxis.ch'
4590 would be encoded with 0 in the priorit field and '100 389
4591 mars.conaxis.ch' in the tontent field.
4592
4593 TXT
33ccb468 4594
d16e0461
TP
4595 The TXT field can be used to attach textual data to a domain. Text
4596 is stored plainly.
33ccb468 4597
d16e0461 4598 ----------------------------------------------------------------------
33ccb468 4599
d16e0461 4600 Chapter 18. HOWTO & Frequently Asked Questions
33ccb468 4601
d16e0461 4602 This chapter contains a number of FAQs and HOWTOs.
33ccb468 4603
d16e0461 4604 ----------------------------------------------------------------------
33ccb468 4605
d16e0461 460618.1. Getting support, free and paid FAQ
33ccb468 4607
d16e0461
TP
4608 PowerDNS is an open source program so you may get help from the PowerDNS
4609 users' community or from its authors. You may also help others (please
4610 do).
4611
4612 Some users may not have experience in interacting with developers or the
4613 open source community. This FAQ is to be considered MANDATORY READING
4614 before asking us for help.
4615
4616 Q: Help!
4617
4618 A: Please try harder. Specifically, before people will be able to
4619 help you, they need to know a lot about your system. Things you
4620 may find irrelevant. But, as you have a problem, you are not in a
4621 good position to know what is relevant and what not.
4622
4623 Q: I have a question, what details should I supply?
4624
4625 A: Start out with stating what you think should be happening.
4626 Quite often, wrong expectations are the actual proble.
4627 Furthermore, which database backend you use, your operating
4628 system, which version of PowerDNS you use and where you got it
4629 from (RPM, .DEB, tar.gz). If you compiled it yourself, what were
4630 the ./configure parameters.
4631
4632 In the Open Source community, not supplying vital details is
4633 interpreted as a lack of respect for those willing to take time to
4634 answer your questions!
4635
4636 If at *all* possible, supply the actual name of your domain and
4637 the IP address of your server(s).
4638
4639 Q: Where should I send my question?
33ccb468 4640
d16e0461
TP
4641 A: To a mailinglist. Do not mail the authors directly unless you
4642 previously entered a support contract with them! For subscription
4643 details, see the mailinglists page.
33ccb468 4644
d16e0461
TP
4645 Questions about using PowerDNS should be sent to the pdns-users
4646 list, questions about compiler errors or feature requests to
4647 pdns-dev.
33ccb468 4648
d16e0461 4649 Before posting, read all FAQs and tell people you did.
33ccb468 4650
d16e0461
TP
4651 Q: I'm special, I don't email to mailinglists!
4652
4653 We're special too, and we ask you to mail the mailinglists. If you
4654 need privacy, consider entering a support relationship with us, in
4655 which case you can email <support@powerdns.com>.
4656
4657 ----------------------------------------------------------------------
4658
465918.2. Using and Compiling PowerDNS FAQ
4660
4661 In the course of compiling and using PowerDNS, many questions may arise.
4662 Here are some we've heard earlier or questions we expect people may have.
4663 Please read this list before mailing us!
4664
4665 Q: I get this entry a lot of times in my log file: Authoritative empty NO
4666 ERROR to 1.2.3.4 for 'powerdns.nl' (AAAA)..
4667
4668 As the name implies, this is not an error. It tells you there are
4669 questions for a domain which exists in your database, but for
4670 which no record of the requested type exists. To get rid of this
4671 error, add log-dns-details=off to your configuration.
33ccb468 4672
4673 Q: Can I launch multiple backends simultaneously?
d16e0461
TP
4674
4675 A: You can. This might for example be useful to keep an existing
4676 BIND configuration around but to store new zones in, say MySQL.
4677 The syntax to use is 'launch=bind,gmysql'.
4678
4679 Q: PowerDNS does not give authoritative answers, how come?
4680
4681 A: This is almost always not the case. An authoritative answer is
4682 recognized by the 'AA' bit being set. Many tools prominently print
4683 the number of Authority records included in an answer, leading
4684 users to conclude that the absence or presence of these records
4685 indicates the authority of an answer. This is not the case.
4686
4687 Verily, many misguided country code domain operators have fallen
4688 into this trap and demand authority records, even though these are
4689 fluff and quite often misleading. Invite such operators to look at
4690 section 6.2.1 of RFC 1034, which shows a correct authoritative
4691 answer without authority records. In fact, none of the
4692 non-deprecated authoritative answers shown have authority records!
4693
4694 Sorry for sounding like DJB on this, but we get so many misguided
4695 questions about authority..
33ccb468 4696
4697 Q: Which backend should I use? There are so many!
33ccb468 4698
d16e0461
TP
4699 A: If you have no external constraints, the Generic MySQL (gmysql)
4700 and Generic PostgreSQL (gpgsql) ones are probably the most used
4701 and complete. By all means do not use the non-generic MySQL
4702 backend, which is deprecated and only available for older
4703 installations.
4704
4705 The Oracle backend also has happy users, we know of no deployments
4706 of the DB2 backend. The BIND backend is pretty capable too in
4707 fact, but many prefer a relational database.
33ccb468 4708
4709 Q: I try to launch the pgmysqlbackend and it can't find it!
d16e0461
TP
4710
4711 A: You did not read the changelog, nor the README. The 'pgmysql'
4712 backend is no more and has been split into the gmysql and gpgsql
4713 backends, with the common code residing within PowerDNS itself.
33ccb468 4714
4715 Q: PowerDNS compiles under OpenBSD, but crashes immediately, now what?
d16e0461
TP
4716
4717 A: Reasons behind this are somewhat unclear but we hear they go
4718 away if you use a more recent compiler. Let us know on
4719 <pdns-dev@mailman.powerdns.com>. See also here.
33ccb468 4720
4721 Q: I'm trying to build from CVS but I get lots of weird errors!
d16e0461
TP
4722
4723 A: Read the 'HACKING' file, it lists the build requirements
4724 (mostly autoconf, automake, libtool). In many cases, it may be
4725 easier to build from the source distribution though.
33ccb468 4726
4727 Q: I'm on Solaris 7 and AAAA records do not work
d16e0461
TP
4728
4729 A: Indeed, and this is pretty sad. Either upgrade to Solaris 8 or
4730 convince people to write the replacement functions needed to
4731 encode AAAA if the host operating system does not offer them.
33ccb468 4732
4733 Q: When compiling I get errors about 'sstream' and 'ostringstream', or
d16e0461
TP
4734 BITSPERCHAR
4735
4736 A: Your gcc is too old. Versions 2.95.2 and older are not
4737 supported. Many distributions have improved gcc 2.95.2 with an
4738 ostringstream implementation, in which case their 2.95.2 is also
4739 supported. We like gcc 3.2.1 best.
33ccb468 4740
4741 Q: Ok, I've installed gcc 3.2.1 but now the gpgsql backend won't link
d16e0461
TP
4742
4743 A: Sadly, the gcc C++ on-disk object format has changed a few
4744 times since the 2.95 days. This means that gcc 3.2.1 cannot link
4745 against libpq++.so compiled with 2.95. The trick is to recompile
4746 PostgreSQL with 3.2.1 too and have it install in a separate
4747 location. Then reconfigure the pdns compile to look there, with
4748 ./configure --with-pgsql-lib=/opt/postgresql-with-3.2.1/lib
33ccb468 4749
4750 Q: I've installed PostgreSQL 7.3 but it has no libpq++.so
d16e0461
TP
4751
4752 A: As of 7.3, libpq++ has been split out of the main PostgreSQL
4753 distribution. See here. It would in fact be a great idea to move
4754 the gpgsql backend to the C interface instead of the C++ one. On
4755 Debian 'Sid', libpq++.so hides in the libpqpp-dev package.
33ccb468 4756
4757 Q: PowerDNS crashes when I install the pdns-static .deb on Debian SID
d16e0461
TP
4758
4759 A: Indeed. Install the .debs that come with Debian or recompile
4760 PowerDNS yourself. If not using MySQL, the crashes will go away if
4761 you remove setuid and setgid statements from the configuration.
4762
4763 Q: Why don't my slaves act on notifications and transfer my updated zone?
4764
4765 A: Raise the serial number of your zone. In most backends, this is
4766 the first digit of the SOA contents field. If this number is lower
4767 to equal to that on a slave, it will not consider your zone
4768 updated.
4769
4770 Q: Master or Slave support is not working, PDNS is not picking up changes
4771
4772 A: The Master/Slave apparatus is off by default. Turn it on by
4773 adding a slave and/or master statement to the configuration file.
4774 Also, check that the configured backend is master or slave
4775 capable.
4776
4777 Q: My masters won't allow PowerDNS to access zones as it is using the
4778 wrong local IP address
4779
4780 A: Mark Bergsma contributed the query-local-address setting to
4781 tell PowerDNS which local IP address to use.
4782
4783 Q: I compiled PowerDNS myself and I see weird problems, especially on SMP
4784
4785 A: There are known issues between gcc <3.2 and PowerDNS on Linux
4786 SMP systems. The exact cause is not known but moving to our
4787 precompiled version always fixes the problems. If you compile
4788 yourself, use a recent gcc!
4789
4790 Q: PowerDNS does not answer queries on all my IP addresses and I've
4791 ignored the warning I got about that at startup
4792
4793 A: Please don't ignore what PowerDNS says to you. Furthermore,
4794 read Chapter 15 about the local-address setting, and use it to
4795 specify which IP addresses PowerDNS should listen on.
4796
4797 Q: Can I use a MySQL database with the Windows version of PowerDNS?
4798
4799 A: You can. MySQL support is supplied through the ODBC backend,
4800 which is compiled into the main binary. So if you want to use
4801 MySQL you can change the pdns.conf file, which is located in the
4802 PowerDNS for Windows directory, to use the correct ODBC data
4803 sources. If you don't know how to use ODBC with MySQL:
4804
4805 * Download MyODBC from http://www.mysql.com/
4806
4807 * Install the MySQL ODBC driver.
4808
4809 Then you can follow the instructions located in Chapter 3. But
4810 instead of selecting the Microsoft Access Driver you select the
4811 MySQL ODBC Driver and configure it to use your MySQL database.
4812
4813 Note For other databases for which an ODBC driver is
4814 available, the procedure is the same as this example.
4815
4816 ----------------------------------------------------------------------
4817
481818.3. Backend developer HOWTO
4819
4820 Writing backends without access to the full PDNS source means that you
4821 need to write code that can be loaded by PDNS at runtime. This in turn
4822 means that you need to use the same compiler that we do. For linux, this
4823 is currently GCC 3.0.4, although any 3.0.x compiler is probably fine. In
4824 tests, even 3.1 works.
4825
4826 For FreeBSD we use GCC 2.95.2.
4827
4828 Furthermore, your pdns_server executable must be dynamically linked. The
4829 default .rpm PDNS contains a static binary so you need to retrieve the
4830 dynamic rpm or the dynamic tar.gz or the Debian unstable ('Woody') deb.
4831 FreeBSD dynamic releases are forthcoming.
4832
4833 Q: Will PDNS drivers work with other PDNS versions than they were compiled
4834 for?
4835
4836 A: 'Probably'. We make no guarantees. Efforts have been made to
4837 keep the interface between the backend and PDNS as thin as
4838 possible. For example, a backend compiled with the 1.99.11 backend
4839 development kit works with 1.99.10. But don't count on it. We will
4840 notify when we think an incompatible API change has occured but
4841 you are best off recompiling your driver for each new PDNS
4842 release.
33ccb468 4843
4844 Q: What is in that DNSPacket * pointer passed to lookup!
d16e0461
TP
4845
4846 A: For reasons outlined above, you should treat that pointer as
4847 opaque and only access it via the getRemote() functions made
4848 available and documented above. The DNSPacket class changes a lot
4849 and this level of indirection allows for greater changes to be
4850 made without changing the API to the backend coder.
33ccb468 4851
4852 Q: How is the PowerDNS Open Source Backend Development Kit licensed?
d16e0461
TP
4853
4854 A: MIT X11, a very liberal license permitting basically
4855 everything.
33ccb468 4856
4857 Q: Can I release the backend I wrote?
d16e0461
TP
4858
4859 A: Please do! If you tell us about it we will list you on our
4860 page.
33ccb468 4861
4862 Q: Can I sell backends I wrote?
d16e0461
TP
4863
4864 A: You can. Again, if you tell us about them we will list your
4865 backend on the site. You can keep the source of your backend
4866 secret if you want, or you can share it with the world under any
4867 license of your chosing.
33ccb468 4868
4869 Q: Will PowerDNS use my code in the PDNS distribution?
d16e0461
TP
4870
4871 A: If your license permits it and we like your backend, we sure
4872 will. If your license does not permit it but we like your backend
4873 anyway we may contact you.
33ccb468 4874
4875 Q: My backend compiles but when I try to load it, it says 'undefined
d16e0461
TP
4876 symbol: _Z13BackendMakersv'
4877
4878 A: Your pdns_server binary is static and cannot load a backend
4879 driver at runtime. Get a dynamic version of pdns, or complain to
4880 pdns@powerdns.com if one isn't available. To check what kind of
4881 binary you have, execute 'file $(which pdns_server)'.
33ccb468 4882
4883 Q: My backend compiles but when I try to load it, it says 'undefined
d16e0461
TP
4884 symbol: BackendMakers__Fv'
4885
4886 A: You compiled with the wrong GCC. Use GCC 3.x for Linux, 2.95.x
4887 for FreeBSD. You may want to change g++ to g++-3.0 in the
4888 Makefile, or change your path so that 3.x is used.
33ccb468 4889
4890 Q: I downloaded a dynamic copy of pdns_server but it doesn't run, even
d16e0461
TP
4891 without my backend
4892
4893 A: Run 'ldd' on the pdns_server binary and figure out what
4894 libraries you are missing. Most likely you need to install gcc 3.0
4895 libraries, RedHat 7.1 and 7.2 have packages available, Debian
4896 installs these by default if you use the 'unstable deb' of PDNS.
4897
4898 Q: What I want can't be done from a backend - I need the whole PDNS source
4899
4900 A: If you require the source, please contact us
4901 (pdns@powerdns.com). All commercial licensees receive the source,
4902 for others we may grant exceptions.
33ccb468 4903
4904 Q: What is this 'AhuException' I keep reading about?
d16e0461
TP
4905
4906 A: This name has historical reasons and has no significance.
33ccb468 4907
4908 Q: I need a backend but I can't write it, can you help?
33ccb468 4909
d16e0461
TP
4910 A: Yes, we also do custom development. Contact us at
4911 pdns@powerdns.com.
4912
4913 ----------------------------------------------------------------------
4914
491518.4. About PowerDNS.COM BV, 'the company'
33ccb468 4916
d16e0461
TP
4917 As of 25 November 2002, the PowerDNS nameserver and its modules are open
4918 source. This has led to a lot of questions on the future of both PowerDNS,
4919 the company and the products. This FAQ attempts to address these
4920 questions.
33ccb468 4921
4922 Q: Is PowerDNS 2.9 really open source? What license?
d16e0461
TP
4923
4924 A: PowerDNS 2.9 is licensed under the GNU General Public License
4925 version two, the same license that covers the Linux kernel.
33ccb468 4926
4927 Q: Is the open source version crippled?
d16e0461
TP
4928
4929 A: It is not. Not a single byte has been omitted.
33ccb468 4930
4931 Q: Is the nameserver abandoned?
d16e0461
TP
4932
4933 A: Far from it. In fact, we expect development to speed up now
4934 that we have joined the open source community.
33ccb468 4935
4936 Q: Why is the nameserver now open source?
d16e0461
TP
4937
4938 A: In the current economic climate and also the way the Internet
4939 is built up right now, selling software is very hard. Most
4940 potential customers had never before bought a piece of software
4941 for their UNIX internet setup. Even though we know (from the
4942 recent survey) that nameserver operators love PowerDNS, their
4943 suggested price for it is in the $100 range.
4944
4945 For us, it makes far more sense to open source PowerDNS than to
4946 ask $100 for it. It is expected that open sourcing PowerDNS will
4947 lead to far higher adoption rates. We hope that PowerDNS will soon
4948 be included in major Linux and UNIX distributions.
4949
4950 Q: How does PowerDNS.COM BV expect to make money now that the nameserver
4951 is free?
4952
4953 A: In fact, we don't expect to in the near future. We also don't
4954 have a lot of expenses, basically some hosting and a few domain
4955 names.
4956
4957 However, we are available for consulting work, for example to help
4958 a large registrar or registry migrate to PowerDNS, or to help
4959 integrate our software in existing provisioning systems.
4960
4961 Furthermore, non-GPL licenses are available for those needing to
4962 do closed source modifications, or for customers uncomfortable
4963 with the GPL. This is much like what MySQL AB is doing now.
4964
4965 In fact, their strategy is a lot like ours in general.
33ccb468 4966
4967 Q: Can I buy support contracts for PowerDNS?
d16e0461
TP
4968
4969 Sure, to do so, please contact us at <sales@powerdns.com>
33ccb468 4970
4971 Q: Will you accept patches? We've added a feature
d16e0461
TP
4972
4973 Probably - in general, it is best to discuss your intentions and
4974 needs on the <pdns-dev@mailman.powerdns.com> (subscribe)
4975 mailinglist before doing the work. We may have suggestions or
4976 guidelines on how you should implement the feature.
4977
4978 Q: PowerDNS doesn't work on my platform, will you port it?, Q: PowerDNS
4979 doesn't have feature I need, will you add it?
4980
4981 Be sure to ask on the <pdns-dev@mailman.powerdns.com> (subscribe)
4982 mailinglist. You can even hire us to do work on PowerDNS if plain
4983 asking is not persuasive enough. This might be the case if we
4984 don't currently have time for your feature, but you need it
4985 quickly anyhow, and are not in a position to submit a patch
4986 implementing it.
4987
4988 Q: Will PowerDNS Express be open sourced?
4989
4990 Perhaps, we're not yet sure.
33ccb468 4991
4992 Q: We are a Linux/Unix vendor, can we include PowerDNS?
33ccb468 4993
d16e0461
TP
4994 A: Please do. In fact, we'd be very happy to work with you to make
4995 this happen. Contact <ahu@ds9a.nl> if you have specific upstream
4996 needs.
33ccb468 4997
d16e0461 4998 ----------------------------------------------------------------------
33ccb468 4999
d16e0461 5000 Appendix A. Backends in detail
33ccb468 5001
d16e0461 5002 This appendix lists several of the available backends in more detail
33ccb468 5003
d16e0461 5004 ----------------------------------------------------------------------
33ccb468 5005
d16e0461 5006A.1. PipeBackend
33ccb468 5007
d16e0461 5008 Table A-1. PipeBackend capabilities
33ccb468 5009
d16e0461
TP
5010 +-----------------------+
5011 | Native | Yes |
5012 |-------------+---------|
5013 | Master | No |
5014 |-------------+---------|
5015 | Slave | No |
5016 |-------------+---------|
5017 | Superslave | No |
5018 |-------------+---------|
5019 | Autoserial | No |
5020 |-------------+---------|
5021 | Case | Depends |
5022 |-------------+---------|
5023 | Module name | pipe |
5024 |-------------+---------|
5025 | Launch name | pipe |
5026 +-----------------------+
5027
5028 The PipeBackend allows for easy dynamic resolution based on a 'Coprocess'
5029 which can be written in any programming language that can read a question
5030 on standard input and answer on standard output.
5031
5032 Note The Pipe Backend currently does not function under FreeBSD 4.x and
5033 5.x, probably due to unfavorable interactions between its threading
5034 implementation and the fork system call.
5035
5036 Interestingly, the Linux PowerDNS binary running under the
5037 Linuxulator on FreeBSD does work.
33ccb468 5038
5039 To configure, the following settings are available:
5040
5041 pipe-command
d16e0461
TP
5042
5043 Command to launch as backend. Mandatory.
33ccb468 5044
5045 pipe-timeout
d16e0461
TP
5046
5047 Number of milliseconds to wait for an answer from the backend. If
5048 this time is ever exceeded, the backend is declared dead and a new
5049 process is spawned. Available since 2.7.
33ccb468 5050
5051 pipe-regex
33ccb468 5052
d16e0461
TP
5053 If set, only questions matching this regular expression are even
5054 sent to the backend. This makes sure that most of PowerDNS does
5055 not slow down if you you reploy a slow backend. A query for the A
5056 record of 'www.powerdns.com' would be presented to the regex as
5057 'www.powerdns.com;A'. A matching regex would be
5058 '^www.powerdns.com;.*$'.
5059
5060 To match only ANY and A queries for www.powerdns.com, use
5061 '^www.powerdns.com;(A|ANY)$'. Available since 2.8.
5062
5063 ----------------------------------------------------------------------
33ccb468 5064
d16e0461 5065 A.1.1. PipeBackend protocol
33ccb468 5066
d16e0461
TP
5067 Questions come in over a file descriptor, by default standard input.
5068 Answers are sent out over another file descriptor, standard output by
5069 default.
33ccb468 5070
d16e0461 5071 ----------------------------------------------------------------------
33ccb468 5072
d16e0461 5073 A.1.1.1. Handshake
33ccb468 5074
d16e0461
TP
5075 PowerDNS sends out 'HELO\t1', indicating that it wants to speak the
5076 protocol as defined in this document, version 1. A PowerDNS CoProcess must
5077 then send out a banner, prefixed by 'OK\t', indicating it launched
5078 successfully. If it does not support the indicated version, it should
5079 respond with FAIL, but not exit. Suggested behaviour is to try and read a
5080 further line, and wait to be terminated.
33ccb468 5081
d16e0461
TP
5082 ----------------------------------------------------------------------
5083
5084 A.1.1.2. Questions
5085
5086 Questions come in three forms and are prefixed by a tag indicating the
5087 kind:
33ccb468 5088
5089 Q
d16e0461
TP
5090
5091 Regular queries
33ccb468 5092
5093 AXFR
d16e0461
TP
5094
5095 List requests, which mean that an entire zone should be listed
33ccb468 5096
5097 PING
33ccb468 5098
d16e0461 5099 Check if the coprocess is functioning
33ccb468 5100
d16e0461 5101 The question format:
33ccb468 5102
d16e0461 5103 type qname qclass qtype id ip-address
33ccb468 5104
d16e0461
TP
5105 Fields are tab separated, and terminated with a single \n. Type is the tag
5106 above, qname is the domain the question is about. qclass is always 'IN'
5107 currently, denoting an INternet question. qtype is the kind of information
5108 desired, the record type, like A, CNAME or AAAA. id can be specified to
5109 help your backend find an answer if the id is already known from an
5110 earlier query. You can ignore it. ip-address is the ip-address of the
5111 nameserver asking the question.
33ccb468 5112
d16e0461
TP
5113 ----------------------------------------------------------------------
5114
5115 A.1.1.3. Answers
5116
5117 \r Each answer starts with a tag, possibly followed by a TAB and more data.
33ccb468 5118
5119 DATA
d16e0461
TP
5120
5121 Indicating a successful line of DATA
33ccb468 5122
5123 END
d16e0461
TP
5124
5125 Indicating the end of an answer - no further data
33ccb468 5126
5127 FAIL
d16e0461
TP
5128
5129 Indicating a lookup failure. Also serves as 'END'. No further
5130 data.
33ccb468 5131
5132 LOG
d16e0461
TP
5133
5134 For specifying things that should be logged. Can only be sent
5135 after a query and before an END line. After the tab, the message
5136 to be logged
5137
5138 So letting it be known that there is no data consists if sending 'END'
5139 without anything else. The answer format:
5140
5141 DATA qname qclass qtype ttl id content
5142
5143 'content' is as specified in Chapter 17. A sample dialogue may look like
5144 this:
5145
5146 Q www.ds9a.nl IN CNAME -1 213.244.168.210
5147 DATA www.ds9a.nl IN CNAME 3600 1 ws1.ds9a.nl
5148 Q ws1.ds9a.nl IN CNAME -1 213.244.168.210
5149 END
5150 Q wd1.ds9a.nl IN A -1 213.244.168.210
5151 DATA ws1.ds9a.nl IN A 3600 1 1.2.3.4
5152 DATA ws1.ds9a.nl IN A 3600 1 1.2.3.5
5153 DATA ws1.ds9a.nl IN A 3600 1 1.2.3.6
5154 END
33ccb468 5155
5156 This would correspond to a remote webserver 213.244.168.210 wanting to
d16e0461
TP
5157 resolve the IP address of www.ds9a.nl, and PowerDNS traversing the CNAMEs
5158 to find the IP addresses of ws1.ds9a.nl Another dialogue might be:
5159
5160 Q ds9a.nl IN SOA -1 213.244.168.210
5161 DATA ds9a.nl IN SOA 86400 1 ahu.ds9a.nl ...
5162 END
5163 AXFR 1
5164 DATA ds9a.nl IN SOA 86400 1 ahu.ds9a.nl ...
5165 DATA ds9a.nl IN NS 86400 1 ns1.ds9a.nl
5166 DATA ds9a.nl IN NS 86400 1 ns2.ds9a.nl
5167 DATA ns1.ds9a.nl IN A 86400 1 213.244.168.210
5168 DATA ns2.ds9a.nl IN A 86400 1 63.123.33.135
5169 .
5170 .
5171 END
33ccb468 5172
5173 This is a typical zone transfer.
33ccb468 5174
d16e0461 5175 ----------------------------------------------------------------------
33ccb468 5176
d16e0461 5177 A.1.1.4. Sample perl backend
33ccb468 5178
d16e0461
TP
5179 #!/usr/bin/perl -w
5180 # sample PowerDNS Coprocess backend
5181 #
33ccb468 5182
d16e0461
TP
5183 use strict;
5184
5185
5186 $|=1; # no buffering
5187
5188 my $line=<>;
5189 chomp($line);
5190
5191 unless($line eq "HELO\t1") {
5192 print "FAIL\n";
5193 print STDERR "Recevied '$line'\n";
5194 <>;
5195 exit;
5196 }
5197 print "OK Sample backend firing up\n"; # print our banner
5198
5199 while(<>)
5200 {
5201 print STDERR "$$ Received: $_";
5202 chomp();
5203 my @arr=split(/\t/);
5204 if(@arr<6) {
5205 print "LOG PowerDNS sent unparseable line\n";
5206 print "FAIL\n";
5207 next;
5208 }
5209
5210 my ($type,$qname,$qclass,$qtype,$id,$ip)=split(/\t/);
5211
5212 if(($qtype eq "A" || $qtype eq "ANY") && $qname eq "webserver.example.com") {
5213 print STDERR "$$ Sent A records\n";
5214 print "DATA $qname $qclass A 3600 -1 1.2.3.4\n";
5215 print "DATA $qname $qclass A 3600 -1 1.2.3.5\n";
5216 print "DATA $qname $qclass A 3600 -1 1.2.3.6\n";
5217 }
5218 elsif(($qtype eq "CNAME" || $qtype eq "ANY") && $qname eq "www.example.com") {
5219 print STDERR "$$ Sent CNAME records\n";
5220 print "DATA $qname $qclass CNAME 3600 -1 webserver.example.com\n";
5221 }
5222 elsif($qtype eq "MBOXFW") {
5223 print STDERR "$$ Sent MBOXFW records\n";
5224 print "DATA $qname $qclass MBOXFW 3600 -1 powerdns\@example.com\n";
5225 }
5226
5227
5228 print STDERR "$$ End of data\n";
5229 print "END\n";
5230 }
5231
5232
5233 ----------------------------------------------------------------------
5234
5235A.2. MySQL backend
5236
5237 Warning This backend is deprecated! Use the Generic MySQL backend which is
5238 better in all respects. It does support master/slave operation,
5239 this backend does not. See Section A.5.
5240
5241 So stop reading here unless you already have a database filled
5242 with 'mysql' records.
33ccb468 5243
5244 Table A-2. MySQL backend capabilities
d16e0461
TP
5245
5246 +---------------------------+
5247 | Native | Yes |
5248 |-------------+-------------|
5249 | Master | No |
5250 |-------------+-------------|
5251 | Slave | No |
5252 |-------------+-------------|
5253 | Superslave | No |
5254 |-------------+-------------|
5255 | Autoserial | Yes |
5256 |-------------+-------------|
5257 | Case | Insensitive |
5258 |-------------+-------------|
5259 | Module name | mysql |
5260 |-------------+-------------|
5261 | Launch name | mysql |
5262 +---------------------------+
33ccb468 5263
5264 The MySQL Backend as present in PDNS is fixed - it requires a certain
5265 database schema to function. This schema corresponds to this create
5266 statement:
d16e0461
TP
5267
5268 CREATE TABLE records (
5269 id int(11) NOT NULL auto_increment,
5270 domain_id int(11) NOT NULL,
5271 name varchar(255) NOT NULL,
5272 type varchar(6) NOT NULL,
5273 content varchar(255) NOT NULL,
5274 ttl int(11) NOT NULL,
5275 prio int(11) default NULL,
5276 change_date int(11) default NULL,
5277 PRIMARY KEY (id),
5278 KEY name_index(name),
5279 KEY nametype_index(name,type),
5280 KEY domainid_index(domain_id)
5281 );
5282
5283
5284 Every domain should have a unique domain_id, which should remain identical
5285 for all records in a domain. Records with a domain_id that differs from
5286 that in the domain SOA record will not appear in a zone transfer.
33ccb468 5287
5288 The change_date may optionally be updated to the time_t (the number of
d16e0461
TP
5289 seconds since midnight UTC at the start of 1970), and is in that case used
5290 to auto calculate the SOA serial number in case that is unspecified.
5291
5292 ----------------------------------------------------------------------
33ccb468 5293
d16e0461 5294 A.2.1. Configuration settings
33ccb468 5295
d16e0461
TP
5296 WARNING! Make sure that you can actually resolve the hostname of your
5297 database without accessing the database! It is advised to supply an IP
5298 address here to prevent chicken/egg problems!
33ccb468 5299
5300 mysql-dbname
d16e0461
TP
5301
5302 Database name to connect to
33ccb468 5303
5304 mysql-host
d16e0461
TP
5305
5306 Database host to connect to
33ccb468 5307
5308 mysql-password
d16e0461
TP
5309
5310 Password to connect with
33ccb468 5311
5312 mysql-socket
d16e0461
TP
5313
5314 MySQL socket to use for connecting
33ccb468 5315
5316 mysql-table
d16e0461
TP
5317
5318 MySQL table name. Defaults to 'records'.
33ccb468 5319
5320 mysql-user
33ccb468 5321
d16e0461
TP
5322 MySQL user to connect as
5323
5324 ----------------------------------------------------------------------
5325
5326 A.2.2. Notes
5327
5328 It has been observed that InnoDB tables outperform the default MyISAM
5329 tables by a large margin. Furthermore, the default number of backends (3)
5330 should be raised to 10 or 15 for busy servers.
33ccb468 5331
d16e0461 5332 ----------------------------------------------------------------------
33ccb468 5333
5334A.3. Random Backend
5335
5336 Table A-3. Random Backend capabilities
d16e0461
TP
5337
5338 +------------------------+
5339 | Native | Yes |
5340 |-------------+----------|
5341 | Master | No |
5342 |-------------+----------|
5343 | Slave | No |
5344 |-------------+----------|
5345 | Superslave | No |
5346 |-------------+----------|
5347 | Autoserial | No |
5348 |-------------+----------|
5349 | Case | Depends |
5350 |-------------+----------|
5351 | Module name | built in |
5352 |-------------+----------|
5353 | Lauch name | random |
5354 +------------------------+
5355
5356 This is a very silly backend which is discussed in Section C.1 as a
5357 demonstration on how to write a PowerDNS backend.
5358
5359 This backend knows about only one hostname, and only about its IP address
5360 at that. With every query, a new random IP address is generated.
33ccb468 5361
5362 It only makes sense to load the random backend in combination with a
5363 regular backend. This can be done by prepending it to the launch=
5364 instruction, such as launch=random,gmysql.
5365
5366 Variables:
5367
5368 random-hostname
d16e0461
TP
5369
5370 Hostname for which to supply a random IP address.
5371
5372 ----------------------------------------------------------------------
33ccb468 5373
5374A.4. MySQL PDNS backend
5375
5376 Table A-4. MySQL backend capabilities
d16e0461
TP
5377
5378 +---------------------------+
5379 | Native | Yes |
5380 |-------------+-------------|
5381 | Master | No |
5382 |-------------+-------------|
5383 | Slave | No |
5384 |-------------+-------------|
5385 | Superslave | No |
5386 |-------------+-------------|
5387 | Autoserial | Yes |
5388 |-------------+-------------|
5389 | Case | Insensitive |
5390 |-------------+-------------|
5391 | Module name | pdns |
5392 |-------------+-------------|
5393 | Lauch name | pdns |
5394 +---------------------------+
5395
5396 This is the driver that corresponds to the set of XML-RPC tools available
5397 from PowerDNS.
5398
5399 The schema:
5400
5401 CREATE TABLE MailForwards (
5402 Id int(10) unsigned NOT NULL auto_increment,
5403 ZoneId int(10) unsigned NOT NULL default '0',
5404 Name varchar(255) NOT NULL default '',
5405 Destination varchar(255) NOT NULL default '',
5406 Flags int(11) NOT NULL default '0',
5407 ChangeDate timestamp(14) NOT NULL,
5408 CreateDate timestamp(14) NOT NULL,
5409 Active tinyint(4) NOT NULL default '0',
5410 PRIMARY KEY (Id),
5411 KEY NameIndex (Name),
5412 KEY ZoneIdIndex (ZoneId)
5413 );
5414
5415 --
5416 -- Table structure for table 'Mailboxes'
5417 --
5418
5419 CREATE TABLE Mailboxes (
5420 Id int(10) unsigned NOT NULL auto_increment,
5421 ZoneId int(10) unsigned NOT NULL default '0',
5422 Name varchar(255) NOT NULL default '',
5423 Password varchar(255) NOT NULL default '',
5424 Quota int(10) unsigned NOT NULL default '0',
5425 Flags int(11) NOT NULL default '0',
5426 ChangeDate timestamp(14) NOT NULL,
5427 CreateDate timestamp(14) NOT NULL,
5428 Active tinyint(4) NOT NULL default '0',
5429 PRIMARY KEY (Id),
5430 UNIQUE KEY Name (Name),
5431 KEY ZoneIdIndex (ZoneId),
5432 KEY NameIndex (Name)
5433 );
5434
5435 --
5436 -- Table structure for table 'Records'
5437 --
5438
5439 CREATE TABLE Records (
5440 Id int(10) unsigned NOT NULL auto_increment,
5441 ZoneId int(10) unsigned NOT NULL default '0',
5442 Name varchar(255) NOT NULL default '',
5443 Type varchar(8) NOT NULL default '',
5444 Content varchar(255) NOT NULL default '',
5445 TimeToLive int(11) NOT NULL default '60',
5446 Priority int(11) NOT NULL default '0',
5447 Flags int(11) NOT NULL default '0',
5448 ChangeDate timestamp(14) NOT NULL,
5449 CreateDate timestamp(14) NOT NULL,
5450 Active tinyint(4) NOT NULL default '0',
5451 PRIMARY KEY (Id),
5452 KEY NameIndex (Name)
5453 );
5454
5455 --
5456 -- Table structure for table 'WebForwards'
5457 --
5458
5459 CREATE TABLE WebForwards (
5460 Id int(10) unsigned NOT NULL auto_increment,
5461 ZoneId int(10) unsigned NOT NULL default '0',
5462 Name varchar(255) NOT NULL default '',
5463 Destination varchar(255) NOT NULL default '',
5464 Type varchar(7) NOT NULL default 'NORMAL',
5465 Title varchar(255) NOT NULL default '',
5466 Description varchar(255) NOT NULL default '',
5467 Keywords varchar(255) NOT NULL default '',
5468 FavIcon varchar(255) NOT NULL default '',
5469 Flags int(11) NOT NULL default '0',
5470 ChangeDate timestamp(14) NOT NULL,
5471 CreateDate timestamp(14) NOT NULL,
5472 Active tinyint(4) NOT NULL default '0',
5473 PRIMARY KEY (Id),
5474 KEY NameIndex (Name),
5475 KEY ZoneIdIndex (ZoneId)
5476 );
5477
5478 --
5479 -- Table structure for table 'Zones'
5480 --
5481
5482 CREATE TABLE Zones (
5483 Id int(10) unsigned NOT NULL auto_increment,
5484 Name varchar(255) NOT NULL default '',
5485 Hostmaster varchar(255) NOT NULL default '',
5486 Serial int(10) unsigned NOT NULL default '0',
5487 AutoSerial tinyint(4) NOT NULL default '0',
5488 Flags int(11) NOT NULL default '0',
5489 ChangeDate timestamp(14) NOT NULL,
5490 CreateDate timestamp(14) NOT NULL,
5491 Active tinyint(4) NOT NULL default '0',
5492 TimeToLive int(11) NOT NULL default '0',
5493 OwnerId varchar(255) NOT NULL default '',
5494 PRIMARY KEY (Id),
5495 UNIQUE KEY Name (Name),
5496 KEY NameIndex (Name)
5497 );
5498
5499
33ccb468 5500
5501 It takes a number of parameters:
5502
5503 pdns-dbname
d16e0461
TP
5504
5505 Database name to connect to
33ccb468 5506
5507 pdns-host
d16e0461
TP
5508
5509 Database host to connect to
33ccb468 5510
5511 pdns-password
d16e0461
TP
5512
5513 Password to connect with
33ccb468 5514
5515 pdns-socket
d16e0461
TP
5516
5517 MySQL socket to use for connecting
33ccb468 5518
5519 pdns-user
33ccb468 5520
d16e0461 5521 MySQL user to connect as
33ccb468 5522
d16e0461
TP
5523 ----------------------------------------------------------------------
5524
5525 A.4.1. Notes
5526
5527 It has been observed that InnoDB tables outperform the default MyISAM
5528 tables by a large margin. Furthermore, the default number of backends (3)
5529 should be raised to 10 or 15 for busy servers.
5530
5531 ----------------------------------------------------------------------
33ccb468 5532
5533A.5. Generic MySQL and PgSQL backends
5534
5535 Table A-5. Generic PgSQL and MySQL backend capabilities
d16e0461
TP
5536
5537 +---------------------------------------------------------------+
5538 | Native | Yes - but PostgreSQL does not replicate |
5539 |---------------------+-----------------------------------------|
5540 | Master | Yes |
5541 |---------------------+-----------------------------------------|
5542 | Slave | Yes |
5543 |---------------------+-----------------------------------------|
5544 | Superslave | Yes |
5545 |---------------------+-----------------------------------------|
5546 | Autoserial | NO |
5547 |---------------------+-----------------------------------------|
5548 | Case | All lower |
5549 |---------------------+-----------------------------------------|
5550 | Module name < 2.9.3 | pgmysql |
5551 |---------------------+-----------------------------------------|
5552 | Module name > 2.9.2 | gmysql and gpgsql |
5553 |---------------------+-----------------------------------------|
5554 | Lauch name | gmysql and gpgsql2 and gpgsql |
5555 +---------------------------------------------------------------+
33ccb468 5556
5557 PostgreSQL and MySQL backend with easily configurable SQL statements,
5558 allowing you to graft PDNS on any PostgreSQL or MySQL database of your
5559 choosing. Because all database schemas will be different, a generic
5560 backend is needed to cover all needs.
5561
d16e0461
TP
5562 The template queries are expanded using the C function 'snprintf' which
5563 implies that substitutions are performed on the basis of %-place holders.
5564 To place a a % in a query which will not be substituted, use %%. Make sure
5565 to fill out the search key, often called 'name' in lower case!
33ccb468 5566
d16e0461
TP
5567 There are in fact two backends, one for PostgreSQL and one for MySQL but
5568 they accept the same settings and use almost exactly the same database
5569 schema.
33ccb468 5570
d16e0461 5571 ----------------------------------------------------------------------
33ccb468 5572
d16e0461 5573 A.5.1. MySQL specifics
33ccb468 5574
d16e0461
TP
5575 Warning If using MySQL with 'slave' support enabled in PowerDNS you must
5576 run MySQL with a table engine that supports transactions.
33ccb468 5577
d16e0461
TP
5578 In practice, great results are achieved with the 'InnoDB' tables. PowerDNS
5579 will silently function with non-transaction aware MySQLs but at one point
5580 this is going to harm your database, for example when an incoming zone
5581 transfer fails.
33ccb468 5582
5583 The default setup conforms to the following schema:
d16e0461
TP
5584
5585 create table domains (
33ccb468 5586 id INT auto_increment,
d16e0461
TP
5587 name VARCHAR(255) NOT NULL,
5588 master VARCHAR(20) DEFAULT NULL,
5589 last_check INT DEFAULT NULL,
5590 type VARCHAR(6) NOT NULL,
5591 notified_serial INT DEFAULT NULL,
5592 account VARCHAR(40) DEFAULT NULL,
5593 primary key (id)
5594 )type=InnoDB;
5595
5596 CREATE UNIQUE INDEX name_index ON domains(name);
5597
5598 CREATE TABLE records (
5599 id INT auto_increment,
5600 domain_id INT DEFAULT NULL,
5601 name VARCHAR(255) DEFAULT NULL,
5602 type VARCHAR(6) DEFAULT NULL,
5603 content VARCHAR(255) DEFAULT NULL,
5604 ttl INT DEFAULT NULL,
5605 prio INT DEFAULT NULL,
5606 change_date INT DEFAULT NULL,
5607 primary key(id)
5608 )type=InnoDB;
5609
5610 CREATE INDEX rec_name_index ON records(name);
5611 CREATE INDEX nametype_index ON records(name,type);
5612 CREATE INDEX domain_id ON records(domain_id);
5613
5614 create table supermasters (
5615 ip VARCHAR(25) NOT NULL,
5616 nameserver VARCHAR(255) NOT NULL,
5617 account VARCHAR(40) DEFAULT NULL
5618 );
5619
5620 GRANT SELECT ON supermasters TO pdns;
5621 GRANT ALL ON domains TO pdns;
5622 GRANT ALL ON records TO pdns;
5623
5624
5625 This schema contains all elements needed for master, slave and superslave
5626 operation. Depending on which features will be used, the 'GRANT'
5627 statements can be trimmed to make sure PDNS cannot subvert the contents of
5628 your database.
33ccb468 5629
5630 Zone2sql with the --gmysql flag also assumes this layout is in place.
d16e0461
TP
5631
5632 ----------------------------------------------------------------------
5633
5634 A.5.2. PostgresSQL specifics
5635
5636 The default setup conforms to the following schema, which you should add
5637 to a PostgreSQL database.
5638
5639 create table domains (
5640 id SERIAL PRIMARY KEY,
5641 name VARCHAR(255) NOT NULL,
5642 master VARCHAR(20) DEFAULT NULL,
5643 last_check INT DEFAULT NULL,
5644 type VARCHAR(6) NOT NULL,
5645 notified_serial INT DEFAULT NULL,
5646 account VARCHAR(40) DEFAULT NULL
5647 );
5648 CREATE UNIQUE INDEX name_index ON domains(name);
5649
5650 CREATE TABLE records (
5651 id SERIAL PRIMARY KEY,
5652 domain_id INT DEFAULT NULL,
5653 name VARCHAR(255) DEFAULT NULL,
5654 type VARCHAR(6) DEFAULT NULL,
5655 content VARCHAR(255) DEFAULT NULL,
5656 ttl INT DEFAULT NULL,
5657 prio INT DEFAULT NULL,
5658 change_date INT DEFAULT NULL,
5659 CONSTRAINT domain_exists
5660 FOREIGN KEY(domain_id) REFERENCES domains(id)
5661 ON DELETE CASCADE
5662 );
5663
5664 CREATE INDEX rec_name_index ON records(name);
5665 CREATE INDEX nametype_index ON records(name,type);
5666 CREATE INDEX domain_id ON records(domain_id);
5667
5668 create table supermasters (
5669 ip VARCHAR(25) NOT NULL,
5670 nameserver VARCHAR(255) NOT NULL,
5671 account VARCHAR(40) DEFAULT NULL
5672 );
5673
5674 GRANT SELECT ON supermasters TO pdns;
5675 GRANT ALL ON domains TO pdns;
5676 GRANT ALL ON domains_id_seq TO pdns;
5677 GRANT ALL ON records TO pdns;
5678 GRANT ALL ON records_id_seq TO pdns;
5679
5680
5681 This schema contains all elements needed for master, slave and superslave
5682 operation. Depending on which features will be used, the 'GRANT'
5683 statements can be trimmed to make sure PDNS cannot subvert the contents of
5684 your database.
33ccb468 5685
5686 Zone2sql with the --gpgsql flag also assumes this layout is in place.
33ccb468 5687
d16e0461
TP
5688 With PostgreSQL, you may have to run 'createdb powerdns' first and then
5689 connect to that database with 'psql powerdns', and feed it the schema
5690 above.
5691
5692 ----------------------------------------------------------------------
5693
5694 A.5.3. Basic functionality
33ccb468 5695
d16e0461
TP
5696 4 queries are needed for regular lookups, 4 for 'fancy records' which are
5697 disabled by default and 1 is needed for zone transfers.
33ccb468 5698
d16e0461
TP
5699 The 4+4 regular queries must return the following 6 fields, in this exact
5700 order:
33ccb468 5701
5702 content
d16e0461
TP
5703
5704 This is the 'right hand side' of a DNS record. For an A record,
5705 this is the IP address for example.
33ccb468 5706
5707 ttl
d16e0461
TP
5708
5709 TTL of this record, in seconds. Must be a real value, no checking
5710 is performed.
33ccb468 5711
5712 prio
d16e0461
TP
5713
5714 For MX records, this should be the priority of the mail exchanger
5715 specified.
33ccb468 5716
5717 qtype
d16e0461
TP
5718
5719 The ASCII representation of the qtype of this record. Examples are
5720 'A', 'MX', 'SOA', 'AAAA'. Make sure that this field returns an
5721 exact answer - PDNS won't recognise 'A ' as 'A'. This can be
5722 achieved by using a VARCHAR instead of a CHAR.
33ccb468 5723
5724 domain_id
d16e0461
TP
5725
5726 Each domain must have a unique domain_id. No two domains may share
5727 a domain_id, all records in a domain should have the same. A
5728 number.
33ccb468 5729
5730 name
33ccb468 5731
d16e0461
TP
5732 Actual name of a record. Must not end in a '.' and be fully
5733 qualified - it is not relative to the name of the domain!
5734
5735 Please note that the names of the fields are not relevant, but the order
5736 is!
33ccb468 5737
d16e0461
TP
5738 As said earlier, there are 8 SQL queries for regular lookups. To configure
5739 them, set 'gmysql-basic-query' or 'gpgsql-basic-query', depending on your
5740 choice of backend. If so called 'MBOXFW' fancy records are not used, four
5741 queries remain:
33ccb468 5742
5743 basic-query
d16e0461
TP
5744
5745 Default: select content,ttl,prio,type,domain_id,name from records
5746 where qtype='%s' and name='%s' This is the most used query, needed
5747 for doing 1:1 lookups of qtype/name values. First %s is replaced
5748 by the ASCII representation of the qtype of the question, the
5749 second by the name.
33ccb468 5750
5751 id-query
d16e0461
TP
5752
5753 Default: select content,ttl,prio,type,domain_id,name from records
5754 where qtype='%s' and name='%s' and domain_id=%d Used for doing
5755 lookups within a domain. First %s is replaced by the qtype, the %d
5756 which should appear after the %s by the numeric domain_id.
33ccb468 5757
5758 any-query
d16e0461
TP
5759
5760 For doing ANY queries. Also used internally. Default: select
5761 content,ttl,prio,type,domain_id,name from records where name='%s'
5762 The %s is replaced by the qname of the question.
33ccb468 5763
5764 any-id-query
d16e0461
TP
5765
5766 For doing ANY queries within a domain. Also used internally.
5767 Default: select content,ttl,prio,type,domain_id,name from records
5768 where name='%s' and domain_id=%d The %s is replaced by the name of
5769 the domain, the %d by the numerical domain id.
33ccb468 5770
5771 The last query is for listing the entire contents of a zone. This is
5772 needed when performing a zone transfer, but sometimes also internally:
5773
5774 list-query
33ccb468 5775
d16e0461
TP
5776 To list an entire zone. Default: select
5777 content,ttl,prio,type,domain_id,name from records where
5778 domain_id=%d
5779
5780 ----------------------------------------------------------------------
5781
5782 A.5.4. Master/slave queries
33ccb468 5783
d16e0461
TP
5784 Most installations will have zero need to change the following settings,
5785 but should the need arise, here they are:
33ccb468 5786
5787 master-zone-query
d16e0461
TP
5788
5789 Called to determine the master of a zone. Default: select master
5790 from domains where name='%s' and type='SLAVE'
33ccb468 5791
5792 info-zone-query
d16e0461
TP
5793
5794 Called to retrieve (nearly) all information for a domain: Default:
5795 select id,name,master,last_check,notified_serial,type from domains
5796 where name='%s'
33ccb468 5797
5798 info-all-slaves-query
d16e0461
TP
5799
5800 Called to retrieve all slave domains Default: select
5801 id,name,master,last_check,type from domains where type='SLAVE'
33ccb468 5802
5803 supermaster-query
d16e0461
TP
5804
5805 Called to determine if a certain host is a supermaster for a
5806 certain domain name. Default: select account from supermasters
5807 where ip='%s' and nameserver='%s'");
33ccb468 5808
5809 insert-slave-query
d16e0461
TP
5810
5811 Called to add a domain as slave after a supermaster notification.
5812 Default: insert into domains (type,name,master,account)
5813 values('SLAVE','%s','%s','%s')
33ccb468 5814
5815 insert-record-query
d16e0461
TP
5816
5817 Called during incoming AXFR. Default: insert into records
5818 (content,ttl,prio,type,domain_id,name) values
5819 ('%s',%d,%d,'%s',%d,'%s')
33ccb468 5820
5821 update-serial-query
d16e0461
TP
5822
5823 Called to update the last notified serial of a master domain.
5824 Default: update domains set notified_serial=%d where id=%d
33ccb468 5825
5826 update-lastcheck-query
d16e0461
TP
5827
5828 Called to update the last time a slave domain was checked for
5829 freshness. Default: update domains set notified_serial=%d where
5830 id=%d
33ccb468 5831
5832 info-all-master-query
d16e0461
TP
5833
5834 Called to get data on all domains for which the server is master.
5835 Default: select id,name,master,last_check,notified_serial,type
5836 from domains where type='MASTER'
33ccb468 5837
5838 delete-zone-query
33ccb468 5839
d16e0461
TP
5840 Called to delete all records of a zone. Used before an incoming
5841 AXFR. Default: delete from records where domain_id=%d
5842
5843 ----------------------------------------------------------------------
33ccb468 5844
d16e0461
TP
5845 A.5.5. Fancy records
5846
5847 If PDNS is used with so called 'Fancy Records', the 'MBOXFW' record exists
5848 which specifies an email address forwarding instruction, wildcard queries
5849 are sometimes needed. This is not enabled by default. A wildcard query is
5850 an internal concept - it has no relation to *.domain-type lookups. You can
5851 safely leave these queries blank.
33ccb468 5852
5853 wildcard-query
d16e0461
TP
5854
5855 Can be left blank. See above for an explanation. Default: select
5856 content,ttl,prio,type,domain_id,name from records where qtype='%s'
5857 and name like '%s'
33ccb468 5858
5859 wildcard-id-query
d16e0461
TP
5860
5861 Can be left blank. See above for an explanation. Default: select
5862 content,ttl,prio,type,domain_id,name from records where qtype='%s'
5863 and name like '%s' and domain_id=%d Used for doing lookups within
5864 a domain.
33ccb468 5865
5866 wildcard-any-query
d16e0461
TP
5867
5868 For doing wildcard ANY queries. Default: select
5869 content,ttl,prio,type,domain_id,name from records where name like
5870 '%s'
33ccb468 5871
5872 wildcard-any-id-query
33ccb468 5873
d16e0461
TP
5874 For doing wildcard ANY queries within a domain. Default: select
5875 content,ttl,prio,type,domain_id,name from records where name like
5876 '%s' and domain_id=%d
5877
5878 ----------------------------------------------------------------------
5879
5880 A.5.6. Settings and specifying queries
33ccb468 5881
d16e0461
TP
5882 The queries above are specified in pdns.conf. For example, the basic-query
5883 would appear as:
33ccb468 5884
d16e0461
TP
5885 gpgsql-basic-query=select content,ttl,prio,type,domain_id,name from records where qtype='%s' and name='%s'
5886
33ccb468 5887
d16e0461
TP
5888 When using the Generic PostgreSQL backend, they appear as above. When
5889 using the generic MySQL backend, change the "gpgsql-" prefix to "gmysql-".
33ccb468 5890
5891 Queries can span multiple lines, like this:
33ccb468 5892
d16e0461
TP
5893 gpgsql-basic-query=select content,ttl,prio,type,domain_id,name from records \
5894 where qtype='%s' and name='%s'
5895
33ccb468 5896
d16e0461
TP
5897 Do not wrap statements in quotes as this will not work. Besides the query
5898 related settings, the following configuration options are available:
33ccb468 5899
5900 gpgsql-dbname
d16e0461
TP
5901
5902 Database name to connect to
33ccb468 5903
5904 gpgsql-host
d16e0461
TP
5905
5906 Database host to connect to. WARNING: When specified as a hostname
5907 a chicken/egg situation might arise where the database is needed
5908 to resolve the IP address of the database. It is best to supply an
5909 IP address of the database here.
5910
5911 gmysql-socket (only for MySQL!)
5912
5913 Filename where the MySQL connection socket resides. Often
5914 /tmp/mysql.sock or /var/run/mysqld/mysqld.sock.
33ccb468 5915
5916 gpgsql-password
d16e0461
TP
5917
5918 Password to connect with
33ccb468 5919
5920 gpgsql-user
33ccb468 5921
d16e0461
TP
5922 PgSQL user to connect as
5923
5924 ----------------------------------------------------------------------
5925
5926 A.5.7. Native operation
5927
5928 For native operation, either drop the FOREIGN KEY on the domain_id field,
5929 or (recommended), make sure the domains table is filled properly. To add a
5930 domain, issue the following:
33ccb468 5931
d16e0461
TP
5932 insert into domains (name,type) values ('powerdns.com','NATIVE');
5933
33ccb468 5934
d16e0461
TP
5935 The records table can now be filled by with the domain_id set to the id of
5936 the domains table row just inserted.
33ccb468 5937
d16e0461 5938 ----------------------------------------------------------------------
33ccb468 5939
d16e0461 5940 A.5.8. Slave operation
33ccb468 5941
d16e0461
TP
5942 The PostgreSQL backend is fully slave capable. To become a slave of the
5943 'powerdns.com' domain, execute this:
33ccb468 5944
d16e0461
TP
5945 insert into domains (name,master,type) values ('powerdns.com','213.244.168.217','SLAVE');
5946
33ccb468 5947
d16e0461
TP
5948 And wait a while for PDNS to pick up the addition - which happens within
5949 one minute. There is no need to inform PDNS that a new domain was added.
5950 Typical output is:
33ccb468 5951
d16e0461
TP
5952 Apr 09 13:34:29 All slave domains are fresh
5953 Apr 09 13:35:29 1 slave domain needs checking
5954 Apr 09 13:35:29 Domain powerdns.com is stale, master serial 1, our serial 0
5955 Apr 09 13:35:30 [gPgSQLBackend] Connected to database
5956 Apr 09 13:35:30 AXFR started for 'powerdns.com'
5957 Apr 09 13:35:30 AXFR done for 'powerdns.com'
5958 Apr 09 13:35:30 [gPgSQLBackend] Closing connection
5959
33ccb468 5960
d16e0461
TP
5961 From now on, PDNS is authoritative for the 'powerdns.com' zone and will
5962 respond accordingly for queries within that zone.
33ccb468 5963
d16e0461
TP
5964 Periodically, PDNS schedules checks to see if domains are still fresh. The
5965 default slave-cycle-interval is 60 seconds, large installations may need
5966 to raise this value. Once a domain has been checked, it will not be
5967 checked before its SOA refresh timer has expired. Domains whose status is
5968 unknown get checked every 60 seconds by default.
33ccb468 5969
d16e0461 5970 ----------------------------------------------------------------------
33ccb468 5971
d16e0461 5972 A.5.9. Superslave operation
33ccb468 5973
d16e0461
TP
5974 To configure a supermaster with IP address 10.0.0.11 which lists this
5975 installation as 'autoslave.powerdns.com', issue the following:
33ccb468 5976
d16e0461
TP
5977 insert into supermasters ('10.0.0.11','autoslave.powerdns.com','internal');
5978
33ccb468 5979
d16e0461
TP
5980 From now on, valid notifies from 10.0.0.11 that list a NS record
5981 containing 'autoslave.powerdns.com' will lead to the provisioning of a
5982 slave domain under the account 'internal'. See Section 13.2.1 for details.
33ccb468 5983
d16e0461 5984 ----------------------------------------------------------------------
33ccb468 5985
d16e0461 5986 A.5.10. Master operation
33ccb468 5987
d16e0461
TP
5988 The PostgreSQL backend is fully master capable with automatic discovery of
5989 serial changes. Raising the serial number of a domain suffices to trigger
5990 PDNS to send out notifications. To configure a domain for master operation
5991 instead of the default native replication, issue:
33ccb468 5992
d16e0461
TP
5993 insert into domains (name,type) values ('powerdns.com','MASTER');
5994
5995
5996 Make sure that the assigned id in the domains table matches the domain_id
5997 field in the records table!
5998
5999 ----------------------------------------------------------------------
33ccb468 6000
6001A.6. Generic Oracle backend
6002
6003 Table A-6. Oracle backend capabilities
d16e0461
TP
6004
6005 +----------------------+
6006 | Native | Yes |
6007 |-------------+--------|
6008 | Master | No |
6009 |-------------+--------|
6010 | Slave | No |
6011 |-------------+--------|
6012 | Superslave | No |
6013 |-------------+--------|
6014 | Autoserial | Yes |
6015 |-------------+--------|
6016 | Module name | oracle |
6017 |-------------+--------|
6018 | Launch name | oracle |
6019 +----------------------+
6020
6021 Oracle backend with easily configurable SQL statements, allowing you to
6022 graft PDNS on any Oracle database of your choosing.
6023
6024 PowerDNS is currently ascertaining if this backend can be distributed in
6025 binary form without violating Oracle licensing. In the meantime, the
6026 source code to the Oracle backend is available in the pdns distribution.
33ccb468 6027
6028 The following configuration settings are available:
6029
6030 oracle-debug-queries
d16e0461
TP
6031
6032 Output all queries to disk for debugging purposes.
33ccb468 6033
6034 oracle-time-queries
d16e0461
TP
6035
6036 Output all queries to disk for timing purposes.
33ccb468 6037
6038 oracle-uppercase-database
d16e0461
TP
6039
6040 Change all domain names to uppercase before querying database.
33ccb468 6041
6042 oracle-database
d16e0461
TP
6043
6044 Oracle database name to connect to.
33ccb468 6045
6046 oracle-home
d16e0461
TP
6047
6048 PDNS can set the ORACLE_HOME environment variable from within the
6049 executable, allowing execution of the daemon from init.d scripts
6050 where ORACLE_HOME may not yet be set.
33ccb468 6051
6052 oracle-sid
d16e0461
TP
6053
6054 PDNS can set the ORACLE_SID environment variable from within the
6055 executable, allowing execution of the daemon from init.d scripts
6056 where ORACLE_SID may not yet be set.
33ccb468 6057
6058 oracle-username
d16e0461
TP
6059
6060 Oracle username to connect as.
33ccb468 6061
6062 oracle-password
d16e0461
TP
6063
6064 Oracle password to connect with.
33ccb468 6065
6066 The generic Oracle backend can be configured to use user-specified
6067 queries. The following are the default queries and their names:
6068
6069 oracle-forward-query
d16e0461
TP
6070
6071 select content, TimeToLive, Priority, type, ZoneId,
6072 nvl(ChangeDate,0) from Records where name = :name and type = :type
33ccb468 6073
6074 oracle-forward-query-by-zone
d16e0461
TP
6075
6076 select content, TimeToLive, Priority, type, ZoneId,
6077 nvl(ChangeDate,0) from records where name = :name and type = :type
6078 and ZoneId = :id
33ccb468 6079
6080 oracle-forward-any-query
d16e0461
TP
6081
6082 select content, TimeToLive, Priority, type, ZoneId,
6083 nvl(ChangeDate,0) from records where name = :name
33ccb468 6084
6085 oracle-list-query
33ccb468 6086
d16e0461
TP
6087 select content, TimeToLive, Priority, type, ZoneId,
6088 nvl(ChangeDate, 0), name from records where ZoneId = :id
33ccb468 6089
d16e0461 6090 ----------------------------------------------------------------------
33ccb468 6091
d16e0461 6092 A.6.1. Setting up Oracle for use with PowerDNS
33ccb468 6093
d16e0461
TP
6094 To setup a database that corresponds to these default queries, issue the
6095 following as Oracle user sys:
33ccb468 6096
d16e0461
TP
6097 create user powerdns identified by YOURPASSWORD;
6098 grant connect to powerdns;
6099
6100 create tablespace powerdns datafile '/opt/oracle/oradata/oracle/powerdns.dbf'
6101 size 256M extent management local autoallocate;
6102
6103 alter user powerdns quota unlimited on powerdns;
6104
33ccb468 6105
6106 As user 'powerdns' continue with:
33ccb468 6107
d16e0461
TP
6108 create table Domains (
6109 ID number(11) NOT NULL,
6110 NAME VARCHAR(255) NOT NULL,
6111 MASTER VARCHAR(20) DEFAULT NULL,
6112 LAST_CHECK INT DEFAULT NULL,
6113 TYPE VARCHAR(6) NOT NULL,
6114 NOTIFIED_SERIAL INT DEFAULT NULL,
6115 ACCOUNT VARCHAR(40) DEFAULT NULL,
6116 primary key (ID)
6117 )tablespace POWERDNS;
6118
6119 create index DOMAINS$NAME on Domains (NAME) tablespace POWERDNS;
6120 create sequence DOMAINS_ID_SEQUENCE;
6121
6122 create table Records
6123 (
6124 ID number(11) NOT NULL,
6125 ZoneID number(11) default NULL REFERENCES Domains(ID) ON DELETE CASCADE,
6126 NAME varchar2(255) default NULL,
6127 TYPE varchar2(6) default NULL,
6128 CONTENT varchar2(255) default NULL,
6129 TimeToLive number(11) default NULL,
6130 Priority number(11) default NULL,
6131 CreateDate number(11) default NULL,
6132 ChangeDate number(11) default NULL,
6133 primary key (ID)
6134 )tablespace POWERDNS;
6135
6136 create index RECORDS$NAME on RECORDS (NAME) tablespace POWERDNS;
6137 create sequence RECORDS_ID_SEQUENCE;
6138
33ccb468 6139
6140 To insert records, either use zone2sql with the --oracle setting, or
6141 execute sql along the lines of:
33ccb468 6142
d16e0461
TP
6143 insert into domains (id,name,type) values (domains_id_sequence.nextval,'netherlabs.nl','NATIVE');
6144 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';
6145 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';
6146 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';
6147 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';
6148 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';
6149 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 6150
d16e0461 6151
33ccb468 6152
6153 For performance reasons it is best to specify --transactions too!
33ccb468 6154
d16e0461
TP
6155 ----------------------------------------------------------------------
6156
6157A.7. Generic SQLite backend
6158
6159 Table A-7. Generic SQLite backend capabilities
6160
6161 +-----------------------+
6162 | Native | Yes |
6163 |-------------+---------|
6164 | Master | Yes |
6165 |-------------+---------|
6166 | Slave | Yes |
6167 |-------------+---------|
6168 | Superslave | Yes |
6169 |-------------+---------|
6170 | Module name | gsqlite |
6171 |-------------+---------|
6172 | Launch name | gsqlite |
6173 +-----------------------+
6174
6175 This backend retrieves all data from a SQLite database, which is a RDBMS
6176 that's embedded into the application itself, so you won't need to be
6177 running a seperate server process. It also reduces overhead, and
6178 simplifies installation. At http://www.sqlite.org you can find more
6179 information about SQLite.
6180
6181 As this is a generic backend, built on top of the gSql framework, you can
6182 specify all queries as documented in Generic MySQL and PgSQL backends.
6183
6184 ----------------------------------------------------------------------
6185
6186 A.7.1. Compiling the SQLite backend
6187
6188 Before you can begin compiling PowerDNS with the SQLite backend you need
6189 to have the SQLite utility and library installed on your system. You can
6190 download these from http://www.sqlite.org/download.html, or you can use
6191 packages (if your distribution provides those).
6192
6193 When you've installed the library you can use: ./configure
6194 --with-modules="gsqlite" to configure PowerDNS to use the SQLite backend.
6195 Compilation can then proceed as usual.
6196
6197 SQLite is included in most PowerDNS binary releases.
6198
6199 ----------------------------------------------------------------------
6200
6201 A.7.2. Setting up the database
6202
6203 Before you can use this backend you first have to set it up and fill it
6204 with data. The default setup conforms to the following schema:
6205
6206 create table domains (
6207 id INTEGER PRIMARY KEY,
6208 name VARCHAR(255) NOT NULL,
6209 master VARCHAR(20) DEFAULT NULL,
6210 last_check INTEGER DEFAULT NULL,
6211 type VARCHAR(6) NOT NULL,
6212 notified_serial INTEGER DEFAULT NULL,
6213 account VARCHAR(40) DEFAULT NULL
6214 );
6215
6216 CREATE UNIQUE INDEX name_index ON domains(name);
6217
6218 CREATE TABLE records (
6219 id INTEGER PRIMARY KEY,
6220 domain_id INTEGER DEFAULT NULL,
6221 name VARCHAR(255) DEFAULT NULL,
6222 type VARCHAR(6) DEFAULT NULL,
6223 content VARCHAR(255) DEFAULT NULL,
6224 ttl INTEGER DEFAULT NULL,
6225 prio INTEGER DEFAULT NULL,
6226 change_date INTEGER DEFAULT NULL
6227 );
6228
6229 CREATE INDEX rec_name_index ON records(name);
6230 CREATE INDEX nametype_index ON records(name,type);
6231 CREATE INDEX domain_id ON records(domain_id);
6232
6233 create table supermasters (
6234 ip VARCHAR(25) NOT NULL,
6235 nameserver VARCHAR(255) NOT NULL,
6236 account VARCHAR(40) DEFAULT NULL
6237 );
6238
6239
6240 This schema contains all elements needed for master, slave and superslave
6241 operation.
6242
6243 After you have created the database you probably want to fill it with
6244 data. If you have a BIND zonefile it's as easy as: zone2sql
6245 --zone=myzonefile --gmysql | sqlite powerdns.sqlite, but you can also use
6246 AXFR (or insert data manually if you have too much time ;)).
6247
6248 ----------------------------------------------------------------------
6249
6250 A.7.3. Using the SQLite backend
6251
6252 The last thing you need to do is telling PowerDNS to use the SQLite
6253 backend.
6254
6255 # in pdns.conf
6256 launch=gsqlite
6257 gsqlite-database=<path to your SQLite database>
6258
6259
6260 Then you can start PowerDNS and it should notify you that a connection to
6261 the database was made.
33ccb468 6262
d16e0461 6263 ----------------------------------------------------------------------
33ccb468 6264
d16e0461
TP
6265A.8. DB2 backend
6266
6267 Table A-8. DB2 backend capabilities
6268
6269 +-------------------+
6270 | Native | Yes |
6271 |-------------+-----|
6272 | Master | No |
6273 |-------------+-----|
6274 | Slave | No |
6275 |-------------+-----|
6276 | Superslave | No |
6277 |-------------+-----|
6278 | Autoserial | Yes |
6279 |-------------+-----|
6280 | Module name | db2 |
6281 |-------------+-----|
6282 | Launch name | db2 |
6283 +-------------------+
6284
6285 PowerDNS is currently ascertaining if this backend can be distributed in
6286 binary form without violating IBM DB2 licensing.
33ccb468 6287
6288 The DB2 backend executes the following queries:
6289
6290 Forward Query
d16e0461
TP
6291
6292 select Content, TimeToLive, Priority, Type, ZoneId, 0 as
6293 ChangeDate, Name from Records where Name = ? and type = ?
33ccb468 6294
6295 Forward By Zone Query
d16e0461
TP
6296
6297 select Content, TimeToLive, Priority, Type, ZoneId, 0 as
6298 ChangeDate, Name from Records where Name = ? and Type = ? and
6299 ZoneId = ?
33ccb468 6300
6301 Forward Any Query
d16e0461
TP
6302
6303 select Content, TimeToLive, Priority, Type, ZoneId, 0 as
6304 ChangeDate, Name from Records where Name = ?
33ccb468 6305
6306 List Query
d16e0461
TP
6307
6308 select Content, TimeToLive, Priority, Type, ZoneId, 0 as
6309 ChangeDate, Name from Records where ZoneId = ?
33ccb468 6310
6311 Configuration settings:
6312
6313 db2-server
d16e0461
TP
6314
6315 Server name to connect to. Defaults to 'powerdns'. Make sure that
6316 your nameserver is not needed to resolve an IP address needed to
6317 connect as this might lead to a chicken/egg situation.
33ccb468 6318
6319 db2-user
d16e0461
TP
6320
6321 Username to connect as. Defaults to 'powerdns'.
33ccb468 6322
6323 db2-password
33ccb468 6324
d16e0461
TP
6325 Password to connect with. Defaults to 'powerdns'.
6326
6327 ----------------------------------------------------------------------
6328
6329A.9. Bind zone file backend
6330
6331 Table A-9. Bind zone file backend capabilities
33ccb468 6332
d16e0461
TP
6333 +-------------------------------+
6334 | Native | Yes |
6335 |-------------+-----------------|
6336 | Master | Yes |
6337 |-------------+-----------------|
6338 | Slave | Yes |
6339 |-------------+-----------------|
6340 | Superslave | No |
6341 |-------------+-----------------|
6342 | Autoserial | No |
6343 |-------------+-----------------|
6344 | Module name | none (built in) |
6345 |-------------+-----------------|
6346 | Launch | bind |
6347 +-------------------------------+
33ccb468 6348
d16e0461
TP
6349 Note There is also the Bind2backend which works exactly like this backend
6350 but is far more experimental. In the future it supplant the
6351 bindbackend.
33ccb468 6352
d16e0461
TP
6353 The BindBackend started life as a demonstration of the versatility of PDNS
6354 but quickly gained in importance when there appeared to be demand for a
6355 Bind 'workalike'.
6356
6357 The BindBackend parses a Bind-style named.conf and extracts information
6358 about zones from it. It makes no attempt to honour other configuration
6359 flags, which you should configure (when available) using the PDNS native
6360 configuration.
33ccb468 6361
6362 --help=bind
d16e0461
TP
6363
6364 Outputs all known parameters related to the bindbackend
33ccb468 6365
6366 bind-example-zones
d16e0461
TP
6367
6368 Loads the 'example.com' zone which can be queried to determine if
6369 PowerDNS is functioning without configuring database backends.
33ccb468 6370
6371 bind-config=
d16e0461
TP
6372
6373 Location of the Bind configuration file to parse.
33ccb468 6374
6375 bind-check-interval=
d16e0461
TP
6376
6377 How often to check for zone changes. See 'Operation' section.
33ccb468 6378
6379 bind-enable-huffman
33ccb468 6380
d16e0461
TP
6381 Enable Huffman compression on zone data. Currently saves around
6382 20% of memory actually used, but slows down operation somewhat.
6383
6384 ----------------------------------------------------------------------
6385
6386 A.9.1. Operation
6387
6388 On launch, the BindBackend first parses the named.conf to determine which
6389 zones need to be loaded. These will then be parsed and made available for
6390 serving, as they are parsed. So a named.conf with 100.000 zones may take
6391 20 seconds to load, but after 10 seconds, 50.000 zones will already be
6392 available. While a domain is being loaded, it is not yet available, to
6393 prevent incomplete answers.
33ccb468 6394
d16e0461
TP
6395 Reloading is currently done only when a request for a zone comes in, and
6396 then only after bind-check-interval seconds have passed after the last
6397 check. If a change occurred, access to the zone is disabled, the file is
6398 reloaded, access is restored, and the question is answered. For regular
6399 zones, reloading is fast enough to answer the question which lead to the
6400 reload within the DNS timeout.
33ccb468 6401
d16e0461
TP
6402 If bind-check-interval is specified as zero, no checks will be performed
6403 until the pdns_control reload is given.
33ccb468 6404
d16e0461 6405 ----------------------------------------------------------------------
33ccb468 6406
d16e0461 6407 A.9.2. Pdns_control commands
33ccb468 6408
6409 bind-domain-status domain [domain]
d16e0461
TP
6410
6411 Output status of domain or domains. Can be one of 'seen in
6412 named.conf, not parsed', 'parsed successfully at <time;>' or
6413 'error parsing at line ... at <time>'.
33ccb468 6414
6415 bind-list-rejects
d16e0461
TP
6416
6417 Lists all zones that have problems, and what those problems are.
33ccb468 6418
6419 bind-reload-now domain
33ccb468 6420
d16e0461
TP
6421 Reloads a zone from disk NOW, reporting back results.
6422
6423 ----------------------------------------------------------------------
6424
6425 A.9.3. Performance
33ccb468 6426
d16e0461
TP
6427 The BindBackend does not benefit from the packet cache as it is fast
6428 enough on its own. Furthermore, on most systems, there will be no benefit
6429 in using multiple CPUs for the packetcache, so a noticeable speedup can be
6430 attained by specifying distributor-threads=1 in pdns.conf.
33ccb468 6431
d16e0461 6432 ----------------------------------------------------------------------
33ccb468 6433
d16e0461 6434 A.9.4. Master/slave configuration
33ccb468 6435
d16e0461 6436 A.9.4.1. Master
33ccb468 6437
d16e0461
TP
6438 Works as expected. At startup, no notification storm is performed as this
6439 is generally not useful. Perhaps in the future the Bind Backend will
6440 attempt to store zone metadata in the zone, allowing it to determine if a
6441 zone has changed its serial since the last time notifications were sent
6442 out.
33ccb468 6443
d16e0461
TP
6444 Changes which are discovered when reloading zones do lead to notifications
6445 however.
33ccb468 6446
d16e0461 6447 ----------------------------------------------------------------------
33ccb468 6448
d16e0461 6449 A.9.4.2. Slave
33ccb468 6450
d16e0461
TP
6451 Also works as expected. The Bind backend expects to be able to write to a
6452 directory where a slave domain lives. The incoming zone is stored as
6453 'zonename.RANDOM' and atomically renamed if it is retrieved successfully,
6454 and parsed only then.
33ccb468 6455
d16e0461
TP
6456 In the future, this may be improved so the old zone remains available
6457 should parsing fail.
6458
6459 ----------------------------------------------------------------------
6460
6461 A.9.5. Commands
6462
6463 pdns_control offers commands to communicate instructions to PowerDNS.
6464 These are detailed here.
33ccb468 6465
6466 rediscover
33ccb468 6467
d16e0461
TP
6468 Reread the bind configuration file (named.conf). If parsing fails,
6469 the old configuration remains in force and pdns_control reports
6470 the error. Any newly discovered domains are read, discarded
6471 domains are removed from memory.
6472
6473 Note Except that with 2.9.3, they are not removed from
6474 memory.
33ccb468 6475
d16e0461
TP
6476 reload
6477
6478 All zones with a changed timestamp are reloaded at the next
6479 incoming query for them.
33ccb468 6480
d16e0461 6481 ----------------------------------------------------------------------
33ccb468 6482
d16e0461 6483A.10. ODBC backend
33ccb468 6484
d16e0461 6485 Table A-10. ODBC backend capabilities
33ccb468 6486
d16e0461
TP
6487 +---------------------------------+
6488 | Native | Yes |
6489 |------------+--------------------|
6490 | Master | Yes (experimental) |
6491 |------------+--------------------|
6492 | Slave | Yes (experimental) |
6493 |------------+--------------------|
6494 | Superslave | No |
6495 |------------+--------------------|
6496 | Autoserial | Yes |
6497 +---------------------------------+
33ccb468 6498
d16e0461
TP
6499 The ODBC backend can retrieve zone information from any source that has a
6500 ODBC driver available.
33ccb468 6501
d16e0461 6502 Note This backend is only available on PowerDNS for Windows.
33ccb468 6503
6504 The ODBC backend needs data in a fixed schema which is the same as the
d16e0461
TP
6505 data needed by the MySQL backend. The create statement will resemble this:
6506
6507 CREATE TABLE records (
6508 id int(11) NOT NULL auto_increment,
6509 domain_id int(11) default NULL,
6510 name varchar(255) default NULL,
6511 type varchar(6) default NULL,
6512 content varchar(255) default NULL,
6513 ttl int(11) default NULL,
6514 prio int(11) default NULL,
6515 change_date int(11) default NULL,
6516 PRIMARY KEY (id),
6517 KEY name_index(name),
6518 KEY nametype_index(name,type),
6519 KEY domainid_index(domain_id)
6520 );
6521
6522
6523 To use the ODBC backend an ODBC source has to be created, to do this see
6524 the section Installing PowerDNS on Microsoft Windows, Chapter 3.
33ccb468 6525
6526 The following configuration settings are available:
6527
6528 odbc-datasource
d16e0461
TP
6529
6530 Specifies the name of the data source to use.
33ccb468 6531
6532 odbc-user
d16e0461
TP
6533
6534 Specifies the username that has to be used to log into the
6535 datasource.
33ccb468 6536
6537 odbc-pass
d16e0461
TP
6538
6539 Specifies the user's password.
33ccb468 6540
6541 odbc-table
33ccb468 6542
d16e0461
TP
6543 Specifies the name of the table containing the zone information.
6544
6545 The ODBC backend has been tested with Microsoft Access, MySQL (via MyODBC)
6546 and Microsoft SQLServer. As the SQL statements used are very basic, it is
6547 expected to work with many ODBC drivers.
6548
6549 ----------------------------------------------------------------------
6550
6551A.11. XDB Backend
6552
6553 Special purpose backend for grandiose performance. Can talk to Tridge's
6554 Trivial Database, or to regular *db tables on disk. Currently only
6555 sparsely documented. Very useful if you need to do >50.000 queries/second,
6556 which we actually measured on the .ORG zone.
6557
6558 More documentation will follow.
6559
6560 ----------------------------------------------------------------------
6561
6562A.12. LDAP backend
6563
6564 The main author for this module is Norbert Sendetzky who also has his own
6565 PowerDNS-LDAP page.
6566
6567 Table A-11. LDAP backend capabilities
6568
6569 +------------------+
6570 | Native | Yes |
6571 |------------+-----|
6572 | Master | No |
6573 |------------+-----|
6574 | Slave | No |
6575 |------------+-----|
6576 | Superslave | No |
6577 |------------+-----|
6578 | Autoserial | Yes |
6579 +------------------+
6580
6581 As of 2.9.6, PowerDNS comes with an LDAP backend. The code for this was
6582 submitted by Norbert Sendetzky.
6583
6584 The following settings are available to configure the LDAP backend:
6585
6586 ldap-host
6587
6588 LDAP host to connect to, defaults to localhost.
6589
6590 ldap-port
6591
6592 LDAP port to connect to, defaults to 389.
6593
6594 ldap-basedn
6595
6596 Root for DNS searches. Must be configured before the LDAP backend
6597 will work.
6598
6599 ldap-binddn
6600
6601 Distinguished Name to bind with to the LDAP server. Defaults to
6602 the empty string for anonymous bind.
6603
6604 ldap-secret
6605
6606 Secret to bind with to LDAP server. Defaults to the empty string
6607 for anonymous bind.
6608
6609 ldap-default-ttl
6610
6611 TTL for records with no dnsttl attribute. Defaults to 86400
6612 seconds.
6613
6614 The schema used is that defined by RFC 1279 and is present in OpenLDAP
6615 under the name 'cosine.schema'. An example LDIF file:
6616
6617 # zone related things including SOA, NS and MX records
33ccb468 6618
d16e0461
TP
6619 dn: dc=example
6620 objectclass: top
6621 objectclass: dnsdomain
6622 objectclass: domainrelatedobject
6623 dc: example
6624 soarecord: ns.example.dom hostmaster@example.dom 2002010401 1800 3600 604800 84600
6625 nsrecord: ns.example.dom
6626 mxrecord: 10 mail.example.dom
6627 mxrecord: 20 mail2.example.dom
6628 associateddomain: example.dom
33ccb468 6629
33ccb468 6630
d16e0461 6631 # Simple record (mail.example.dom has address 172.168.0.2)
33ccb468 6632
d16e0461
TP
6633 dn: dc=mail,dc=example
6634 objectclass: top
6635 objectclass: dnsdomain
6636 objectclass: domainrelatedobject
6637 dc: mail
6638 arecord: 172.168.0.2
6639 associateddomain: mail.example.dom
33ccb468 6640
d16e0461
TP
6641 # There may more than one entry per record
6642 # This is also applicable to all other records including "associateddomain"
6643 # but not for a CNAME record
6644
6645 dn: dc=server,dc=snapcount
6646 objectclass: top
6647 objectclass: dnsdomain
6648 objectclass: domainrelatedobject
6649 dc: server
6650 arecord: 10.1.0.1
6651 arecord: 172.168.0.1
6652 associateddomain: server.example.dom
6653
6654
6655 # domain alias ({mail2,ns}.example.dom is CNAME for server.example.dom)
6656 # cnamerecord must only contain one entry
6657
6658 dn: dc=backup,dc=snapcount
6659 objectclass: top
6660 objectclass: dnsdomain
6661 objectclass: domainrelatedobject
6662 dc: server
6663 cnamerecord: server.example.dom
6664 associateddomain: mail2.example.dom
6665 associateddomain: ns.example.dom
6666
6667 ----------------------------------------------------------------------
6668
6669 Appendix B. PDNS internals
6670
6671 PDNS is normally launched by the init.d script but is actually a binary
6672 called pdns_server. This file is started by the start and monitor commands
6673 to the init.d script. Other commands are implemented using the
6674 controlsocket.
6675
6676 ----------------------------------------------------------------------
33ccb468 6677
6678B.1. Controlsocket
6679
d16e0461
TP
6680 The controlsocket is the means to contact a running PDNS daemon, or as we
6681 now know, a running pdns_server. Over this sockets, instructions can be
6682 sent using the pdns_control program. Like the pdns_server, this program is
6683 normally accessed via the init.d script.
33ccb468 6684
d16e0461 6685 ----------------------------------------------------------------------
33ccb468 6686
d16e0461 6687 B.1.1. pdns_control
33ccb468 6688
d16e0461
TP
6689 To communicate with PDNS over the controlsocket, the pdns_control command
6690 is used. The init.d script also calls pdns_control. The syntax is simple:
6691 pdns_control command arguments. Currently this is most useful for telling
6692 backends to rediscover domains or to force the transmission of
6693 notifications. See Section 13.3.
6694
6695 Besides the commands implemented by the init.d script, for which see
6696 Section 2.3, the following pdns_control commands are available:
33ccb468 6697
6698 ccounts
d16e0461
TP
6699
6700 Returns counts on the contents of the cache.
33ccb468 6701
6702 notify domain
d16e0461
TP
6703
6704 Adds a domain to the notification list, causing PDNS to send out
6705 notifications to the nameservers of a domain. Can be used if a
6706 slave missed previous notifications or is generally hard of
6707 hearing.
33ccb468 6708
6709 notify-host domain host
d16e0461
TP
6710
6711 Same as above but with operator specified IP address as
6712 destination, to be used if you know better than PowerDNS.
33ccb468 6713
6714 purge
d16e0461
TP
6715
6716 Purges the entire Packet Cache - see Chapter 9.
33ccb468 6717
6718 purge record
d16e0461
TP
6719
6720 Purges all entries for this exact record name - see Chapter 9.
33ccb468 6721
6722 purge record$
d16e0461
TP
6723
6724 Purges all cache entries ending on this name, effectively purging
6725 an entire domain - see Chapter 9.
33ccb468 6726
6727 purge
d16e0461
TP
6728
6729 Purges the entire Packet Cache - see Chapter 9.
33ccb468 6730
6731 purge record
d16e0461
TP
6732
6733 Purges all entries for this exact record name - see Chapter 9.
33ccb468 6734
6735 rediscover
d16e0461
TP
6736
6737 Instructs backends that new domains may have appeared in the
6738 database, or, in the case of the Bind backend, in named.conf.
33ccb468 6739
6740 reload
d16e0461
TP
6741
6742 Instructs backends that the contents of domains may have changed.
6743 Many backends ignore this, the Bind backend will check timestamps
6744 for all zones (once queries come in for it) and reload if needed.
33ccb468 6745
6746 retrieve domain
d16e0461
TP
6747
6748 Retrieve a slave domain from its master. Done nearly immediatly.
33ccb468 6749
6750 set variable value
d16e0461
TP
6751
6752 Set a configuration parameter. Currently only the 'query-logging'
6753 parameter can be set.
33ccb468 6754
6755 uptime
d16e0461
TP
6756
6757 Reports the uptime of the daemon in human readable form.
33ccb468 6758
6759 version
d16e0461
TP
6760
6761 returns the version of a running pdns daemon.
6762
6763 ----------------------------------------------------------------------
33ccb468 6764
6765B.2. Guardian
6766
d16e0461
TP
6767 When launched by the init.d script, pdns_server wraps itself inside a
6768 'guardian'. This guardian monitors the performance of the inner
6769 pdns_server instance which shows up in the process list of your OS as
6770 pdns_server-instance. It is also this guardian that pdns_control talks to.
6771 A STOP is interpreted by the guardian, which causes the guardian to sever
6772 the connection to the inner process and terminate it, after which it
6773 terminates itself. The init.d script DUMP and SHOW commands need to access
6774 the inner process, because the guardian itself does not run a nameserver.
6775 For this purpose, the guardian passes controlsocket requests to the
6776 control console of the inner process. This is the same console as seen
6777 with init.d MONITOR.
6778
6779 ----------------------------------------------------------------------
33ccb468 6780
6781B.3. Modules & Backends
6782
d16e0461
TP
6783 PDNS has the concept of backends and modules. Non-static PDNS
6784 distributions have the ability to load new modules at runtime, while the
6785 static versions come with a number of modules built in, but cannot load
6786 more.
33ccb468 6787
d16e0461 6788 Related parameters are:
33ccb468 6789
6790 --help
d16e0461
TP
6791
6792 Outputs all known parameters, including those of launched
6793 backends, see below.
33ccb468 6794
6795 --launch=backend,backend1,backend1:name
d16e0461
TP
6796
6797 Launches backends. In its most simple form, supply all backends
6798 that need to be launched. If you find that you need to launch
6799 single backends multiple times, you can specify a name for later
6800 instantiations. In this case, there are 2 instances of backend1,
6801 and the second one is called 'name'. This means that
6802 --backend1-setting is available to configure the first or main
6803 instance, and --backend1-name-setting for the second one.
33ccb468 6804
6805 --load-modules=/directory/libyourbackend.so
d16e0461
TP
6806
6807 If backends are available in nonstandard directories, specify
6808 their location here. Multiple files can be loaded if separated by
6809 commas. Only available in non-static PDNS distributions.
33ccb468 6810
6811 --list-modules
33ccb468 6812
d16e0461
TP
6813 Will list all available modules, both compiled in and in
6814 dynamically loadable modules.
33ccb468 6815
d16e0461
TP
6816 To run on the commandline, use the pdns_server binary. For example, to see
6817 options for the gpgsql backend, use the following:
6818
6819 $ /usr/sbin/pdns_server --launch=gpgsql --help=gpgsql
6820
6821
6822 ----------------------------------------------------------------------
33ccb468 6823
6824B.4. How PDNS translates DNS queries into backend queries
6825
d16e0461
TP
6826 A DNS query is not a straightforward lookup. Many DNS queries need to
6827 check the backend for additional data, for example to determine of an
6828 unfound record should lead to an NXDOMAIN ('we know about this domain, but
6829 that record does not exist') or an unauthoritative response.
6830
6831 Simplified, without CNAME processing and wildcards, the algorithm is like
6832 this:
33ccb468 6833
d16e0461
TP
6834 When a query for a qname/qtype tuple comes in, it is requested directly
6835 from the backend. If present, PDNS adds the contents of the reply to the
6836 list of records to return. A question tuple may generate multiple answer
6837 records.
33ccb468 6838
d16e0461
TP
6839 Each of these records is now investigated to see if it needs 'additional
6840 processing'. This holds for example for MX records which may point to
6841 hosts for which the PDNS backends also contain data. This involves further
6842 lookups for A or AAAA records.
33ccb468 6843
d16e0461
TP
6844 After all additional processing has been performed, PDNS sieves out all
6845 double records which may well have appeared. The resulting set of records
6846 is added to the answer packet, and sent out.
33ccb468 6847
d16e0461
TP
6848 A zone transfer works by looking up the domain_id of the SOA record of the
6849 name and then listing all records of that domain_id. This is why all
6850 records in a domain need to have the same domain_id.
33ccb468 6851
d16e0461
TP
6852 When a query comes in for an unknown domain, PDNS starts looking for SOA
6853 records of all subdomains of the qname, so no.such.powerdns.com turns into
6854 a SOA query for no.such.powerdns.com, such.powerdns.com, powerdns.com,
6855 com, ''. When a SOA is found, that zone is consulted for relevant NS
6856 instructions which lead to a referral. If nothing is found within the
6857 zone, an authoritative NXDOMAIN is sent out.
33ccb468 6858
d16e0461 6859 If no SOA was found, an unauthoritative no-error is returned.
33ccb468 6860
d16e0461
TP
6861 In reality, each query for a question tuple first involves checking for a
6862 CNAME, unless that resolution has been disabled with the skip-cname
6863 option.
33ccb468 6864
d16e0461
TP
6865 PDNS breaks strict RFC compatability by not always checking for the
6866 presence of a SOA record first. This is unlikely to lead to problems
6867 though.
33ccb468 6868
d16e0461 6869 ----------------------------------------------------------------------
33ccb468 6870
d16e0461 6871 Appendix C. Backend writers' guide
33ccb468 6872
d16e0461
TP
6873 PDNS backends are implemented via a simple yet powerful C++ interface. If
6874 your needs are not met by the PipeBackend, you may want to write your own.
6875 Doing so requires a copy of the PowerDNS Open Source Backend Development
6876 kit which can be found on http://downloads.powerdns.com/releases/dev.
33ccb468 6877
d16e0461
TP
6878 A backend contains zero DNS logic. It need not look for CNAMES, it need
6879 not return NS records unless explicitly asked for, etcetera. All DNS logic
6880 is contained within PDNS itself - backends should simply return records
6881 matching the description asked for.
33ccb468 6882
d16e0461
TP
6883 Warning However, please note that your backend can get queries in aNy
6884 CAsE! If your database is case sensitive, like most are (with the
6885 notable exception of MySQL), you must make sure that you do find
6886 answers which differ only in case.
33ccb468 6887
d16e0461 6888 ----------------------------------------------------------------------
33ccb468 6889
6890C.1. Simple read-only native backends
6891
d16e0461
TP
6892 Implementing a backend consists of inheriting from the DNSBackend class.
6893 For read-only backends, which do not support slave operation, only the
6894 following methods are relevant:
6895
6896 class DNSBackend
6897 {
6898 public:
6899
6900 virtual bool lookup(const QType &qtype, const string &qdomain, DNSPacket *pkt_p=0, int zoneId=-1)=0;
6901 virtual bool list(int domain_id)=0;
6902 virtual bool get(DNSResourceRecord &r)=0;
6903 virtual bool getSOA(const string &name, SOAData &soadata);
6904 };
6905
6906
6907 Note that the first three methods must be implemented. getSOA() has a
6908 useful default implementation.
6909
6910 The semantics are simple. Each instance of your class only handles one (1)
6911 query at a time. There is no need for locking as PDNS guarantees that your
6912 backend will never be called reentrantly.
6913
6914 Some examples, a more formal specification is down below. A normal lookup
6915 starts like this:
6916
6917 YourBackend yb;
6918 yb.lookup(QType::CNAME,"www.powerdns.com");
6919
6920
6921 Your class should now do everything to start this query. Perform as much
6922 preparation as possible - handling errors at this stage is better for PDNS
6923 than doing so later on. A real error should be reported by throwing an
6924 exception.
6925
6926 PDNS will then call the get() method to get DNSResourceRecords back. The
6927 following code illustrates a typical query:
6928
6929 yb.lookup(QType::CNAME,"www.powerdns.com");
6930
6931 DNSResourceRecord rr;
6932 while(yb.get(rr))
6933 cout<<"Found cname pointing to '"+rr.content+"'"<<endl;
6934 }
6935
6936
6937 Each zone starts with a Start of Authority (SOA) record. This record is
6938 special so many backends will choose to implement it specially. The
33ccb468 6939 default getSOA() method performs a regular lookup on your backend to
d16e0461
TP
6940 figure out the SOA, so if you have no special treatment for SOA records,
6941 where is no need to implement your own getSOA().
33ccb468 6942
d16e0461
TP
6943 Besides direct queries, PDNS also needs to be able to list a zone, to do
6944 zone transfers for example. Each zone has an id which should be unique
6945 within the backend. To list all records belonging to a zone id, the list()
6946 method is used. Conveniently, the domain_id is also available in the
6947 SOAData structure.
33ccb468 6948
6949 The following lists the contents of a zone called "powerdns.com".
d16e0461
TP
6950
6951 SOAData sd;
6952 if(!yb.getSOA("powerdns.com",sd)) // are we authoritative over powerdns.com?
6953 return RCode::NotAuth; // no
6954
6955 yb.list(sd.domain_id);
6956 while(yb.get(rr))
6957 cout<<rr.qname<<"\t IN "<<rr.qtype.getName()<<"\t"<<rr.content<<endl;
6958
6959
6960 Please note that when so called 'fancy records' (see Chapter 14) are
6961 enabled, a backend can receive wildcard lookups. These have a % as the
6962 first character of the qdomain in lookup.
6963
6964 ----------------------------------------------------------------------
6965
6966 C.1.1. A sample minimal backend
6967
6968 This backend only knows about the host "random.powerdns.com", and
6969 furthermore, only about its A record:
6970
6971 /* FIRST PART */
6972 class RandomBackend : public DNSBackend
6973 {
6974 public:
6975 bool list(int id) {
6976 return false; // we don't support AXFR
6977 }
6978
6979 void lookup(const QType &type, const string &qdomain, DNSPacket *p, int zoneId)
6980 {
6981 if(type.getCode()!=QType::A || qdomain!="random.powerdns.com") // we only know about random.powerdns.com A
6982 d_answer=""; // no answer
6983 else {
6984 ostringstream os;
6985 os<<random()%256<<"."<<random()%256<<"."<<random()%256<<"."<<random()%256;
6986 d_answer=os.str(); // our random ip address
6987 }
6988 }
6989
6990 bool get(DNSResourceRecord &rr)
6991 {
6992 if(!d_answer.empty()) {
6993 rr.qname="random.powerdns.com"; // fill in details
6994 rr.qtype=QType::A; // A record
6995 rr.ttl=86400; // 1 day
6996 rr.content=d_answer;
6997
6998 d_answer=""; // this was the last answer
6999
7000 return true;
7001 }
7002 return false; // no more data
7003 }
7004
7005 private:
7006 string d_answer;
7007 };
7008
7009 /* SECOND PART */
7010
7011 class RandomFactory : public BackendFactory
7012 {
7013 public:
7014 RandomFactory() : BackendFactory("random") {}
7015
7016 DNSBackend *make(const string &suffix)
7017 {
7018 return new RandomBackend();
7019 }
7020 };
7021
7022 /* THIRD PART */
7023
7024 class RandomLoader
7025 {
7026 public:
7027 Loader()
7028 {
7029 BackendMakers().report(new RandomFactory);
7030
7031 L<<Logger::Info<<" [RandomBackend] This is the randombackend ("__DATE__", "__TIME__") reporting"<<endl;
7032 }
7033 };
7034
7035 static RandomLoader randomloader;
7036
7037
7038 This simple backend can be used as an 'overlay'. In other words, it only
7039 knows about a single record, another loaded backend would have to know
7040 about the SOA and NS records and such. But nothing prevents us from
7041 loading it without another backend.
7042
7043 The first part of the code contains the actual logic and should be pretty
7044 straightforward. The second part is a boilerplate 'factory' class which
7045 PDNS calls to create randombackend instances. Note that a 'suffix'
7046 parameter is passed. Real life backends also declare parameters for the
7047 configuration file; these get the 'suffix' appended to them. Note that the
7048 "random" in the constructor denotes the name by which the backend will be
7049 known.
7050
7051 The third part registers the RandomFactory with PDNS. This is a simple C++
7052 trick which makes sure that this function is called on execution of the
7053 binary or when loading the dynamic module.
33ccb468 7054
7055 Please note that a RandomBackend is actually in most PDNS releases. By
d16e0461
TP
7056 default it lives on random.example.com, but you can change that by setting
7057 random-hostname.
33ccb468 7058
7059 NOTE: this simple backend neglects to handle case properly! For a more
d16e0461
TP
7060 complete example, see the full pdns-dev distribution as found on the
7061 website.
7062
7063 ----------------------------------------------------------------------
33ccb468 7064
d16e0461 7065 C.1.2. Interface definition
33ccb468 7066
d16e0461 7067 Classes:
33ccb468 7068
7069 Table C-1. DNSResourceRecord class
d16e0461
TP
7070
7071 +-----------------------------------------------------------------------+
7072 | QType qtype | QType of this record |
7073 |----------------------+------------------------------------------------|
7074 | string qname | name of this record |
7075 |----------------------+------------------------------------------------|
7076 | string content | ASCII representation of right hand side |
7077 |----------------------+------------------------------------------------|
7078 | u_int16_t priority | priority of an MX record. |
7079 |----------------------+------------------------------------------------|
7080 | u_int32_t ttl | Time To Live of this record |
7081 |----------------------+------------------------------------------------|
7082 | int domain_id | ID of the domain this record belongs to |
7083 |----------------------+------------------------------------------------|
7084 | time_t last_modified | If unzero, last time_t this record was changed |
7085 +-----------------------------------------------------------------------+
33ccb468 7086
7087 Table C-2. SOAData struct
d16e0461
TP
7088
7089 +------------------------------------------------------------------------+
7090 | string nameserver | Name of the master nameserver of this zone |
7091 |-----------------------+------------------------------------------------|
7092 | string hostmaster | Hostmaster of this domain. May contain an @ |
7093 |-----------------------+------------------------------------------------|
7094 | u_int32_t serial | Serial number of this zone |
7095 |-----------------------+------------------------------------------------|
7096 | u_int32_t refresh | How often this zone should be refreshed |
7097 |-----------------------+------------------------------------------------|
7098 | u_int32_t retry | How often a failed zone pull should be |
7099 | | retried. |
7100 |-----------------------+------------------------------------------------|
7101 | u_int32_t expire | If zone pulls failed for this long, retire |
7102 | | records |
7103 |-----------------------+------------------------------------------------|
7104 | u_int32_t default_ttl | Difficult |
7105 |-----------------------+------------------------------------------------|
7106 | int domain_id | The ID of the domain within this backend. Must |
7107 | | be filled! |
7108 |-----------------------+------------------------------------------------|
7109 | | Pointer to the backend that feels |
7110 | DNSBackend *db | authoritative for a domain and can act as a |
7111 | | slave |
7112 +------------------------------------------------------------------------+
33ccb468 7113
7114 Methods:
7115
d16e0461
TP
7116 void lookup(const QType &qtype, const string &qdomain, DNSPacket *pkt=0,
7117 int zoneId=-1)
7118
7119 This function is used to initiate a straight lookup for a record
7120 of name 'qdomain' and type 'qtype'. A QType can be converted into
7121 an integer by invoking its getCode() method and into a string with
7122 the getCode().
7123
7124 The original question may or may not be passed in the pointer p.
7125 If it is, you can retrieve (from 1.99.11 onwards) information
7126 about who asked the question with the getRemote(DNSPacket *)
7127 method. Alternatively, bool getRemote(struct sockaddr *sa,
7128 socklen_t *len) is available.
7129
7130 Note that qdomain can be of any case and that your backend should
7131 make sure it is in effect case insensitive. Furthermore, the case
7132 of the original question should be retained in answers returned by
7133 get()!
7134
7135 Finally, the domain_id might also be passed indicating that only
7136 answers from the indicated zone need apply. This can both be used
7137 as a restriction or as a possible speedup, hinting your backend
7138 where the answer might be found.
7139
7140 If initiated succesfully, as indicated by returning true, answers
7141 should be made available over the get() method.
7142
7143 Should throw an AhuException if an error occured accessing the
7144 database. Returning otherwise indicates that the query was started
7145 succesfully. If it is known that no data is available, no
7146 exception should be thrown! An exception indicates that the
7147 backend considers itself broken - not that no answers are
7148 available for a question.
7149
7150 It is legal to return here, and have the first call to get()
7151 return false. This is interpreted as 'no data'
33ccb468 7152
7153 bool list(int domain_id)
33ccb468 7154
d16e0461
TP
7155 Initiates a list of the indicated domain. Records should then be
7156 made available via the get() method. Need not include the SOA
7157 record. If it is, PDNS will not get confused.
7158
7159 Should return false if the backend does not consider itself
7160 authoritative for this zone. Should throw an AhuException if an
7161 error occured accessing the database. Returning true indicates
7162 that data is or should be available.
33ccb468 7163
7164 bool get(DNSResourceRecord &rr)
33ccb468 7165
d16e0461
TP
7166 Request a DNSResourceRecord from a query started by get() of
7167 list(). If this functions returns true, rr has been filled with
7168 data. When it returns false, no more data is available, and rr
7169 does not contain new data. A backend should make sure that it
7170 either fills out all fields of the DNSResourceRecord or resets
7171 them to their default values.
33ccb468 7172
d16e0461
TP
7173 The qname field of the DNSResourceRecord should be filled out with
7174 the exact qdomain passed to lookup, preserving its case. So if a
7175 query for 'CaSe.yourdomain.com' comes in and your database
7176 contains dat afor 'case.yourdomain.com', the qname field of rr
7177 should contin 'CaSe.yourdomain.com'!
7178
7179 Should throw an AhuException in case a database error occurred.
33ccb468 7180
7181 bool getSOA(const string &name, SOAData &soadata)
d16e0461
TP
7182
7183 If the backend considers itself authoritative over domain name,
7184 this method should fill out the passed SOAData structure and
7185 return a positive number. If the backend is functioning correctly,
7186 but does not consider itself authoritative, it should return 0. In
7187 case of errors, an AhuException should be thrown.
7188
7189 ----------------------------------------------------------------------
33ccb468 7190
7191C.2. Reporting errors
7192
d16e0461
TP
7193 To report errors, the Logger class is available which works mostly like an
7194 iostream. Example usage is as shown above in the RandomBackend. Note that
7195 it is very important that each line is ended with endl as your message
7196 won't be visible otherwise.
7197
7198 To indicate the importance of an error, the standard syslog errorlevels
7199 are available. They can be set by outputting Logger::Critical,
7200 Logger::Error, Logger::Warning, Logger::Notice, Logger::Info or
7201 Logger::Debug to L, in descending order of graveness.
33ccb468 7202
d16e0461 7203 ----------------------------------------------------------------------
33ccb468 7204
7205C.3. Declaring and reading configuration details
7206
d16e0461
TP
7207 It is highly likely that a backend needs configuration details. On launch,
7208 these parameters need to be declared with PDNS so it knows it should
7209 accept them in the configuration file and on the commandline. Furthermore,
7210 they will be listed in the output of --help.
33ccb468 7211
d16e0461
TP
7212 Declaring arguments is done by implementing the member function
7213 declareArguments() in the factory class of your backend. PDNS will call
7214 this method after launching the backend.
33ccb468 7215
d16e0461
TP
7216 In the declareArguments() method, the function declare() is available. The
7217 exact definitions:
33ccb468 7218
7219 void declareArguments(const string &suffix="")
d16e0461
TP
7220
7221 This method is called to allow a backend to register configurable
7222 parameters. The suffix is the sub-name of this module. There is no
7223 need to touch this suffix, just pass it on to the declare method.
33ccb468 7224
7225 void declare(const string &suffix, const string &param, const string
d16e0461
TP
7226 &explanation, const string &value)
7227
7228 The suffix is passed to your method, and can be passed on to
7229 declare. param is the name of your parameter. explanation is what
7230 will appear in the output of --help. Furthermore, a default value
7231 can be supplied in the value parameter.
33ccb468 7232
7233 A sample implementation:
33ccb468 7234
d16e0461
TP
7235 void declareArguments(const string &suffix)
7236 {
7237 declare(suffix,"dbname","Pdns backend database name to connect to","powerdns");
7238 declare(suffix,"user","Pdns backend user to connect as","powerdns");
7239 declare(suffix,"host","Pdns backend host to connect to","");
7240 declare(suffix,"password","Pdns backend password to connect with","");
7241 }
7242
33ccb468 7243
7244 After the arguments have been declared, they can be accessed from your
d16e0461
TP
7245 backend using the mustDo(), getArg() and getArgAsNum() methods. The are
7246 defined as follows in the DNSBackend class:
33ccb468 7247
7248 void setArgPrefix(const string &prefix)
d16e0461
TP
7249
7250 Must be called before any of the other accessing functions are
7251 used. Typical usage is 'setArgPrefix("mybackend"+suffix)' in the
7252 constructor of a backend.
33ccb468 7253
7254 bool mustDo(const string &key)
d16e0461
TP
7255
7256 Returns true if the variable key is set to anything but 'no'.
33ccb468 7257
7258 const string& getArg(const string &key)
d16e0461
TP
7259
7260 Returns the exact value of a parameter.
33ccb468 7261
7262 int getArgAsNum(const string &key)
d16e0461
TP
7263
7264 Returns the numerical value of a parameter. Uses atoi() internally
33ccb468 7265
7266 Sample usage from the BindBackend, using the bind-example-zones and
7267 bind-config parameters.
33ccb468 7268
d16e0461
TP
7269 if(mustDo("example-zones")) {
7270 insert(0,"www.example.com","A","1.2.3.4");
7271 /* ... */
7272 }
7273
33ccb468 7274
d16e0461
TP
7275 if(!getArg("config").empty()) {
7276 BindParser BP;
7277
7278 BP.parse(getArg("config"));
7279 }
33ccb468 7280
d16e0461 7281
33ccb468 7282
d16e0461 7283 ----------------------------------------------------------------------
33ccb468 7284
7285C.4. Read/write slave-capable backends
7286
d16e0461
TP
7287 The backends above are 'natively capable' in that they contain all data
7288 relevant for a domain and do not pull in data from other nameservers. To
7289 enable storage of information, a backend must be able to do more.
7290
7291 Before diving into the details of the implementation some theory is in
7292 order. Slave domains are pulled from the master. PDNS needs to know for
7293 which domains it is to be a slave, and for each slave domain, what the IP
7294 address of the master is.
7295
7296 A slave zone is pulled from a master, after which it is 'fresh', but this
7297 is only temporary. In the SOA record of a zone there is a field which
7298 specifies the 'refresh' interval. After that interval has elapsed, the
7299 slave nameserver needs to check at the master ff the serial number there
7300 is higher than what is stored in the backend locally.
7301
7302 If this is the case, PDNS dubs the domain 'stale', and schedules a
7303 transfer of data from the remote. This transfer remains scheduled until
7304 the serial numbers remote and locally are identical again.
7305
7306 This theory is implemented by the getUnfreshSlaveInfos method, which is
7307 called on all backends periodically. This method fills a vector of
7308 SlaveDomains with domains that are unfresh and possibly stale.
7309
7310 PDNS then retrieves the SOA of those domains remotely and locally and
7311 creates a list of stale domains. For each of these domains, PDNS starts a
7312 zonetransfer to resynchronise. Because zone transfers can fail, it is
7313 important that the interface to the backend allows for transaction
7314 semantics because a zone might otherwise be left in a halfway updated
7315 situation.
7316
7317 The following excerpt from the DNSBackend shows the relevant functions:
7318
7319 class DNSBackend {
7320 public:
7321 /* ... */
7322 virtual bool getDomainInfo(const string &domain, DomainInfo &di);
7323 virtual bool isMaster(const string &name, const string &ip);
7324 virtual bool startTransaction(const string &qname, int id);
7325 virtual bool commitTransaction();
7326 virtual bool abortTransaction();
7327 virtual bool feedRecord(const DNSResourceRecord &rr);
7328 virtual void getUnfreshSlaveInfos(vector<DomainInfo>* domains);
7329 virtual void setFresh(int id);
7330 /* ... */
7331 }
7332
33ccb468 7333
7334 The mentioned DomainInfo struct looks like this:
7335
7336 Table C-3. DomainInfo struct
d16e0461
TP
7337
7338 +------------------------------------------------------------------------+
7339 | int id | ID of this zone within this backend |
7340 |---------------------------------+--------------------------------------|
7341 | string master | IP address of the master of this |
7342 | | domain, if any |
7343 |---------------------------------+--------------------------------------|
7344 | u_int32_t serial | Serial number of this zone |
7345 |---------------------------------+--------------------------------------|
7346 | u_int32_t notified_serial | Last serial number of this zone that |
7347 | | slaves have seen |
7348 |---------------------------------+--------------------------------------|
7349 | time_t last_check | Last time this zone was checked over |
7350 | | at the master for changes |
7351 |---------------------------------+--------------------------------------|
7352 | enum {Master,Slave,Native} kind | Type of zone |
7353 |---------------------------------+--------------------------------------|
7354 | | Pointer to the backend that feels |
7355 | DNSBackend *backend | authoritative for a domain and can |
7356 | | act as a slave |
7357 +------------------------------------------------------------------------+
33ccb468 7358
7359 These functions all have a default implementation that returns false -
7360 which explains that these methods can be omitted in simple backends.
7361 Furthermore, unlike with simple backends, a slave capable backend must
d16e0461
TP
7362 make sure that the 'DNSBackend *db' field of the SOAData record is filled
7363 out correctly - it is used to determine which backend will house this
7364 zone.
33ccb468 7365
7366 bool isMaster(const string &name, const string &ip);
d16e0461
TP
7367
7368 If a backend considers itself a slave for the domain name and if
7369 the IP address in ip is indeed a master, it should return true.
7370 False otherwise. This is a first line of checks to guard against
7371 reloading a domain unnecessarily.
33ccb468 7372
7373 void getUnfreshSlaveInfos(vector<DomainInfo>* domains)
d16e0461
TP
7374
7375 When called, the backend should examine its list of slave domains
7376 and add any unfresh ones to the domains vector.
33ccb468 7377
7378 bool getDomainInfo(const string &name, DomainInfo & di)
d16e0461
TP
7379
7380 This is like getUnfreshSlaveInfos, but for a specific domain. If
7381 the backend considers itself authoritative for the named zone, di
7382 should be filled out, and 'true' be returned. Otherwise return
7383 false.
33ccb468 7384
7385 bool startTransaction(const string &qname, int id)
d16e0461
TP
7386
7387 When called, the backend should start a transaction that can be
7388 committed or rolled back atomically later on. In SQL terms, this
7389 function should BEGIN a transaction and DELETE all records.
33ccb468 7390
7391 bool feedRecord(const DNSResourceRecord &rr)
d16e0461
TP
7392
7393 Insert this record.
33ccb468 7394
7395 bool commitTransaction();
d16e0461
TP
7396
7397 Make the changes effective. In SQL terms, execute COMMIT.
33ccb468 7398
7399 bool abortTransaction();
d16e0461
TP
7400
7401 Abort changes. In SQL terms, execute ABORT.
33ccb468 7402
7403 bool setFresh()
d16e0461
TP
7404
7405 Indicate that a domain has either been updated or refreshed
7406 without the need for a retransfer. This causes the domain to
7407 vanish from the vector modified by getUnfreshSlaveInfos().
33ccb468 7408
7409 PDNS will always call startTransaction() before making calls to
d16e0461
TP
7410 feedRecord(). Although it is likely that abortTransaction() will be called
7411 in case of problems, backends should also be prepared to abort from their
7412 destructor.
33ccb468 7413
7414 The actual code in PDNS is currently (1.99.9):
33ccb468 7415
d16e0461
TP
7416 Resolver resolver;
7417 resolver.axfr(remote,domain.c_str());
7418
7419 db->startTransaction(domain, domain_id);
7420
7421 L<<Logger::Error<<"AXFR started for '"<<domain<<"'"<<endl;
7422 Resolver::res_t recs;
7423
7424 while(resolver.axfrChunk(recs)) {
7425 for(Resolver::res_t::const_iterator i=recs.begin();i!=recs.end();++i) {
7426 db->feedRecord(*i);
7427 }
7428 }
7429 db->commitTransaction();
7430 db->setFresh(domain_id);
7431 L<<Logger::Error<<"AXFR done for '"<<domain<<"'"<<endl;
7432
7433
7434 ----------------------------------------------------------------------
7435
7436 C.4.1. Supermaster/Superslave capability
7437
7438 A backend that wants to act as a 'superslave' for a master should
7439 implement the following method:
7440
7441 class DNSBackend
7442 {
7443 virtual bool superMasterBackend(const string &ip, const string &domain, const vector<DNSResourceRecord>&nsset, string *account, DNSBackend **db)
7444 };
7445
7446
7447 This function gets called with the IP address of the potential
7448 supermaster, the domain it is sending a notification for and the set of NS
7449 records for this domain at that IP address.
33ccb468 7450
7451 Using the supplied data, the backend needs to determine if this is a
d16e0461
TP
7452 bonafide 'supernotification' which should be honoured. If it decides that
7453 it should, the supplied pointer to 'account' needs to be filled with the
7454 configured name of the supermaster (if accounting is desired), and the db
7455 needs to be filled with a pointer to your backend.
33ccb468 7456
d16e0461
TP
7457 Supermaster/superslave is a complicated concept, if this is all unclear
7458 see Section 13.2.1.
7459
7460 ----------------------------------------------------------------------
33ccb468 7461
7462C.5. Read/write master-capable backends
7463
d16e0461
TP
7464 In order to be a useful master for a domain, notifies must be sent out
7465 whenever a domain is changed. Periodically, PDNS queries backends for
7466 domains that may have changed, and sends out notifications for slave
7467 nameservers.
33ccb468 7468
d16e0461
TP
7469 In order to do so, PDNS calls the getUpdatedMasters() method. Like the
7470 getUnfreshSlaveInfos() function mentioned above, this should add changed
7471 domain names to the vector passed.
33ccb468 7472
d16e0461 7473 The following excerpt from the DNSBackend shows the relevant functions:
33ccb468 7474
d16e0461
TP
7475 class DNSBackend {
7476 public:
7477 /* ... */
7478 virtual void getUpdatedMasters(vector<DomainInfo>* domains);
7479 virtual void setNotifed(int id, u_int32_t serial);
7480 /* ... */
7481 }
7482
33ccb468 7483
7484 These functions all have a default implementation that returns false -
7485 which explains that these methods can be omitted in simple backends.
7486 Furthermore, unlike with simple backends, a slave capable backend must
d16e0461
TP
7487 make sure that the 'DNSBackend *db' field of the SOAData record is filled
7488 out correctly - it is used to determine which backend will house this
7489 zone.
33ccb468 7490
7491 void getUpdatedMasters(vector<DomainInfo>* domains)
d16e0461
TP
7492
7493 When called, the backend should examine its list of master domains
7494 and add any changed ones to the DomainInfo vector
33ccb468 7495
7496 bool setNotified(int domain_id, u_int32_t serial)
33ccb468 7497
d16e0461
TP
7498 Indicate that notifications have been queued for this domain and
7499 that it need not be considered 'updated' anymore
7500
7501 ----------------------------------------------------------------------
7502
7503 Appendix D. Compiling PowerDNS
33ccb468 7504
7505D.1. Compiling PowerDNS on Unix
7506
d16e0461
TP
7507 Note For now, see the Open Source PowerDNS site. ./configure ; make ; make
7508 install will do The Right Thing for most people.
7509
7510 PowerDNS can becompiled with modules built in, or with modules designed to
7511 be loaded at runtime. All that is configured before compiling using the
7512 well known autoconf/automake system.
7513
7514 To compile in modules, specify them as --with-modules="mod1 mod2 mod3",
7515 substituting the desired module names. Each backend has a module name in
7516 the table at the beginning of its section.
7517
7518 To compile a module for inclusion at runtime, which is great if you are a
7519 unix vendor, use --with-dynmodules="mod1 mod2 mod3". These modules then
7520 end up as .so files in the compiled libdir.
7521
7522 ----------------------------------------------------------------------
7523
7524 D.1.1. AIX
33ccb468 7525
d16e0461
TP
7526 Known to compile with gcc, but only since 2.9.8. AIX lacks POSIX
7527 semaphores so they need to be emulated, as with MacOS X.
33ccb468 7528
d16e0461 7529 ----------------------------------------------------------------------
33ccb468 7530
d16e0461 7531 D.1.2. FreeBSD
33ccb468 7532
d16e0461
TP
7533 Works fine, but use gmake. Pipe backend is currently broken, for reasons,
7534 see Section A.1. Due to the threading model of FreeBSD, PowerDNS does not
7535 benefit from additional CPUs on the system.
33ccb468 7536
d16e0461 7537 ----------------------------------------------------------------------
33ccb468 7538
d16e0461 7539 D.1.3. Linux
33ccb468 7540
d16e0461
TP
7541 Linux is probably the best supported platform as most of the main coders
7542 are Linux users. The static DEB distribution is known to have problems on
7543 Debian 'Sid', but that doesn't matter as PowerDNS is a native part of
7544 Debian 'Sid'. Just apt-get!
33ccb468 7545
d16e0461 7546 ----------------------------------------------------------------------
33ccb468 7547
d16e0461 7548 D.1.4. MacOS X
33ccb468 7549
d16e0461
TP
7550 Did compile at one point but maintenance has lapsed. Let us know if you
7551 can provide us with a login on MacOS X or if you want to help.
33ccb468 7552
d16e0461 7553 ----------------------------------------------------------------------
33ccb468 7554
d16e0461
TP
7555 D.1.5. OpenBSD
7556
7557 Compiles but then does not work. We hear that it may work with more recent
7558 versions of gcc, please let us know on <pdns-dev@mailman.powerdns.com>.
7559
7560 ----------------------------------------------------------------------
7561
7562 D.1.6. Solaris
7563
7564 Solaris 7 is supported, but only just. AAAA records do not work on Solaris
7565 7. Solaris 8 and 9 work fine. The 'Sunpro' compiler has not been tried but
7566 is reported to be lacking large parts of the Standard Template Library,
7567 which PowerDNS relies on heavily. Use gcc and gmake (if available).
7568 Regular Solaris make has some issues with some PowerDNS Makefile
7569 constructs.
7570
7571 ----------------------------------------------------------------------
33ccb468 7572
7573D.2. Compiling PowerDNS on Windows
7574
d16e0461
TP
7575 By Michel Stol (<michel@powerdns.com>).
7576
7577 ----------------------------------------------------------------------
33ccb468 7578
d16e0461 7579 D.2.1. Assumptions
33ccb468 7580
d16e0461 7581 I will assume these things from you:
33ccb468 7582
7583 You have the PowerDNS sources.
33ccb468 7584
d16e0461
TP
7585 There's not much to compile without the source files, eh? :)
7586
7587 You are using Microsoft Visual C++. If you get it to compile using a free
7588 compiler, please let us know!
7589
7590 From the day that we began porting the UNIX PowerDNS sources to
7591 Microsoft Windows we used Microsoft Visual C++ as our development
7592 environment of choice.
33ccb468 7593
d16e0461
TP
7594 We used Visual C++ 6.0 to compile all sources (both standard
7595 version and SP5). Other versions (including Visual C++ .NET) are
7596 untested.
33ccb468 7597
7598 You are using Microsoft Windows NT, 2000 or XP
33ccb468 7599
d16e0461
TP
7600 I will assume that the system where you want to compile the
7601 sources on is running Microsoft Windows NT, 2000 or XP. These are
7602 the operating systems that where found running PowerDNS for
7603 Windows.
33ccb468 7604
d16e0461
TP
7605 Note You probably can compile the sources on other Windows
7606 versions too, but that is currently untested.
33ccb468 7607
7608 You are using an English Windows version.
33ccb468 7609
d16e0461
TP
7610 Troughout this document I will use the English names for menu
7611 items, names etc., so if you are running a non-English Windows or
7612 MSVC version you have to translate those things yourself. But I
7613 don't think that would be a big problem.
33ccb468 7614
d16e0461 7615 ----------------------------------------------------------------------
33ccb468 7616
d16e0461 7617 D.2.2. Prequisites
33ccb468 7618
d16e0461
TP
7619 Although we tried to keep PowerDNS for Windows' dependencies down to a
7620 minimum, you will still need some programs and libraries to be able to
7621 compile the sources.
33ccb468 7622
d16e0461 7623 ----------------------------------------------------------------------
33ccb468 7624
d16e0461 7625 D.2.2.1. pthreads for Windows
33ccb468 7626
d16e0461
TP
7627 The pthreads for Windows library is a Windows implementation of the POSIX
7628 threads specification, which is used a lot in UNIX programs.
33ccb468 7629
d16e0461
TP
7630 PowerDNS uses pthreads too, and to ease the porting process we decided not
7631 to reinvent the wheel, but to use pthreads for Windows instead.
33ccb468 7632
d16e0461 7633 ----------------------------------------------------------------------
33ccb468 7634
d16e0461 7635 D.2.2.1.1. Getting pthreads for Windows
33ccb468 7636
d16e0461
TP
7637 Pthreads for Windows is available from anonymous ftp at
7638 ftp://sources.redhat.com/pub/pthreads-win32/. You should download the
7639 latest pthreads-YYYY-MM-DD.exe file.
33ccb468 7640
d16e0461
TP
7641 Note PowerDNS for Windows was tested with the snapshot of 2002-03-02 of
7642 the library.
33ccb468 7643
d16e0461
TP
7644 For more information you can visit the pthreads for Windows homepage at
7645 http://sources.redhat.com/pthreads-win32/
33ccb468 7646
d16e0461 7647 ----------------------------------------------------------------------
33ccb468 7648
d16e0461 7649 D.2.2.2. Installing pthreads for Windows
33ccb468 7650
d16e0461
TP
7651 To install the pthreads for Windows library you have to locate your
7652 pthreads-YYYY-MM-DD.exe file and start it.
33ccb468 7653
d16e0461
TP
7654 After starting the executable a self-extractor dialog will show up where
7655 you can specify where to extract the contents of the file. When you
7656 selected a location you can press the Extract button to extract all
7657 content to the target directory.
33ccb468 7658
d16e0461
TP
7659 The library is now installed, we still have to tell Visual C++ where it's
7660 located though, more on that later.
33ccb468 7661
d16e0461 7662 ----------------------------------------------------------------------
33ccb468 7663
d16e0461 7664 D.2.3. Nullsoft Installer
33ccb468 7665
d16e0461
TP
7666 For our installation program we used Nullsoft's Installer System (NSIS).
7667 We used NSIS because it's easy to use, versatile and free (and it uses
7668 SuperPiMP(TM) technology, but they refuse to tell us what it is ;)). If
7669 the name Nullsoft rings a bell, it's because they're the guys who made
7670 winamp.
33ccb468 7671
d16e0461 7672 ----------------------------------------------------------------------
33ccb468 7673
d16e0461 7674 D.2.3.1. Getting the Nullsoft Installer
33ccb468 7675
d16e0461
TP
7676 The Nullsoft Installer can be downloaded at their website, which is
7677 located at http://www.nullsoft.com/free/nsis/. The file that you should
7678 download is called nsisXXX.exe (where XXX is the latest version).
33ccb468 7679
d16e0461 7680 Note You can find the NSIS documentation at that website too.
33ccb468 7681
d16e0461 7682 ----------------------------------------------------------------------
33ccb468 7683
d16e0461 7684 D.2.3.2. Installing the Nullsoft Installer
33ccb468 7685
d16e0461
TP
7686 Installing NSIS is easy. All there is to it is locating the installer and
7687 execute it. Then just follow the installation steps.
33ccb468 7688
d16e0461 7689 ----------------------------------------------------------------------
33ccb468 7690
d16e0461
TP
7691 D.2.4. Setting up the build-environment
7692
7693 Before starting Microsoft Visual C++ and compile PowerDNS for Windows, you
7694 first have to set up your build environment.
7695
7696 ----------------------------------------------------------------------
7697
7698 D.2.4.1. Make Microsoft Visual C++ recognize *.cc and *.hh (optional)
7699
7700 All PowerDNS source files are in the form name.cc, and all header files in
7701 the form name.hh. These extensions aren't recognized by MSVC by default,
7702 so you might want to change that first.
7703
7704 Note Only perform this step if you want to be able to edit the *.cc and
7705 *.hh files in MSVC.
7706
7707 Caution If you decide to perform this step, remember that it requires
7708 modification of the Windows registry, always make a backup before
7709 modifying!
33ccb468 7710
7711 Ok, after that word of caution we can now proceed. You have to follow
7712 these steps:
7713
d16e0461
TP
7714 1. Start the registry editor by entering regedit.exe in the run prompt
7715 (Start->Run...).
7716
7717 2. Right click on HKEY_CLASSES_ROOT and select New->Key. A new key will
7718 appear, change that key to ".cc", then change the default value to
7719 "cppfile"
7720
33ccb468 7721 Then perform the same step for ".hh" (use "hfile" instead of
7722 "cppfile").
d16e0461 7723
33ccb468 7724 3. Go to HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0\Build
d16e0461
TP
7725 System\Components\Platforms\Win32 (x86)\Tools\32-bit C/C++ Compiler
7726 for 80x86. And add ";*.cc" to the Input_Spec value (so that it becomes
7727 "*.c;*.cpp;*.cxx;*.cc").
33ccb468 7728
d16e0461
TP
7729 Note If you happen to use another platform (like alpha) to
7730 compile the sources, you have to do the step above for
7731 that platform.
33ccb468 7732
d16e0461
TP
7733 4. Go to HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0\Search. And
7734 add ";*.cc;*.hh" to the FIF_Filter value (so that it becomes
33ccb468 7735 "*.c;*.cpp;*.cxx;*.tli;*.h;*.tlh;*.inl;*.rc;*.cc;*.hh").
d16e0461
TP
7736
7737 5. Finally change HKEY_CURRENT_USER\Software\Microsoft\DevStudio\6.0\Text
33ccb468 7738 Editor\Tabs/Language Settings\C/C++. And add ";cc;hh" to the
7739 FileExtensions value (so that it becomes
7740 "cpp;cxx;c;h;hxx;hpp;inl;tlh;tli;rc;rc2;hh;cc").
d16e0461 7741
33ccb468 7742 6. Close the registry editor.
7743
7744 Now should MSVC properly recognize the files as being C++.
33ccb468 7745
d16e0461
TP
7746 ----------------------------------------------------------------------
7747
7748 D.2.4.2. Setting Microsoft Visual C++'s directories
7749
7750 MSVC needs to locate some include files, libraries and executables when it
7751 has to build PowerDNS for Windows. We are now going to tell MSVC where to
7752 find those.
7753
7754 To enter the directory dialog you have to go to
7755 Tools->Options...->Directories.
7756
7757 ----------------------------------------------------------------------
7758
7759 D.2.4.2.1. Setting the pthreads directories
33ccb468 7760
d16e0461
TP
7761 When you are in the directory dialog you can add the pthreads for Windows
7762 directory.
33ccb468 7763
d16e0461
TP
7764 First add the include directory, to do this you have to select Include
7765 files from the Show directories for: combobox. Then press the New button
7766 and browse to the include directory of pthreads (ie. C:\pthreads\include).
33ccb468 7767
d16e0461
TP
7768 Then switch to Library files and add the library directory (ie.
7769 C:\pthreads\lib) using the same method as above.
33ccb468 7770
d16e0461 7771 ----------------------------------------------------------------------
33ccb468 7772
d16e0461 7773 D.2.4.2.2. Setting the Nullsoft Installer directory
33ccb468 7774
d16e0461
TP
7775 While still being in the directory dialog, switch to Executable files and
7776 add the Nullsoft Installer directory (ie. C:\Program Files\NSIS) to the
7777 list.
33ccb468 7778
d16e0461 7779 ----------------------------------------------------------------------
33ccb468 7780
d16e0461 7781 D.2.5. Compilation
33ccb468 7782
d16e0461
TP
7783 Finally, after all the reading, installing and configuring we are ready to
7784 start compiling PowerDNS for Windows.
33ccb468 7785
d16e0461 7786 ----------------------------------------------------------------------
33ccb468 7787
d16e0461 7788 D.2.5.1. Starting the compilation
33ccb468 7789
d16e0461
TP
7790 To start the compilation you first have to open the PowerDNS workspace
7791 (powerdns.dsw) using explorer or from the File->Open Workspace... menu in
7792 MSVC.
33ccb468 7793
d16e0461
TP
7794 After you opened the workspace you can start compiling. Check all the
7795 checkboxes in the Build->Batch Build... menu and press the Build button.
33ccb468 7796
d16e0461
TP
7797 Now cross your fingers and go make some coffee or tea while compiling
7798 PowerDNS for Windows. :)
33ccb468 7799
d16e0461 7800 ----------------------------------------------------------------------
33ccb468 7801
d16e0461 7802 D.2.5.2. Yay! It compiled
33ccb468 7803
d16e0461 7804 Congratulations, you have now compiled PowerDNS for Windows!
33ccb468 7805
d16e0461
TP
7806 All the release builds of the binaries are in the Release directory
7807 (including the generated installer). The debug builds are in the, guess
7808 what, Debug directory.
33ccb468 7809
d16e0461
TP
7810 Now you can start installing PowerDNS, but that's beyond the scope of this
7811 document. See the online documentation for more information about that.
33ccb468 7812
d16e0461 7813 ----------------------------------------------------------------------
33ccb468 7814
d16e0461 7815 D.2.5.3. What if it went wrong?
33ccb468 7816
d16e0461
TP
7817 If the compilation fails, then try reading this article again, and again
7818 to see if you did something wrong.
33ccb468 7819
d16e0461
TP
7820 If you are pretty sure that it's a bug, either in the PowerDNS sources,
7821 the build system or in this article, then please send an e-mail to
7822 <pdns-dev@mailman.powerdns.com> describing your problem. We will then try
7823 to fix it.
33ccb468 7824
d16e0461
TP
7825 ----------------------------------------------------------------------
7826
7827 D.2.6. Miscellaneous
7828
7829 Some miscellaneous information.
7830
7831 ----------------------------------------------------------------------
7832
7833 D.2.6.1. Credits
33ccb468 7834
7835 Michel Stol would like to thank these people:
7836
7837 Bert Hubert
d16e0461
TP
7838
7839 For writing the wonderfull PowerDNS software and learning me stuff
7840 that I'd otherwise never had learned.
33ccb468 7841
7842 PowerDNS B.V.
d16e0461
TP
7843
7844 For being great colleagues.
33ccb468 7845
7846 The pthreads-win32 crew (see the pthreads-win32 CONTRIBUTORS file).
d16e0461
TP
7847
7848 For easing our porting process by writing a great Windows
7849 implementation of pthreads.
33ccb468 7850
7851 The guys over at Nullsoft.
d16e0461
TP
7852
7853 For creating the Nullsoft Installer System (NSIS), and Winamp, the
7854 program we use every day to make a lot of noise in the office.
7855
7856 ----------------------------------------------------------------------
7857
7858 D.2.6.2. Contact information
7859
7860 If you have a comment, or a bug report concerning either this document or
7861 the PowerDNS sources you can contact <pdns-dev@mailman.powerdns.com>
7862
7863 For general information about PowerDNS, the pdns server, express,
7864 documentation etc. I advice you to visit http://www.powerdns.com/
7865
7866 If you are interested in buying PowerDNS you can send a mail to
7867 <sales@powerdns.com> or you can visit the PowerDNS website at
7868 http://www.powerdns.com/pdns/
7869
7870 If you want to praise my work, ask me to marry you, deposit $1.000.000 on
7871 my bank account or flame me to death, then you can mail me at
7872 <michel@powerdns.com> :)
7873
7874 ----------------------------------------------------------------------
7875
7876 D.2.6.3. Legal information
7877
7878 Microsoft, Visual C++, Windows, Windows NT, Windows 2000, Windows XP and
7879 Win32 are either registered trademarks or trademarks of Microsoft
7880 Corporation in the U.S.A. and/or other countries.
7881
7882 Other product and company names mentioned herein may be the trademarks of
7883 their respective owners.
7884
7885 ----------------------------------------------------------------------
7886
7887 Appendix E. PowerDNS license (GNU General Public License version 2)
7888
7889 GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION
7890 AND MODIFICATION
7891
7892 \r 0. This License applies to any program or other work which contains a
7893 notice placed by the copyright holder saying it may be distributed under
7894 the terms of this General Public License. The "Program", below, refers to
7895 any such program or work, and a "work based on the Program" means either
7896 the Program or any derivative work under copyright law: that is to say, a
7897 work containing the Program or a portion of it, either verbatim or with
7898 modifications and/or translated into another language. (Hereinafter,
7899 translation is included without limitation in the term "modification".)
7900 Each licensee is addressed as "you".
7901
7902 Activities other than copying, distribution and modification are not
7903 covered by this License; they are outside its scope. The act of running
7904 the Program is not restricted, and the output from the Program is covered
7905 only if its contents constitute a work based on the Program (independent
7906 of having been made by running the Program). Whether that is true depends
7907 on what the Program does.
7908
7909 1. You may copy and distribute verbatim copies of the Program's source
7910 code as you receive it, in any medium, provided that you conspicuously and
7911 appropriately publish on each copy an appropriate copyright notice and
7912 disclaimer of warranty; keep intact all the notices that refer to this
7913 License and to the absence of any warranty; and give any other recipients
7914 of the Program a copy of this License along with the Program.
7915
7916 You may charge a fee for the physical act of transferring a copy, and you
7917 may at your option offer warranty protection in exchange for a fee.
7918
7919 2. You may modify your copy or copies of the Program or any portion of it,
7920 thus forming a work based on the Program, and copy and distribute such
7921 modifications or work under the terms of Section 1 above, provided that
7922 you also meet all of these conditions:
7923
7924 a) You must cause the modified files to carry prominent notices stating
7925 that you changed the files and the date of any change.
7926
7927 b) You must cause any work that you distribute or publish, that in whole
7928 or in part contains or is derived from the Program or any part thereof, to
7929 be licensed as a whole at no charge to all third parties under the terms
7930 of this License.\r
7931
7932 c) If the modified program normally reads commands interactively when run,
7933 you must cause it, when started running for such interactive use in the
7934 most ordinary way, to print or display an announcement including an
7935 appropriate copyright notice and a notice that there is no warranty (or
7936 else, saying that you provide a warranty) and that users may redistribute
7937 the program under these conditions, and telling the user how to view a
7938 copy of this License. (Exception: if the Program itself is interactive but
7939 does not normally print such an announcement, your work based on the
7940 Program is not required to print an announcement.) These requirements
7941 apply to the modified work as a whole. If identifiable sections of that
7942 work are not derived from the Program, and can be reasonably considered
7943 independent and separate works in themselves, then this License, and its
7944 terms, do not apply to those sections when you distribute them as separate
7945 works. But when you distribute the same sections as part of a whole which
7946 is a work based on the Program, the distribution of the whole must be on
7947 the terms of this License, whose permissions for other licensees extend to
7948 the entire whole, and thus to each and every part regardless of who wrote
7949 it.
7950
7951 Thus, it is not the intent of this section to claim rights or contest your
7952 rights to work written entirely by you; rather, the intent is to exercise
7953 the right to control the distribution of derivative or collective works
7954 based on the Program.
7955
7956 In addition, mere aggregation of another work not based on the Program
7957 with the Program (or with a work based on the Program) on a volume of a
7958 storage or distribution medium does not bring the other work under the
7959 scope of this License.
7960
7961 3. You may copy and distribute the Program (or a work based on it, under
7962 Section 2) in object code or executable form under the terms of Sections 1
7963 and 2 above provided that you also do one of the following:
7964
7965 a) Accompany it with the complete corresponding machine-readable source
7966 code, which must be distributed under the terms of Sections 1 and 2 above
7967 on a medium customarily used for software interchange; or,
7968
7969 b) Accompany it with a written offer, valid for at least three years, to
7970 give any third party, for a charge no more than your cost of physically
7971 performing source distribution, a complete machine-readable copy of the
7972 corresponding source code, to be distributed under the terms of Sections 1
7973 and 2 above on a medium customarily used for software interchange; or,
7974
7975 \r c) Accompany it with the information you received as to the offer to
7976 distribute corresponding source code. (This alternative is allowed only
7977 for noncommercial distribution and only if you received the program in
7978 object code or executable form with such an offer, in accord with
7979 Subsection b above.)
7980
7981 The source code for a work means the preferred form of the work for making
7982 modifications to it. For an executable work, complete source code means
7983 all the source code for all modules it contains, plus any associated
7984 interface definition files, plus the scripts used to control compilation
7985 and installation of the executable. However, as a special exception, the
7986 source code distributed need not include anything that is normally
7987 distributed (in either source or binary form) with the major components
7988 (compiler, kernel, and so on) of the operating system on which the
7989 executable runs, unless that component itself accompanies the executable.
7990
7991 If distribution of executable or object code is made by offering access to
7992 copy from a designated place, then offering equivalent access to copy the
7993 source code from the same place counts as distribution of the source code,
7994 even though third parties are not compelled to copy the source along with
7995 the object code. 4. You may not copy, modify, sublicense, or distribute
7996 the Program except as expressly provided under this License. Any attempt
7997 otherwise to copy, modify, sublicense or distribute the Program is void,
7998 and will automatically terminate your rights under this License. However,
7999 parties who have received copies, or rights, from you under this License
8000 will not have their licenses terminated so long as such parties remain in
8001 full compliance.
8002
8003 5. You are not required to accept this License, since you have not signed
8004 it. However, nothing else grants you permission to modify or distribute
8005 the Program or its derivative works. These actions are prohibited by law
8006 if you do not accept this License. Therefore, by modifying or distributing
8007 the Program (or any work based on the Program), you indicate your
8008 acceptance of this License to do so, and all its terms and conditions for
8009 copying, distributing or modifying the Program or works based on it.
8010
8011 6. Each time you redistribute the Program (or any work based on the
8012 Program), the recipient automatically receives a license from the original
8013 licensor to copy, distribute or modify the Program subject to these terms
8014 and conditions. You may not impose any further restrictions on the
8015 recipients' exercise of the rights granted herein. You are not responsible
8016 for enforcing compliance by third parties to this License.
8017
8018 7. If, as a consequence of a court judgment or allegation of patent
8019 infringement or for any other reason (not limited to patent issues),
8020 conditions are imposed on you (whether by court order, agreement or
8021 otherwise) that contradict the conditions of this License, they do not
8022 excuse you from the conditions of this License. If you cannot distribute
8023 so as to satisfy simultaneously your obligations under this License and
8024 any other pertinent obligations, then as a consequence you may not
8025 distribute the Program at all. For example, if a patent license would not
8026 permit royalty-free redistribution of the Program by all those who receive
8027 copies directly or indirectly through you, then the only way you could
8028 satisfy both it and this License would be to refrain entirely from
8029 distribution of the Program.
8030
8031 If any portion of this section is held invalid or unenforceable under any
8032 particular circumstance, the balance of the section is intended to apply
8033 and the section as a whole is intended to apply in other circumstances.\r
8034
8035 It is not the purpose of this section to induce you to infringe any
8036 patents or other property right claims or to contest validity of any such
8037 claims; this section has the sole purpose of protecting the integrity of
8038 the free software distribution system, which is implemented by public
8039 license practices. Many people have made generous contributions to the
8040 wide range of software distributed through that system in reliance on
8041 consistent application of that system; it is up to the author/donor to
8042 decide if he or she is willing to distribute software through any other
8043 system and a licensee cannot impose that choice.
8044
8045 This section is intended to make thoroughly clear what is believed to be a
8046 consequence of the rest of this License. 8. If the distribution and/or use
8047 of the Program is restricted in certain countries either by patents or by
8048 copyrighted interfaces, the original copyright holder who places the
8049 Program under this License may add an explicit geographical distribution
8050 limitation excluding those countries, so that distribution is permitted
8051 only in or among countries not thus excluded. In such case, this License
8052 incorporates the limitation as if written in the body of this License.
8053
8054 9. The Free Software Foundation may publish revised and/or new versions of
8055 the General Public License from time to time. Such new versions will be
8056 similar in spirit to the present version, but may differ in detail to
8057 address new problems or concerns.
8058
8059 Each version is given a distinguishing version number. If the Program
8060 specifies a version number of this License which applies to it and "any
8061 later version", you have the option of following the terms and conditions
8062 either of that version or of any later version published by the Free
8063 Software Foundation. If the Program does not specify a version number of
8064 this License, you may choose any version ever published by the Free
8065 Software Foundation.
8066
8067 10. If you wish to incorporate parts of the Program into other free
8068 programs whose distribution conditions are different, write to the author
8069 to ask for permission. For software which is copyrighted by the Free
8070 Software Foundation, write to the Free Software Foundation; we sometimes
8071 make exceptions for this. Our decision will be guided by the two goals of
8072 preserving the free status of all derivatives of our free software and of
8073 promoting the sharing and reuse of software generally.
8074
8075 NO WARRANTY
8076
8077 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
8078 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
8079 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
8080 PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
8081 OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
8082 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
8083 TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
8084 PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
8085 REPAIR OR CORRECTION.\r
8086
8087 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
8088 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
8089 REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
8090 INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
8091 ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT
8092 LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES
8093 SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE
8094 WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
8095 ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
8096
8097 END OF TERMS AND CONDITIONS
This page took 2.429219 seconds and 4 git commands to generate.