Sophie

Sophie

distrib > Mandriva > 2010.1 > i586 > by-pkgid > 563affe035311228f138962d4d47d4fd > files > 32

pdns-3.0.1-0.1mdv2010.2.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>How PDNS translates DNS queries into backend queries</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="PowerDNS manual"
HREF="index.html"><LINK
REL="UP"
TITLE="PDNS internals"
HREF="pdns-internals.html"><LINK
REL="PREVIOUS"
TITLE="Modules &#38; Backends"
HREF="modules.html"><LINK
REL="NEXT"
TITLE="Backend writers' guide"
HREF="backend-writers-guide.html"></HEAD
><BODY
CLASS="SECT1"
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="modules.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Appendix B. PDNS internals</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="backend-writers-guide.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="DNS-TO-QUERY"
>B.4. How PDNS translates DNS queries into backend queries</A
></H1
><P
>	A DNS query is not a straightforward lookup. Many DNS queries need to check the backend for additional data, for example to
	determine of an unfound record should lead to an NXDOMAIN ('we know about this domain, but that record does not exist') or an 
	unauthoritative response.
      </P
><P
>	Simplified, without CNAME processing and wildcards, the algorithm is like this:
      </P
><P
>	When a query for a <B
CLASS="COMMAND"
>qname</B
>/<B
CLASS="COMMAND"
>qtype</B
> tuple comes in, it is requested directly from the backend. 
	If present, PDNS adds the contents of the reply to the list of records to return. A question tuple may generate multiple answer 
	records.
      </P
><P
>	Each of these records is now investigated to see if it needs 'additional processing'. This holds for example for MX records which may
	point to hosts for which the PDNS backends also contain data. This involves further lookups for A or AAAA records.
      </P
><P
>	After all additional processing has been performed, PDNS sieves out all double records which may well have appeared. The resulting set of 
	records is added to the answer packet, and sent out.
      </P
><P
>	A zone transfer works by looking up the <B
CLASS="COMMAND"
>domain_id</B
> of the SOA record of the name and then listing all records of that 
	<B
CLASS="COMMAND"
>domain_id</B
>. This is why all records in a domain need to have the same domain_id.
      </P
><P
>	When a query comes in for an unknown domain, PDNS starts looking for SOA records of all subdomains of the qname, so 
	no.such.powerdns.com turns into a SOA query for no.such.powerdns.com, such.powerdns.com, powerdns.com, com, ''. When a SOA is found,
	that zone is consulted for relevant NS instructions which lead to a referral. If nothing is found within the zone, an authoritative 
	NXDOMAIN is sent out.
      </P
><P
>	If no SOA was found, an unauthoritative no-error is returned.
      </P
><P
>	In reality, each query for a question tuple first involves checking for a CNAME, unless that resolution has been disabled with the
	<B
CLASS="COMMAND"
>skip-cname</B
> option.
      </P
><P
>	PDNS breaks strict RFC compatability by not always checking for the presence of a SOA record first. This is unlikely to lead to 
	problems though.
      </P
></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="modules.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="backend-writers-guide.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Modules &amp; Backends</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="pdns-internals.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Backend writers' guide</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>