<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >Dynamic resolution using the PipeBackend</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="PowerDNS manual" HREF="index.html"><LINK REL="PREVIOUS" TITLE="Configure database connectivity" HREF="configuring-db-connection.html"><LINK REL="NEXT" TITLE="Logging & Monitoring Authoritative Server performance" HREF="monitoring.html"></HEAD ><BODY CLASS="CHAPTER" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >PowerDNS manual</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="configuring-db-connection.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="monitoring.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="CHAPTER" ><H1 ><A NAME="PIPEBACKEND-DYNAMIC-RESOLUTION" ></A >Chapter 5. Dynamic resolution using the PipeBackend</H1 ><P > 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. </P ><P > The Pipe Backend also has a separate chapter in the backends appendix, see <A HREF="backends-detail.html#PIPEBACKEND" >Section A.1</A >. </P ><P > <DIV CLASS="NOTE" ><P ></P ><TABLE CLASS="NOTE" WIDTH="100%" BORDER="0" ><TR ><TD WIDTH="25" ALIGN="CENTER" VALIGN="TOP" ><IMG SRC="../images/note.gif" HSPACE="5" ALT="Note"></TD ><TD ALIGN="LEFT" VALIGN="TOP" ><P > 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. </P ><P > Interestingly, the Linux PowerDNS binary running under the Linuxulator on FreeBSD does work. </P ></TD ></TR ></TABLE ></DIV > </P ><DIV CLASS="SECT1" ><H1 CLASS="SECT1" ><A NAME="PIPE-AND-BIND" >5.1. Deploying the PipeBackend with the BindBackend</A ></H1 ><P > 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 <TT CLASS="FILENAME" >pdns.conf</TT >: <PRE CLASS="SCREEN" > launch=pipe,bind bind-example-zones pipe-command=location/of/backend.pl </PRE > Please adjust the <B CLASS="COMMAND" >pipe-command</B > statement to the location of the unpacked PDNS distribution. If your backend is slow, raise <B CLASS="COMMAND" >pipe-timeout</B > 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: <P ></P ><UL ><LI ><P > webserver.example.com A records pointing to 1.2.3.4, 1.2.3.5, 1.2.3.6 </P ></LI ><LI ><P > www.example.com CNAME pointing to webserver.example.com </P ></LI ><LI ><P > MBOXFW (mailbox forward) records pointing to powerdns@example.com. See the smtpredir documentation for information about MBOXFW. </P ></LI ></UL > For more information about how to write exciting backends with the PipeBackend, see Appendix A. </P ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="configuring-db-connection.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="monitoring.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Configure database connectivity</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" > </TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Logging & Monitoring Authoritative Server performance</TD ></TR ></TABLE ></DIV ></BODY ></HTML >