</section>
<section xml:id="rrset_ordering"><info><title xml:id="rrset_ordering_title">RRset Ordering</title></info>
- <para>
- When multiple records are returned in an answer, it may be
- useful to configure the order of the records placed into the
- response.
- The <command>rrset-order</command> statement permits
- configuration
- of the ordering of the records in a multiple-record response.
- See also the <command>sortlist</command> statement,
- <xref linkend="the_sortlist_statement"/>.
- </para>
-
- <para>
- An <command>order_spec</command> is defined as
- follows:
- </para>
- <para>
- <optional>class <replaceable>class_name</replaceable></optional>
- <optional>type <replaceable>type_name</replaceable></optional>
- <optional>name <replaceable>"domain_name"</replaceable></optional>
- order <replaceable>ordering</replaceable>
- </para>
- <para>
- If no class is specified, the default is <command>ANY</command>.
- If no type is specified, the default is <command>ANY</command>.
- If no name is specified, the default is "<command>*</command>" (asterisk).
- </para>
- <para>
- The legal values for <command>ordering</command> are:
- </para>
- <informaltable colsep="0" rowsep="0">
- <tgroup cols="2" colsep="0" rowsep="0" tgroupstyle="4Level-table">
- <colspec colname="1" colnum="1" colsep="0" colwidth="0.750in"/>
- <colspec colname="2" colnum="2" colsep="0" colwidth="3.750in"/>
- <tbody>
- <row rowsep="0">
- <entry colname="1">
- <para><command>fixed</command></para>
- </entry>
- <entry colname="2">
- <para>
- Records are returned in the order they
- are defined in the zone file.
- </para>
- </entry>
- </row>
- <row rowsep="0">
- <entry colname="1">
- <para><command>random</command></para>
- </entry>
- <entry colname="2">
- <para>
- Records are returned in a random order.
- </para>
- </entry>
- </row>
- <row rowsep="0">
- <entry colname="1">
- <para><command>cyclic</command></para>
- </entry>
- <entry colname="2">
- <para>
- Records are returned in a cyclic round-robin order, rotating by one record per query.
- </para>
- <para>
- If <acronym>BIND</acronym> is configured with the
- "--enable-fixed-rrset" option at compile time,
- the initial ordering of the RRset matches the
- one specified in the zone file.
- </para>
- </entry>
- </row>
- </tbody>
- </tgroup>
- </informaltable>
- <para>
- For example:
- </para>
+ <note>
+ <simpara>
+ While alternating the order of records in a DNS response between
+ subsequent queries is a known load distribution technique, certain
+ caveats apply (mostly stemming from caching) which usually make it
+ a suboptimal choice for load balancing purposes when used on its
+ own.
+ </simpara>
+ </note>
+
+ <para>
+ The <command>rrset-order</command> statement permits configuration
+ of the ordering of the records in a multiple-record response. See
+ also: <xref linkend="the_sortlist_statement"/>.
+ </para>
+
+ <para>
+ Each rule in an <command>rrset-order</command> statement is defined
+ as follows:
+ </para>
+
+ <para>
+ <optional>class <replaceable><class_name></replaceable></optional>
+ <optional>type <replaceable><type_name></replaceable></optional>
+ <optional>name <replaceable>"<domain_name>"</replaceable></optional>
+ order <replaceable><ordering></replaceable>
+ </para>
+
+ <para>
+ The default qualifiers for each rule are:
+ <itemizedlist>
+ <listitem>
+ If no <command>class</command> is specified, the default is
+ <command>ANY</command>.
+ </listitem>
+ <listitem>
+ If no <command>type</command> is specified, the default is
+ <command>ANY</command>.
+ </listitem>
+ <listitem>
+ If no <command>name</command> is specified, the default is
+ <command>*</command> (asterisk).
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <para>
+ <replaceable><domain_name></replaceable> only matches the name
+ itself, not any of its subdomains. To make a rule match all
+ subdomains of a given name, a wildcard name
+ (<replaceable>*.<domain_name></replaceable>) must be used.
+ Note that <replaceable>*.<domain_name></replaceable> does
+ <emphasis>not</emphasis> match
+ <replaceable><domain_name></replaceable> itself; to specify
+ RRset ordering for a name and all of its subdomains, two separate
+ rules must be defined: one for
+ <replaceable><domain_name></replaceable> and one for
+ <replaceable>*.<domain_name></replaceable>.
+ </para>
+
+ <para>
+ The legal values for <replaceable><ordering></replaceable>
+ are:
+ </para>
+
+ <variablelist>
+
+ <varlistentry>
+ <term><command>fixed</command></term>
+ <listitem>
+ <para>
+ Records are returned in the order they are defined in the zone
+ file.
+ </para>
+ <note>
+ <simpara>
+ The <command>fixed</command> option is only available if
+ BIND is configured with
+ <command>--enable-fixed-rrset</command> at compile time.
+ </simpara>
+ </note>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><command>random</command></term>
+ <listitem>
+ <para>
+ Records are returned in a random order.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><command>cyclic</command></term>
+ <listitem>
+ <para>
+ Records are returned in a cyclic round-robin order, rotating
+ by one record per query.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ </variablelist>
+
+ <para>
+ By default, records are returned in random order.
+ </para>
+
+ <para>
+ Note that if multiple <command>rrset-order</command> statements are
+ present in the configuration file (at both the
+ <command>options</command> and <command>view</command> levels), they
+ are <emphasis>not</emphasis> combined; instead, the more-specific
+ one (<command>view</command>) replaces the less-specific one
+ (<command>options</command>).
+ </para>
+
+ <para>
+ If multiple rules within a single <command>rrset-order</command>
+ statement match a given RRset, the first matching rule is applied.
+ </para>
+
+ <para>
+ Example:
+ </para>
<programlisting>rrset-order {
- class IN type A name "host.example.com" order random;
- order cyclic;
+ type A name "foo.isc.org" order random;
+ type AAAA name "foo.isc.org" order cyclic;
+ name "bar.isc.org" order fixed;
+ name "*.bar.isc.org" order random;
+ name "*.baz.isc.org" order cyclic;
};
</programlisting>
- <para>
- causes any responses for type A records in class IN, that
- have "<literal>host.example.com</literal>" as a
- suffix, to always be returned
- in random order. All other records are returned in cyclic order.
- </para>
- <para>
- If multiple <command>rrset-order</command> statements
- appear, they are not combined; the last one applies.
- </para>
- <para>
- By default, records are returned in random order.
- </para>
+ <para>
+ With the above configuration, the following RRset ordering is used:
+ </para>
+
+ <informaltable>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry><para>QNAME</para></entry>
+ <entry><para>QTYPE</para></entry>
+ <entry><para>RRset Order</para></entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><para><userinput>foo.isc.org</userinput></para></entry>
+ <entry><para><userinput>A</userinput></para></entry>
+ <entry><para><command>random</command></para></entry>
+ </row>
+ <row>
+ <entry><para><userinput>foo.isc.org</userinput></para></entry>
+ <entry><para><userinput>AAAA</userinput></para></entry>
+ <entry><para><command>cyclic</command></para></entry>
+ </row>
+ <row>
+ <entry><para><userinput>foo.isc.org</userinput></para></entry>
+ <entry><para><userinput>TXT</userinput></para></entry>
+ <entry><para><command>random</command></para></entry>
+ </row>
+ <row>
+ <entry><para><userinput>sub.foo.isc.org</userinput></para></entry>
+ <entry><para>all</para></entry>
+ <entry><para><command>random</command></para></entry>
+ </row>
+ <row>
+ <entry><para><userinput>bar.isc.org</userinput></para></entry>
+ <entry><para>all</para></entry>
+ <entry><para><command>fixed</command></para></entry>
+ </row>
+ <row>
+ <entry><para><userinput>sub.bar.isc.org</userinput></para></entry>
+ <entry><para>all</para></entry>
+ <entry><para><command>random</command></para></entry>
+ </row>
+ <row>
+ <entry><para><userinput>baz.isc.org</userinput></para></entry>
+ <entry><para>all</para></entry>
+ <entry><para><command>random</command></para></entry>
+ </row>
+ <row>
+ <entry><para><userinput>sub.baz.isc.org</userinput></para></entry>
+ <entry><para>all</para></entry>
+ <entry><para><command>cyclic</command></para></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </informaltable>
- <note>
- <simpara>
- In this release of <acronym>BIND</acronym> 9, the
- <command>rrset-order</command> statement does not support
- "fixed" ordering by default. Fixed ordering can be enabled
- at compile time by specifying "--enable-fixed-rrset" on
- the "configure" command line.
- </simpara>
- </note>
</section>
<section xml:id="tuning"><info><title>Tuning</title></info>