Chapter 5. Dynamic resolution using the PipeBackend

Also included in the PDNS distribution is the PipeBackend. The PipeBackend is primarily meant for allowing rapid development of new backends without tight integration with PowerDNS. It allows end-users to write PDNS backends in any language. A perl sample is provided. The PipeBackend is also very well suited for dynamic resolution of queries. Example applications include DNS based loadbalancing, geo-direction, DNS based failover with low TTLs.

The Pipe Backend also has a separate chapter in the backends appendix, see Section A.1.

Note

The Pipe Backend currently does not function under FreeBSD 4.x and 5.x, probably due to unfavorable interactions between its threading implementation and the fork system call.

Interestingly, the Linux PowerDNS binary running under the Linuxulator on FreeBSD does work.

5.1. Deploying the PipeBackend with the BindBackend

Included with the PDNS distribution is the example.pl backend which has knowledge of the example.com zone, just like the BindBackend. To install both, add the following to your pdns.conf:

          launch=pipe,bind
          bind-example-zones
          pipe-command=location/of/backend.pl
        
Please adjust the pipe-command statement to the location of the unpacked PDNS distribution. If your backend is slow, raise pipe-timeout from its default of 2000ms. Now launch PDNS in monitor mode, and perform some queries. Note the difference with the earlier experiment where only the BindBackend was loaded. The PipeBackend is launched first and thus gets queried first. The sample backend.pl script knows about:

For more information about how to write exciting backends with the PipeBackend, see Appendix A.