Bv9ARM.ch04.html revision 727f5b8846457a33d06f515a10a7e1aa849ddf18
10139N/A<HTML
10139N/A><HEAD
10139N/A><TITLE
10139N/A>Advanced DNS Features</TITLE
10139N/A><META
10139N/ANAME="GENERATOR"
10139N/ACONTENT="Modular DocBook HTML Stylesheet Version 1.61
10139N/A"><LINK
10139N/AREL="HOME"
10139N/ATITLE="BIND 9 Administrator Reference Manual"
10139N/AHREF="Bv9ARM.html"><LINK
10139N/AREL="PREVIOUS"
10139N/ATITLE="Name Server Configuration"
10139N/AHREF="Bv9ARM.ch03.html"><LINK
10139N/AREL="NEXT"
10139N/ATITLE="The BIND 9 Lightweight Resolver"
10139N/AHREF="Bv9ARM.ch05.html"></HEAD
10139N/A><BODY
10139N/ACLASS="chapter"
10139N/ABGCOLOR="#FFFFFF"
10139N/ATEXT="#000000"
10139N/ALINK="#0000FF"
10139N/AVLINK="#840084"
10139N/AALINK="#0000FF"
10139N/A><DIV
10139N/ACLASS="NAVHEADER"
10139N/A><TABLE
10139N/AWIDTH="100%"
10139N/ABORDER="0"
10139N/ACELLPADDING="0"
10139N/ACELLSPACING="0"
10139N/A><TR
10139N/A><TH
10139N/ACOLSPAN="3"
10139N/AALIGN="center"
10139N/A>BIND 9 Administrator Reference Manual</TH
10139N/A></TR
10139N/A><TR
10139N/A><TD
10139N/AWIDTH="10%"
10139N/AALIGN="left"
10139N/AVALIGN="bottom"
10139N/A><A
10139N/AHREF="Bv9ARM.ch03.html"
10139N/A>Prev</A
10139N/A></TD
10139N/A><TD
10139N/AWIDTH="80%"
10139N/AALIGN="center"
10139N/AVALIGN="bottom"
10139N/A></TD
10139N/A><TD
10139N/AWIDTH="10%"
10139N/AALIGN="right"
10139N/AVALIGN="bottom"
10139N/A><A
10139N/AHREF="Bv9ARM.ch05.html"
10139N/A>Next</A
10139N/A></TD
13931N/A></TR
10139N/A></TABLE
10139N/A><HR
10139N/AALIGN="LEFT"
10139N/AWIDTH="100%"></DIV
10139N/A><DIV
10139N/ACLASS="chapter"
10139N/A><H1
10139N/A><A
13570N/ANAME="ch04"
10139N/A>Chapter 4. Advanced DNS Features</A
10139N/A></H1
10139N/A><DIV
14177N/ACLASS="TOC"
11965N/A><DL
11965N/A><DT
13678N/A><B
10139N/A>Table of Contents</B
10139N/A></DT
13680N/A><DT
10139N/A>4.1. <A
10139N/AHREF="Bv9ARM.ch04.html#notify"
11933N/A>Notify</A
10139N/A></DT
10139N/A><DT
15288N/A>4.2. <A
10139N/AHREF="Bv9ARM.ch04.html#dynamic_update"
10139N/A>Dynamic Update</A
13760N/A></DT
10139N/A><DT
10139N/A>4.3. <A
10139N/AHREF="Bv9ARM.ch04.html#incremental_zone_transfers"
10139N/A>Incremental Zone Transfers (IXFR)</A
10139N/A></DT
10139N/A><DT
10139N/A>4.4. <A
10139N/AHREF="Bv9ARM.ch04.html#AEN734"
10139N/A>Split DNS</A
10139N/A></DT
10139N/A><DT
10139N/A>4.5. <A
10139N/AHREF="Bv9ARM.ch04.html#tsig"
10139N/A>TSIG</A
10139N/A></DT
10139N/A><DT
10139N/A>4.6. <A
10139N/AHREF="Bv9ARM.ch04.html#AEN894"
12787N/A>TKEY</A
10139N/A></DT
10139N/A><DT
10139N/A>4.7. <A
11232N/AHREF="Bv9ARM.ch04.html#AEN909"
10139N/A>SIG(0)</A
10139N/A></DT
10139N/A><DT
10139N/A>4.8. <A
10139N/AHREF="Bv9ARM.ch04.html#DNSSEC"
10139N/A>DNSSEC</A
10139N/A></DT
11925N/A><DT
10139N/A>4.9. <A
13732N/AHREF="Bv9ARM.ch04.html#AEN994"
10139N/A>IPv6 Support in <SPAN
10139N/ACLASS="acronym"
10139N/A>BIND</SPAN
10139N/A> 9</A
10139N/A></DT
10139N/A></DL
10139N/A></DIV
10139N/A><DIV
10139N/ACLASS="sect1"
10139N/A><H1
10139N/ACLASS="sect1"
10139N/A><A
10139N/ANAME="notify"
15589N/A>4.1. Notify</A
10139N/A></H1
13727N/A><P
10139N/A><SPAN
10139N/ACLASS="acronym"
10139N/A>DNS</SPAN
10139N/A> NOTIFY is a mechanism that allows master
10139N/Aservers to notify their slave servers of changes to a zone's data. In
10697N/Aresponse to a <B
12374N/ACLASS="command"
10915N/A>NOTIFY</B
11161N/A> from a master server, the
12385N/Aslave will check to see that its version of the zone is the
13698N/Acurrent version and, if not, initiate a zone transfer.</P
13747N/A><P
13700N/A><SPAN
15815N/ACLASS="acronym"
12780N/A>DNS</SPAN
12780N/A>
13092N/AFor more information about
13360N/A<B
13409N/ACLASS="command"
13685N/A>NOTIFY</B
13695N/A>, see the description of the
13702N/A<B
13705N/ACLASS="command"
13711N/A>notify</B
13738N/A> option in <A
13787N/AHREF="Bv9ARM.ch06.html#boolean_options"
13891N/A>Section 6.2.14.1</A
13891N/A> and
13980N/Athe description of the zone option <B
14027N/ACLASS="command"
14132N/A>also-notify</B
15244N/A> in
15244N/A<A
15257N/AHREF="Bv9ARM.ch06.html#zone_transfers"
15317N/A>Section 6.2.14.6</A
15341N/A>. The <B
15342N/ACLASS="command"
15859N/A>NOTIFY</B
15342N/A>
15317N/Aprotocol is specified in RFC 1996.
10139N/A</P
10139N/A></DIV
10139N/A><DIV
10139N/ACLASS="sect1"
10139N/A><H1
10139N/ACLASS="sect1"
10139N/A><A
10139N/ANAME="dynamic_update"
10139N/A>4.2. Dynamic Update</A
10139N/A></H1
10139N/A><P
10139N/A>Dynamic Update is a method for adding, replacing or deleting
10139N/A records in a master server by sending it a special form of DNS
10139N/A messages. The format and meaning of these messages is specified
10139N/A in RFC 2136.</P
10139N/A><P
10139N/A>Dynamic update is enabled on a zone-by-zone basis, by
10139N/A including an <B
10139N/ACLASS="command"
10139N/A>allow-update</B
10139N/A> or
10139N/A <B
10139N/ACLASS="command"
10139N/A>update-policy</B
10139N/A> clause in the
10139N/A <B
10139N/ACLASS="command"
10139N/A>zone</B
10139N/A> statement.</P
10139N/A><P
10139N/A>Updating of secure zones (zones using DNSSEC) follows
10139N/A RFC 3007: SIG and NXT records affected by updates are automatically
10139N/A regenerated by the server using an online zone key.
10139N/A Update authorization is based
10139N/A on transaction signatures and an explicit server policy.</P
10139N/A><DIV
10139N/ACLASS="sect2"
10139N/A><H2
10139N/ACLASS="sect2"
10139N/A><A
10139N/ANAME="journal"
10139N/A>4.2.1. The journal file</A
10139N/A></H2
10139N/A><P
10139N/A>All changes made to a zone using dynamic update are stored in the
10139N/A zone's journal file. This file is automatically created by the
10139N/A server when when the first dynamic update takes place. The name of
10139N/A the journal file is formed by appending the
10139N/A extension <TT
10139N/ACLASS="filename"
10139N/A>.jnl</TT
10139N/A> to the
10139N/A name of the corresponding zone file. The journal file is in a
10139N/A binary format and should not be edited manually.</P
10139N/A><P
10139N/A>The server will also occasionally write ("dump")
10139N/A the complete contents of the updated zone to its zone file.
10139N/A This is not done immediately after
10139N/A each dynamic update, because that would be too slow when a large
10139N/A zone is updated frequently. Instead, the dump is delayed by
10139N/A up to 15 minutes, allowing additional updates to take place.</P
10139N/A><P
10139N/A>When a server is restarted after a shutdown or crash, it will replay
10139N/A the journal file to incorporate into the zone any updates that took
10139N/A place after the last zone dump.</P
10139N/A><P
10139N/A>Changes that result from incoming incremental zone transfers are also
10139N/A journalled in a similar way.</P
10139N/A><P
10139N/A>The zone files of dynamic zones cannot normally be edited by
10139N/A hand because they are not guaranteed to contain the most recent
10139N/A dynamic changes - those are only in the journal file.
10139N/A The only way to ensure that the zone file of a dynamic zone
10139N/A is up to date is to run <B
10139N/ACLASS="command"
10139N/A>rndc stop</B
10139N/A>.</P
10139N/A><P
10139N/A>If you have to make changes to a dynamic zone
10139N/A manually, the following procedure will work: Shut down
10139N/A the server using <B
10139N/ACLASS="command"
10139N/A>rndc stop</B
10139N/A> (sending a signal
10139N/A or using <B
10139N/ACLASS="command"
10139N/A>rndc halt</B
10139N/A> is <I
10139N/ACLASS="emphasis"
10139N/A>not</I
10139N/A>
10139N/A sufficient). Wait for the server to exit,
10139N/A then <I
10139N/ACLASS="emphasis"
10139N/A>remove</I
10139N/A> the zone's
10139N/A <TT
10139N/ACLASS="filename"
10139N/A>.jnl</TT
10139N/A> file, edit the zone file,
10139N/A and restart the server. Removing the <TT
10139N/ACLASS="filename"
10139N/A>.jnl</TT
10139N/A>
10139N/A file is necessary because the manual edits will not be
10139N/A present in the journal, rendering it inconsistent with the
10139N/A contents of the zone file.</P
10139N/A></DIV
10139N/A></DIV
10139N/A><DIV
10139N/ACLASS="sect1"
10139N/A><H1
10139N/ACLASS="sect1"
10139N/A><A
10139N/ANAME="incremental_zone_transfers"
10139N/A>4.3. Incremental Zone Transfers (IXFR)</A
10139N/A></H1
10139N/A><P
14177N/A>The incremental zone transfer (IXFR) protocol is a way for
14177N/Aslave servers to transfer only changed data, instead of having to
14177N/Atransfer the entire zone. The IXFR protocol is specified in RFC
14177N/A1995. See <A
11965N/AHREF="Bv9ARM.ch09.html#proposed_standards"
11965N/A>Proposed Standards</A
13931N/A>.</P
11965N/A><P
11965N/A>When acting as a master, <SPAN
11965N/ACLASS="acronym"
13931N/A>BIND</SPAN
11965N/A> 9
11965N/Asupports IXFR for those zones
11965N/Awhere the necessary change history information is available. These
11965N/Ainclude master zones maintained by dynamic update and slave zones
11965N/Awhose data was obtained by IXFR. For manually maintained master
11965N/Azones, and for slave zones obtained by performing a full zone
13678N/Atransfer (AXFR), IXFR is supported only if the option
13678N/A<B
13678N/ACLASS="command"
13678N/A>ixfr-from-differences</B
13678N/A> is set
13678N/Ato <TT
10139N/ACLASS="userinput"
10139N/A><B
10139N/A>yes</B
10139N/A></TT
10139N/A>.
10139N/A</P
10139N/A><P
10139N/A>When acting as a slave, <SPAN
10139N/ACLASS="acronym"
10139N/A>BIND</SPAN
10139N/A> 9 will
10139N/Aattempt to use IXFR unless
10139N/Ait is explicitly disabled. For more information about disabling
10139N/AIXFR, see the description of the <B
13726N/ACLASS="command"
13806N/A>request-ixfr</B
13806N/A> clause
13806N/Aof the <B
10139N/ACLASS="command"
10139N/A>server</B
13680N/A> statement.</P
13680N/A></DIV
13680N/A><DIV
13678N/ACLASS="sect1"
10139N/A><H1
10139N/ACLASS="sect1"
10139N/A><A
10139N/ANAME="AEN734"
11933N/A>4.4. Split DNS</A
11933N/A></H1
11933N/A><P
11933N/A>Setting up different views, or visibility, of the DNS space to
10139N/Ainternal and external resolvers is usually referred to as a <I
10139N/ACLASS="emphasis"
10139N/A>Split
10139N/ADNS</I
10139N/A> setup. There are several reasons an organization
10139N/Awould want to set up its DNS this way.</P
13760N/A><P
13760N/A>One common reason for setting up a DNS system this way is
10139N/Ato hide "internal" DNS information from "external" clients on the
10139N/AInternet. There is some debate as to whether or not this is actually useful.
13760N/AInternal DNS information leaks out in many ways (via email headers,
13760N/Afor example) and most savvy "attackers" can find the information
10139N/Athey need using other means.</P
10139N/A><P
10139N/A>Another common reason for setting up a Split DNS system is
15288N/Ato allow internal networks that are behind filters or in RFC 1918
15288N/Aspace (reserved IP space, as documented in RFC 1918) to resolve DNS
15288N/Aon the Internet. Split DNS can also be used to allow mail from outside
15288N/Aback in to the internal network.</P
15288N/A><P
15288N/A>Here is an example of a split DNS setup:</P
11161N/A><P
11161N/A>Let's say a company named <I
11161N/ACLASS="emphasis"
11161N/A>Example, Inc.</I
11161N/A>
10139N/A(<TT
10139N/ACLASS="literal"
10139N/A>example.com</TT
10139N/A>)
15238N/Ahas several corporate sites that have an internal network with reserved
15238N/AInternet Protocol (IP) space and an external demilitarized zone (DMZ),
15238N/Aor "outside" section of a network, that is available to the public.</P
15238N/A><P
15238N/A><I
13760N/ACLASS="emphasis"
13760N/A>Example, Inc.</I
13760N/A> wants its internal clients
10139N/Ato be able to resolve external hostnames and to exchange mail with
11161N/Apeople on the outside. The company also wants its internal resolvers
10139N/Ato have access to certain internal-only zones that are not available
10139N/Aat all outside of the internal network.</P
10139N/A><P
10139N/A>In order to accomplish this, the company will set up two sets
10139N/Aof name servers. One set will be on the inside network (in the reserved
10139N/AIP space) and the other set will be on bastion hosts, which are "proxy"
10139N/Ahosts that can talk to both sides of its network, in the DMZ.</P
10139N/A><P
10139N/A>The internal servers will be configured to forward all queries,
10139N/Aexcept queries for <TT
10139N/ACLASS="filename"
10139N/A>site1.internal</TT
10139N/A>, <TT
10139N/ACLASS="filename"
10139N/A>site2.internal</TT
10139N/A>, <TT
10139N/ACLASS="filename"
10139N/A>site1.example.com</TT
10139N/A>,
10139N/Aand <TT
10139N/ACLASS="filename"
10139N/A>site2.example.com</TT
10139N/A>, to the servers in the
10139N/ADMZ. These internal servers will have complete sets of information
10139N/Afor <TT
10139N/ACLASS="filename"
10139N/A>site1.example.com</TT
10139N/A>, <TT
11160N/ACLASS="filename"
10139N/A>site2.example.com</TT
10139N/A>,<I
10139N/ACLASS="emphasis"
10139N/A> </I
11193N/A><TT
13036N/ACLASS="filename"
10139N/A>site1.internal</TT
10139N/A>,
10139N/Aand <TT
10139N/ACLASS="filename"
10139N/A>site2.internal</TT
10139N/A>.</P
10139N/A><P
10139N/A>To protect the <TT
10139N/ACLASS="filename"
10139N/A>site1.internal</TT
10139N/A> and <TT
10139N/ACLASS="filename"
10139N/A>site2.internal</TT
10139N/A> domains,
10139N/Athe internal name servers must be configured to disallow all queries
10139N/Ato these domains from any external hosts, including the bastion
10139N/Ahosts.</P
10139N/A><P
10139N/A>The external servers, which are on the bastion hosts, will
10139N/Abe configured to serve the "public" version of the <TT
10139N/ACLASS="filename"
10139N/A>site1</TT
10139N/A> and <TT
10139N/ACLASS="filename"
10139N/A>site2.example.com</TT
10139N/A> zones.
10139N/AThis could include things such as the host records for public servers
10139N/A(<TT
10139N/ACLASS="filename"
10139N/A>www.example.com</TT
10139N/A> and <TT
10139N/ACLASS="filename"
10139N/A>ftp.example.com</TT
10139N/A>),
10139N/Aand mail exchange (MX) records (<TT
10139N/ACLASS="filename"
10139N/A>a.mx.example.com</TT
10139N/A> and <TT
10139N/ACLASS="filename"
10139N/A>b.mx.example.com</TT
10139N/A>).</P
10139N/A><P
10139N/A>In addition, the public <TT
10139N/ACLASS="filename"
10139N/A>site1</TT
10139N/A> and <TT
10139N/ACLASS="filename"
10139N/A>site2.example.com</TT
10139N/A> zones
10139N/Ashould have special MX records that contain wildcard (`*') records
10139N/Apointing to the bastion hosts. This is needed because external mail
10139N/Aservers do not have any other way of looking up how to deliver mail
10139N/Ato those internal hosts. With the wildcard records, the mail will
10139N/Abe delivered to the bastion host, which can then forward it on to
10139N/Ainternal hosts.</P
10139N/A><P
10139N/A>Here's an example of a wildcard MX record:</P
10139N/A><PRE
10139N/ACLASS="programlisting"
10139N/A><TT
10139N/ACLASS="literal"
10139N/A>* IN MX 10 external1.example.com.</TT
10139N/A></PRE
10139N/A><P
10139N/A>Now that they accept mail on behalf of anything in the internal
10139N/Anetwork, the bastion hosts will need to know how to deliver mail
10139N/Ato internal hosts. In order for this to work properly, the resolvers on
10139N/Athe bastion hosts will need to be configured to point to the internal
10139N/Aname servers for DNS resolution.</P
10139N/A><P
10139N/A>Queries for internal hostnames will be answered by the internal
10139N/Aservers, and queries for external hostnames will be forwarded back
10139N/Aout to the DNS servers on the bastion hosts.</P
10139N/A><P
10139N/A>In order for all this to work properly, internal clients will
10139N/Aneed to be configured to query <I
10139N/ACLASS="emphasis"
10139N/A>only</I
11904N/A> the internal
10139N/Aname servers for DNS queries. This could also be enforced via selective
11904N/Afiltering on the network.</P
11904N/A><P
10139N/A>If everything has been set properly, <I
10139N/ACLASS="emphasis"
11904N/A>Example, Inc.</I
10139N/A>'s
10139N/Ainternal clients will now be able to:</P
10139N/A><P
10139N/A></P
10139N/A><UL
10139N/A><LI
10139N/A><P
10139N/A>Look up any hostnames in the <TT
10139N/ACLASS="literal"
10139N/A>site1</TT
10139N/A> and
10139N/A<TT
10139N/ACLASS="literal"
10139N/A>site2.example.com</TT
10139N/A> zones.</P
10139N/A></LI
10139N/A><LI
10139N/A><P
10139N/A>Look up any hostnames in the <TT
10139N/ACLASS="literal"
10139N/A>site1.internal</TT
10139N/A> and
10139N/A<TT
10139N/ACLASS="literal"
10139N/A>site2.internal</TT
10139N/A> domains.</P
10139N/A></LI
10139N/A><LI
10139N/A><P
10139N/A>Look up any hostnames on the Internet.</P
10139N/A></LI
10139N/A><LI
10139N/A><P
10139N/A>Exchange mail with internal AND external people.</P
10139N/A></LI
13688N/A></UL
13688N/A><P
10139N/A>Hosts on the Internet will be able to:</P
10139N/A><P
12787N/A></P
12787N/A><UL
12787N/A><LI
12787N/A><P
12787N/A>Look up any hostnames in the <TT
12787N/ACLASS="literal"
12787N/A>site1</TT
12787N/A> and
12787N/A<TT
12787N/ACLASS="literal"
12787N/A>site2.example.com</TT
13285N/A> zones.</P
12787N/A></LI
12787N/A><LI
12787N/A><P
12787N/A>Exchange mail with anyone in the <TT
12787N/ACLASS="literal"
12787N/A>site1</TT
12787N/A> and
10139N/A<TT
10139N/ACLASS="literal"
10139N/A>site2.example.com</TT
10139N/A> zones.</P
10139N/A></LI
10139N/A></UL
10139N/A><P
10139N/A>Here is an example configuration for the setup we just
10139N/A described above. Note that this is only configuration information;
10139N/A for information on how to configure your zone files, see <A
12741N/AHREF="Bv9ARM.ch03.html#sample_configuration"
12741N/A>Section 3.1</A
12741N/A></P
12741N/A><P
12741N/A>Internal DNS server config:</P
12741N/A><PRE
12741N/ACLASS="programlisting"
12741N/A>&#13;
12741N/Aacl internals { 172.16.72.0/24; 192.168.1.0/24; };
12741N/A
13691N/Aacl externals { <TT
13691N/ACLASS="varname"
13691N/A>bastion-ips-go-here</TT
13691N/A>; };
11925N/A
10139N/Aoptions {
10139N/A ...
11232N/A ...
11232N/A forward only;
11232N/A forwarders { // forward to external servers
11232N/A <TT
10139N/ACLASS="varname"
10139N/A>bastion-ips-go-here</TT
10139N/A>;
10139N/A };
10139N/A allow-transfer { none; }; // sample allow-transfer (no one)
10139N/A allow-query { internals; externals; }; // restrict query access
10139N/A allow-recursion { internals; }; // restrict recursion
10139N/A ...
10139N/A ...
10139N/A};
10139N/A
10139N/Azone "site1.example.com" { // sample master zone
10139N/A type master;
10139N/A file "m/site1.example.com";
10139N/A forwarders { }; // do normal iterative
10139N/A // resolution (do not forward)
10139N/A allow-query { internals; externals; };
10139N/A allow-transfer { internals; };
10139N/A};
10139N/A
10139N/Azone "site2.example.com" { // sample slave zone
10139N/A type slave;
13725N/A file "s/site2.example.com";
10139N/A masters { 172.16.72.3; };
10139N/A forwarders { };
13725N/A allow-query { internals; externals; };
13725N/A allow-transfer { internals; };
10139N/A};
10139N/A
10139N/Azone "site1.internal" {
10139N/A type master;
10139N/A file "m/site1.internal";
10139N/A forwarders { };
13319N/A allow-query { internals; };
10139N/A allow-transfer { internals; }
10139N/A};
11904N/A
11904N/Azone "site2.internal" {
12013N/A type slave;
11904N/A file "s/site2.internal";
11904N/A masters { 172.16.72.3; };
10139N/A forwarders { };
10139N/A allow-query { internals };
10139N/A allow-transfer { internals; }
10139N/A};
10139N/A</PRE
10139N/A><P
10139N/A>External (bastion host) DNS server config:</P
10139N/A><PRE
10139N/ACLASS="programlisting"
10139N/A>&#13;acl internals { 172.16.72.0/24; 192.168.1.0/24; };
10139N/A
10139N/Aacl externals { bastion-ips-go-here; };
10139N/A
10139N/Aoptions {
10139N/A ...
10139N/A ...
10139N/A allow-transfer { none; }; // sample allow-transfer (no one)
10139N/A allow-query { internals; externals; }; // restrict query access
10139N/A allow-recursion { internals; externals; }; // restrict recursion
10139N/A ...
10139N/A ...
10139N/A};
10363N/A
10139N/Azone "site1.example.com" { // sample slave zone
10139N/A type master;
10139N/A file "m/site1.foo.com";
13488N/A allow-query { any; };
10139N/A allow-transfer { internals; externals; };
10139N/A};
10139N/A
11925N/Azone "site2.example.com" {
13738N/A type slave;
13738N/A file "s/site2.foo.com";
11925N/A masters { another_bastion_host_maybe; };
11925N/A allow-query { any; };
10139N/A allow-transfer { internals; externals; }
10139N/A};
13732N/A</PRE
13732N/A><P
13732N/A>In the <TT
13732N/ACLASS="filename"
13732N/A>resolv.conf</TT
10139N/A> (or equivalent) on
10139N/Athe bastion host(s):</P
13732N/A><PRE
13732N/ACLASS="programlisting"
13732N/A>&#13;search ...
13732N/Anameserver 172.16.72.2
13891N/Anameserver 172.16.72.3
10139N/Anameserver 172.16.72.4
10139N/A</PRE
13625N/A></DIV
13625N/A><DIV
10139N/ACLASS="sect1"
10139N/A><H1
10139N/ACLASS="sect1"
10139N/A><A
10139N/ANAME="tsig"
10139N/A>4.5. TSIG</A
10139N/A></H1
10139N/A><P
13872N/A>This is a short guide to setting up Transaction SIGnatures
11850N/A(TSIG) based transaction security in <SPAN
10139N/ACLASS="acronym"
10139N/A>BIND</SPAN
10139N/A>. It describes changes
10139N/Ato the configuration file as well as what changes are required for
10139N/Adifferent features, including the process of creating transaction
10139N/Akeys and using transaction signatures with <SPAN
13623N/ACLASS="acronym"
10139N/A>BIND</SPAN
10139N/A>.</P
10139N/A><P
10139N/A><SPAN
10139N/ACLASS="acronym"
10139N/A>BIND</SPAN
10139N/A> primarily supports TSIG for server to server communication.
10139N/AThis includes zone transfer, notify, and recursive query messages.
10139N/AResolvers based on newer versions of <SPAN
10139N/ACLASS="acronym"
10139N/A>BIND</SPAN
10139N/A> 8 have limited support
10139N/Afor TSIG.</P
10139N/A><P
10139N/A>TSIG might be most useful for dynamic update. A primary
10139N/A server for a dynamic zone should use access control to control
10139N/A updates, but IP-based access control is insufficient.
10139N/A The cryptographic access control provided by TSIG
10139N/A is far superior. The <B
10139N/ACLASS="command"
10139N/A>nsupdate</B
10139N/A>
10139N/A program supports TSIG via the <TT
10139N/ACLASS="option"
10139N/A>-k</TT
10139N/A> and
10885N/A <TT
10139N/ACLASS="option"
10139N/A>-y</TT
10139N/A> command line options.</P
10139N/A><DIV
10139N/ACLASS="sect2"
10139N/A><H2
10139N/ACLASS="sect2"
10139N/A><A
10139N/ANAME="AEN825"
10139N/A>4.5.1. Generate Shared Keys for Each Pair of Hosts</A
10139N/A></H2
10139N/A><P
10139N/A>A shared secret is generated to be shared between <I
10139N/ACLASS="emphasis"
10139N/A>host1</I
10139N/A> and <I
10139N/ACLASS="emphasis"
10139N/A>host2</I
10139N/A>.
10139N/AAn arbitrary key name is chosen: "host1-host2.". The key name must
10139N/Abe the same on both hosts.</P
10139N/A><DIV
10139N/ACLASS="sect3"
10139N/A><H3
10139N/ACLASS="sect3"
10139N/A><A
10139N/ANAME="AEN830"
10139N/A>4.5.1.1. Automatic Generation</A
10139N/A></H3
10139N/A><P
10139N/A>The following command will generate a 128 bit (16 byte) HMAC-MD5
10139N/Akey as described above. Longer keys are better, but shorter keys
10139N/Aare easier to read. Note that the maximum key length is 512 bits;
10139N/Akeys longer than that will be digested with MD5 to produce a 128
10139N/Abit key.</P
10139N/A><P
10139N/A><TT
10139N/ACLASS="userinput"
10139N/A><B
15589N/A>dnssec-keygen -a hmac-md5 -b 128 -n HOST host1-host2.</B
15589N/A></TT
15589N/A></P
15589N/A><P
10139N/A>The key is in the file <TT
10139N/ACLASS="filename"
10139N/A>Khost1-host2.+157+00000.private</TT
10139N/A>.
10139N/ANothing directly uses this file, but the base-64 encoded string
10139N/Afollowing "<TT
10139N/ACLASS="literal"
10139N/A>Key:</TT
10139N/A>"
10139N/Acan be extracted from the file and used as a shared secret:</P
10139N/A><PRE
10139N/ACLASS="programlisting"
10139N/A>Key: La/E5CjG9O+os1jq0a2jdA==</PRE
10139N/A><P
10139N/A>The string "<TT
10139N/ACLASS="literal"
10139N/A>La/E5CjG9O+os1jq0a2jdA==</TT
10139N/A>" can
10139N/Abe used as the shared secret.</P
10139N/A></DIV
10139N/A><DIV
10139N/ACLASS="sect3"
10139N/A><H3
10139N/ACLASS="sect3"
10139N/A><A
10139N/ANAME="AEN841"
10139N/A>4.5.1.2. Manual Generation</A
10139N/A></H3
13704N/A><P
13704N/A>The shared secret is simply a random sequence of bits, encoded
13704N/Ain base-64. Most ASCII strings are valid base-64 strings (assuming
13704N/Athe length is a multiple of 4 and only valid characters are used),
10320N/Aso the shared secret can be manually generated.</P
10320N/A><P
12374N/A>Also, a known string can be run through <B
12374N/ACLASS="command"
12374N/A>mmencode</B
12374N/A> or
13738N/Aa similar program to generate base-64 encoded data.</P
12374N/A></DIV
10697N/A></DIV
10697N/A><DIV
10697N/ACLASS="sect2"
10697N/A><H2
10697N/ACLASS="sect2"
10915N/A><A
13654N/ANAME="AEN846"
10915N/A>4.5.2. Copying the Shared Secret to Both Machines</A
10915N/A></H2
10915N/A><P
12385N/A>This is beyond the scope of DNS. A secure transport mechanism
12385N/Ashould be used. This could be secure FTP, ssh, telephone, etc.</P
12385N/A></DIV
12385N/A><DIV
13360N/ACLASS="sect2"
13360N/A><H2
13360N/ACLASS="sect2"
13360N/A><A
13360N/ANAME="AEN849"
13360N/A>4.5.3. Informing the Servers of the Key's Existence</A
12780N/A></H2
12780N/A><P
12780N/A>Imagine <I
12780N/ACLASS="emphasis"
12780N/A>host1</I
12780N/A> and <I
12780N/ACLASS="emphasis"
12780N/A>host 2</I
12780N/A> are
12780N/Aboth servers. The following is added to each server's <TT
13092N/ACLASS="filename"
13092N/A>named.conf</TT
13092N/A> file:</P
13092N/A><PRE
13092N/ACLASS="programlisting"
13409N/A>&#13;key host1-host2. {
15909N/A algorithm hmac-md5;
15909N/A secret "La/E5CjG9O+os1jq0a2jdA==";
13738N/A};
13409N/A</PRE
13727N/A><P
13727N/A>The algorithm, hmac-md5, is the only one supported by <SPAN
13727N/ACLASS="acronym"
13727N/A>BIND</SPAN
13727N/A>.
13695N/AThe secret is the one generated above. Since this is a secret, it
13695N/Ais recommended that either <TT
13695N/ACLASS="filename"
13695N/A>named.conf</TT
13738N/A> be non-world
13685N/Areadable, or the key directive be added to a non-world readable
15201N/Afile that is included by <TT
13685N/ACLASS="filename"
13409N/A>named.conf</TT
13698N/A>.</P
13698N/A><P
13698N/A>At this point, the key is recognized. This means that if the
13698N/Aserver receives a message signed by this key, it can verify the
13698N/Asignature. If the signature is successfully verified, the
13747N/Aresponse is signed by the same key.</P
15197N/A></DIV
13747N/A><DIV
13747N/ACLASS="sect2"
13700N/A><H2
13700N/ACLASS="sect2"
13700N/A><A
13700N/ANAME="AEN861"
15815N/A>4.5.4. Instructing the Server to Use the Key</A
15815N/A></H2
15815N/A><P
15815N/A>Since keys are shared between two hosts only, the server must
13702N/Abe told when keys are to be used. The following is added to the <TT
13702N/ACLASS="filename"
13702N/A>named.conf</TT
13702N/A> file
13738N/Afor <I
13702N/ACLASS="emphasis"
13705N/A>host1</I
13705N/A>, if the IP address of <I
13705N/ACLASS="emphasis"
13705N/A>host2</I
13738N/A> is
13705N/A10.1.2.3:</P
13711N/A><PRE
13711N/ACLASS="programlisting"
13711N/A>&#13;server 10.1.2.3 {
13711N/A keys { host1-host2. ;};
13738N/A};
13738N/A</PRE
13738N/A><P
13738N/A>Multiple keys may be present, but only the first is used.
13738N/AThis directive does not contain any secrets, so it may be in a world-readable
13738N/Afile.</P
13711N/A><P
13787N/A>If <I
13787N/ACLASS="emphasis"
13787N/A>host1</I
13787N/A> sends a message that is a request
13891N/Ato that address, the message will be signed with the specified key. <I
13891N/ACLASS="emphasis"
13891N/A>host1</I
13891N/A> will
13891N/Aexpect any responses to signed messages to be signed with the same
13891N/Akey.</P
13891N/A><P
13891N/A>A similar statement must be present in <I
13891N/ACLASS="emphasis"
13891N/A>host2</I
13980N/A>'s
13980N/Aconfiguration file (with <I
13980N/ACLASS="emphasis"
13980N/A>host1</I
13980N/A>'s address) for <I
14027N/ACLASS="emphasis"
14027N/A>host2</I
14027N/A> to
14027N/Asign request messages to <I
14132N/ACLASS="emphasis"
14132N/A>host1</I
14132N/A>.</P
14132N/A></DIV
15244N/A><DIV
15244N/ACLASS="sect2"
15244N/A><H2
15244N/ACLASS="sect2"
15244N/A><A
15244N/ANAME="AEN877"
15244N/A>4.5.5. TSIG Key Based Access Control</A
15244N/A></H2
15244N/A><P
15244N/A><SPAN
15244N/ACLASS="acronym"
15257N/A>BIND</SPAN
15257N/A> allows IP addresses and ranges to be specified in ACL
15257N/Adefinitions and
15257N/A<B
15257N/ACLASS="command"
15257N/A>allow-{ query | transfer | update }</B
15317N/A> directives.
15317N/AThis has been extended to allow TSIG keys also. The above key would
15317N/Abe denoted <B
15317N/ACLASS="command"
15341N/A>key host1-host2.</B
15341N/A></P
15341N/A><P
15341N/A>An example of an allow-update directive would be:</P
15867N/A><PRE
15859N/ACLASS="programlisting"
15867N/A>&#13;allow-update { key host1-host2. ;};
15859N/A</PRE
15859N/A><P
15342N/A>This allows dynamic updates to succeed only if the request
15342N/A was signed by a key named
15342N/A "<B
10139N/ACLASS="command"
10139N/A>host1-host2.</B
10139N/A>".</P
10139N/A><P
10139N/A>You may want to read about the more
10139N/A powerful <B
10139N/ACLASS="command"
10139N/A>update-policy</B
10139N/A> statement in <A
10139N/AHREF="Bv9ARM.ch06.html#dynamic_update_policies"
10139N/A>Section 6.2.22.4</A
10139N/A>.</P
10139N/A></DIV
10139N/A><DIV
10139N/ACLASS="sect2"
10139N/A><H2
10139N/ACLASS="sect2"
10139N/A><A
10139N/ANAME="AEN890"
10139N/A>4.5.6. Errors</A
10139N/A></H2
10139N/A><P
10139N/A>The processing of TSIG signed messages can result in
10139N/A several errors. If a signed message is sent to a non-TSIG aware
10139N/A server, a FORMERR will be returned, since the server will not
10139N/A understand the record. This is a result of misconfiguration,
10517N/A since the server must be explicitly configured to send a TSIG
10517N/A signed message to a specific server.</P
10517N/A><P
10517N/A>If a TSIG aware server receives a message signed by an
13570N/A unknown key, the response will be unsigned with the TSIG
13570N/A extended error code set to BADKEY. If a TSIG aware server
13570N/A receives a message with a signature that does not validate, the
13570N/A response will be unsigned with the TSIG extended error code set
13570N/A to BADSIG. If a TSIG aware server receives a message with a time
13570N/A outside of the allowed range, the response will be signed with
13570N/A the TSIG extended error code set to BADTIME, and the time values
10517N/A will be adjusted so that the response can be successfully
10139N/A verified. In any of these cases, the message's rcode is set to
10139N/A NOTAUTH.</P
10139N/A></DIV
10139N/A></DIV
10139N/A><DIV
10139N/ACLASS="sect1"
10139N/A><H1
10139N/ACLASS="sect1"
10139N/A><A
10139N/ANAME="AEN894"
10139N/A>4.6. TKEY</A
10139N/A></H1
10139N/A><P
10139N/A><B
10139N/ACLASS="command"
10139N/A>TKEY</B
10139N/A> is a mechanism for automatically
10139N/A generating a shared secret between two hosts. There are several
10139N/A "modes" of <B
10139N/ACLASS="command"
10139N/A>TKEY</B
10139N/A> that specify how the key is
10139N/A generated or assigned. <SPAN
13281N/ACLASS="acronym"
13281N/A>BIND</SPAN
13281N/A> 9
10139N/A implements only one of these modes,
10139N/A the Diffie-Hellman key exchange. Both hosts are required to have
10139N/A a Diffie-Hellman KEY record (although this record is not required
10139N/A to be present in a zone). The <B
10139N/ACLASS="command"
10139N/A>TKEY</B
10139N/A> process
10139N/A must use signed messages, signed either by TSIG or SIG(0). The
10139N/A result of <B
10139N/ACLASS="command"
10139N/A>TKEY</B
10139N/A> is a shared secret that can be
10139N/A used to sign messages with TSIG. <B
10139N/ACLASS="command"
10139N/A>TKEY</B
10139N/A> can also
10139N/A be used to delete shared secrets that it had previously
10139N/A generated.</P
10139N/A><P
10139N/A>The <B
10139N/ACLASS="command"
10139N/A>TKEY</B
10139N/A> process is initiated by a client
10139N/A or server by sending a signed <B
10139N/ACLASS="command"
10139N/A>TKEY</B
10139N/A> query
10139N/A (including any appropriate KEYs) to a TKEY-aware server. The
10139N/A server response, if it indicates success, will contain a
10139N/A <B
10139N/ACLASS="command"
10139N/A>TKEY</B
10139N/A> record and any appropriate keys. After
10139N/A this exchange, both participants have enough information to
10139N/A determine the shared secret; the exact process depends on the
10139N/A <B
10139N/ACLASS="command"
10139N/A>TKEY</B
10139N/A> mode. When using the Diffie-Hellman
10139N/A <B
10139N/ACLASS="command"
10139N/A>TKEY</B
10139N/A> mode, Diffie-Hellman keys are exchanged,
10139N/A and the shared secret is derived by both participants.</P
10139N/A></DIV
10139N/A><DIV
10139N/ACLASS="sect1"
10139N/A><H1
CLASS="sect1"
><A
NAME="AEN909"
>4.7. SIG(0)</A
></H1
><P
><SPAN
CLASS="acronym"
>BIND</SPAN
> 9 partially supports DNSSEC SIG(0) transaction
signatures as specified in RFC 2535. SIG(0) uses public/private
keys to authenticate messages. Access control is performed in the
same manner as TSIG keys; privileges can be granted or denied
based on the key name.</P
><P
>When a SIG(0) signed message is received, it will only be
verified if the key is known and trusted by the server; the server
will not attempt to locate and/or validate the key.</P
><P
>SIG(0) signing of multiple-message TCP streams is not
supported.</P
><P
><SPAN
CLASS="acronym"
>BIND</SPAN
> 9 does not ship with any tools that generate SIG(0)
signed messages.</P
></DIV
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="DNSSEC"
>4.8. DNSSEC</A
></H1
><P
>Cryptographic authentication of DNS information is possible
through the DNS Security (<I
CLASS="emphasis"
>DNSSEC</I
>) extensions,
defined in RFC 2535. This section describes the creation and use
of DNSSEC signed zones.</P
><P
>In order to set up a DNSSEC secure zone, there are a series
of steps which must be followed. <SPAN
CLASS="acronym"
>BIND</SPAN
> 9 ships
with several tools
that are used in this process, which are explained in more detail
below. In all cases, the "<TT
CLASS="option"
>-h</TT
>" option prints a
full list of parameters. Note that the DNSSEC tools require the
keyset and signedkey files to be in the working directory, and
that the tools shipped with BIND 9.0.x are not fully compatible
with the current ones.</P
><P
>There must also be communication with the administrators of
the parent and/or child zone to transmit keys and signatures. A
zone's security status must be indicated by the parent zone for a
DNSSEC capable resolver to trust its data.</P
><P
>For other servers to trust data in this zone, they must
either be statically configured with this zone's zone key or the
zone key of another zone above this one in the DNS tree.</P
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN926"
>4.8.1. Generating Keys</A
></H2
><P
>The <B
CLASS="command"
>dnssec-keygen</B
> program is used to
generate keys.</P
><P
>A secure zone must contain one or more zone keys. The
zone keys will sign all other records in the zone, as well as
the zone keys of any secure delegated zones. Zone keys must
have the same name as the zone, a name type of
<B
CLASS="command"
>ZONE</B
>, and must be usable for authentication.
It is recommended that zone keys use a cryptographic algorithm
designated as "mandatory to implement" by the IETF; currently
these are RSASHA1 and DSA.</P
><P
>The following command will generate a 768 bit DSA key for
the <TT
CLASS="filename"
>child.example</TT
> zone:</P
><P
><TT
CLASS="userinput"
><B
>dnssec-keygen -a DSA -b 768 -n ZONE child.example.</B
></TT
></P
><P
>Two output files will be produced:
<TT
CLASS="filename"
>Kchild.example.+003+12345.key</TT
> and
<TT
CLASS="filename"
>Kchild.example.+003+12345.private</TT
> (where
12345 is an example of a key tag). The key file names contain
the key name (<TT
CLASS="filename"
>child.example.</TT
>), algorithm (3
is DSA, 1 is RSAMD5, 5 is RSASHA1, etc.), and the key tag (12345 in this case).
The private key (in the <TT
CLASS="filename"
>.private</TT
> file) is
used to generate signatures, and the public key (in the
<TT
CLASS="filename"
>.key</TT
> file) is used for signature
verification.</P
><P
>To generate another key with the same properties (but with
a different key tag), repeat the above command.</P
><P
>The public keys should be inserted into the zone file by
including the <TT
CLASS="filename"
>.key</TT
> files using
<B
CLASS="command"
>$INCLUDE</B
> statements.
</P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN946"
>4.8.2. Creating a Keyset</A
></H2
><P
>The <B
CLASS="command"
>dnssec-makekeyset</B
> program is used
to create a key set from one or more keys.</P
><P
>Once the zone keys have been generated, a key set must be
built for transmission to the administrator of the parent zone,
so that the parent zone can sign the keys with its own zone key
and correctly indicate the security status of this zone. When
building a key set, the list of keys to be included and the TTL
of the set must be specified, and the desired signature validity
period of the parent's signature may also be specified.</P
><P
>The list of keys to be inserted into the key set may also
included non-zone keys present at the top of the zone.
<B
CLASS="command"
>dnssec-makekeyset</B
> may also be used at other
names in the zone.</P
><P
>The following command generates a key set containing the
above key and another key similarly generated, with a TTL of
3600 and a signature validity period of 10 days starting from
now.</P
><P
><TT
CLASS="userinput"
><B
>dnssec-makekeyset -t 3600 -e +864000 Kchild.example.+003+12345 Kchild.example.+003+23456</B
></TT
></P
><P
>One output file is produced:
<TT
CLASS="filename"
>keyset-child.example.</TT
>. This file should be
transmitted to the parent to be signed. It includes the keys,
as well as signatures over the key set generated by the zone
keys themselves, which are used to prove ownership of the
private keys and encode the desired validity period.</P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN958"
>4.8.3. Signing the Child's Keyset</A
></H2
><P
>The <B
CLASS="command"
>dnssec-signkey</B
> program is used to
sign one child's keyset.</P
><P
>If the <TT
CLASS="filename"
>child.example</TT
> zone has any
delegations which are secure, for example,
<TT
CLASS="filename"
>grand.child.example</TT
>, the
<TT
CLASS="filename"
>child.example</TT
> administrator should receive
keyset files for each secure subzone. These keys must be signed
by this zone's zone keys.</P
><P
>The following command signs the child's key set with the
zone keys:</P
><P
><TT
CLASS="userinput"
><B
>dnssec-signkey keyset-grand.child.example. Kchild.example.+003+12345 Kchild.example.+003+23456</B
></TT
></P
><P
>One output file is produced:
<TT
CLASS="filename"
>signedkey-grand.child.example.</TT
>. This file
should be both transmitted back to the child and retained. It
includes all keys (the child's keys) from the keyset file and
signatures generated by this zone's zone keys.</P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN971"
>4.8.4. Signing the Zone</A
></H2
><P
>The <B
CLASS="command"
>dnssec-signzone</B
> program is used to
sign a zone.</P
><P
>Any <TT
CLASS="filename"
>signedkey</TT
> files corresponding to
secure subzones should be present, as well as a
<TT
CLASS="filename"
>signedkey</TT
> file for this zone generated by
the parent (if there is one). The zone signer will generate
<TT
CLASS="literal"
>NXT</TT
> and <TT
CLASS="literal"
>SIG</TT
> records for
the zone, as well as incorporate the zone key signature from the
parent and indicate the security status at all delegation
points.</P
><P
>The following command signs the zone, assuming it is in a
file called <TT
CLASS="filename"
>zone.child.example</TT
>. By
default, all zone keys which have an available private key are
used to generate signatures.</P
><P
><TT
CLASS="userinput"
><B
>dnssec-signzone -o child.example zone.child.example</B
></TT
></P
><P
>One output file is produced:
<TT
CLASS="filename"
>zone.child.example.signed</TT
>. This file
should be referenced by <TT
CLASS="filename"
>named.conf</TT
> as the
input file for the zone.</P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN987"
>4.8.5. Configuring Servers</A
></H2
><P
>Unlike <SPAN
CLASS="acronym"
>BIND</SPAN
> 8,
<SPAN
CLASS="acronym"
>BIND</SPAN
> 9 does not verify signatures on load,
so zone keys for authoritative zones do not need to be specified
in the configuration file.</P
><P
>The public key for any security root must be present in
the configuration file's <B
CLASS="command"
>trusted-keys</B
>
statement, as described later in this document. </P
></DIV
></DIV
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="AEN994"
>4.9. IPv6 Support in <SPAN
CLASS="acronym"
>BIND</SPAN
> 9</A
></H1
><P
><SPAN
CLASS="acronym"
>BIND</SPAN
> 9 fully supports all currently defined forms of IPv6
name to address and address to name lookups. It will also use
IPv6 addresses to make queries when running on an IPv6 capable
system.</P
><P
>For forward lookups, <SPAN
CLASS="acronym"
>BIND</SPAN
> 9 supports both A6 and AAAA
records. The use of AAAA records is deprecated, but it is still
useful for hosts to have both AAAA and A6 records to maintain
backward compatibility with installations where AAAA records are
still used. In fact, the stub resolvers currently shipped with
most operating system support only AAAA lookups, because following
A6 chains is much harder than doing A or AAAA lookups.</P
><P
>For IPv6 reverse lookups, <SPAN
CLASS="acronym"
>BIND</SPAN
> 9 supports the new
"binary label" (also known as "bitstring")
format used in the <I
CLASS="emphasis"
>ip6.arpa</I
>
domain, as well as the older, deprecated "nibble" format used in
the <I
CLASS="emphasis"
>ip6.int</I
> domain.</P
><P
><SPAN
CLASS="acronym"
>BIND</SPAN
> 9 includes a new lightweight resolver library and
resolver daemon which new applications may choose to use to avoid
the complexities of A6 chain following and binary labels, see <A
HREF="Bv9ARM.ch05.html"
>Chapter 5</A
>. Alternatively, applications can link with a stub
resolver that supports A and AAAA records only and rely on the server to
synthesize AAAA recorsd from A6 chains (<A
HREF="Bv9ARM.ch06.html#synthesis"
>Section 6.2.14.13</A
>).
</P
><P
>For an overview of the format and structure of IPv6 addresses,
see <A
HREF="Bv9ARM.ch09.html#ipv6addresses"
>Section A.3.1</A
>.</P
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN1011"
>4.9.1. Address Lookups Using AAAA Records</A
></H2
><P
>The AAAA record is a parallel to the IPv4 A record. It
specifies the entire address in a single record. For
example,</P
><PRE
CLASS="programlisting"
>&#13;$ORIGIN example.com.
host 3600 IN AAAA 3ffe:8050:201:1860:42::1
</PRE
><P
>While their use is deprecated, they are useful to support
older IPv6 applications. They should not be added where they
are not absolutely necessary.</P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN1016"
>4.9.2. Address Lookups Using A6 Records</A
></H2
><P
>The A6 record is more flexible than the AAAA record, and
is therefore more complicated. The A6 record can be used to
form a chain of A6 records, each specifying part of the IPv6
address. It can also be used to specify the entire record as
well. For example, this record supplies the same data as the
AAAA record in the previous example:</P
><PRE
CLASS="programlisting"
>&#13;$ORIGIN example.com.
host 3600 IN A6 0 3ffe:8050:201:1860:42::1
</PRE
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="AEN1020"
>4.9.2.1. A6 Chains</A
></H3
><P
>A6 records are designed to allow network
renumbering. This works when an A6 record only specifies the
part of the address space the domain owner controls. For
example, a host may be at a company named "company." It has
two ISPs which provide IPv6 address space for it. These two
ISPs fully specify the IPv6 prefix they supply.</P
><P
>In the company's address space:</P
><PRE
CLASS="programlisting"
>&#13;$ORIGIN example.com.
host 3600 IN A6 64 0:0:0:0:42::1 company.example1.net.
host 3600 IN A6 64 0:0:0:0:42::1 company.example2.net.
</PRE
><P
>ISP1 will use:</P
><PRE
CLASS="programlisting"
>&#13;$ORIGIN example1.net.
company 3600 IN A6 0 3ffe:8050:201:1860::
</PRE
><P
>ISP2 will use:</P
><PRE
CLASS="programlisting"
>&#13;$ORIGIN example2.net.
company 3600 IN A6 0 1234:5678:90ab:fffa::
</PRE
><P
>When <TT
CLASS="literal"
>host.example.com</TT
> is looked up,
the resolver (in the resolver daemon or caching name server)
will find two partial A6 records, and will use the additional
name to find the remainder of the data.</P
></DIV
><DIV
CLASS="sect3"
><H3
CLASS="sect3"
><A
NAME="AEN1031"
>4.9.2.2. A6 Records for DNS Servers</A
></H3
><P
>When an A6 record specifies the address of a name
server, it should use the full address rather than specifying
a partial address. For example:</P
><PRE
CLASS="programlisting"
>&#13;$ORIGIN example.com.
@ 14400 IN NS ns0
14400 IN NS ns1
ns0 14400 IN A6 0 3ffe:8050:201:1860:42::1
ns1 14400 IN A 192.168.42.1
</PRE
><P
>It is recommended that IPv4-in-IPv6 mapped addresses not
be used. If a host has an IPv4 address, use an A record, not
an A6, with <TT
CLASS="literal"
>::ffff:192.168.42.1</TT
> as the
address.</P
></DIV
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN1037"
>4.9.3. Address to Name Lookups Using Nibble Format</A
></H2
><P
>While the use of nibble format to look up names is
deprecated, it is supported for backwards compatibility with
existing IPv6 applications.</P
><P
>When looking up an address in nibble format, the address
components are simply reversed, just as in IPv4, and
<TT
CLASS="literal"
>ip6.int.</TT
> is appended to the resulting name.
For example, the following would provide reverse name lookup for
a host with address
<TT
CLASS="literal"
>3ffe:8050:201:1860:42::1</TT
>.</P
><PRE
CLASS="programlisting"
>&#13;$ORIGIN 0.6.8.1.1.0.2.0.0.5.0.8.e.f.f.3.ip6.int.
1.0.0.0.0.0.0.0.0.0.0.0.2.4.0.0 14400 IN PTR host.example.com.
</PRE
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN1044"
>4.9.4. Address to Name Lookups Using Binary Label Format</A
></H2
><P
>Binary labels can start and end on any bit boundary,
rather than on a multiple of 4 bits as in the nibble
format. They also use <I
CLASS="emphasis"
>ip6.arpa</I
> rather than
<I
CLASS="emphasis"
>ip6.int</I
>.</P
><P
>To replicate the previous example using binary labels:</P
><PRE
CLASS="programlisting"
>&#13;$ORIGIN \[x3ffe805002011860/64].ip6.arpa.
\[x0042000000000001/64] 14400 IN PTR host.example.com.
</PRE
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="AEN1051"
>4.9.5. Using DNAME for Delegation of IPv6 Reverse Addresses</A
></H2
><P
>In IPv6, the same host may have many addresses from many
network providers. Since the trailing portion of the address
usually remains constant, <B
CLASS="command"
>DNAME</B
> can help
reduce the number of zone files used for reverse mapping that
need to be maintained.</P
><P
>For example, consider a host which has two providers
(<TT
CLASS="literal"
>example.net</TT
> and
<TT
CLASS="literal"
>example2.net</TT
>) and
therefore two IPv6 addresses. Since the host chooses its own 64
bit host address portion, the provider address is the only part
that changes:</P
><PRE
CLASS="programlisting"
>&#13;$ORIGIN example.com.
host IN A6 64 ::1234:5678:1212:5675 cust1.example.net.
IN A6 64 ::1234:5678:1212:5675 subnet5.example2.net.
$ORIGIN example.net.
cust1 IN A6 48 0:0:0:dddd:: ipv6net.example.net.
ipv6net IN A6 0 aa:bb:cccc::
$ORIGIN example2.net.
subnet5 IN A6 48 0:0:0:1:: ipv6net2.example2.net.
ipv6net2 IN A6 0 6666:5555:4::
</PRE
><P
>This sets up forward lookups. To handle the reverse lookups,
the provider <TT
CLASS="literal"
>example.net</TT
>
would have:</P
><PRE
CLASS="programlisting"
>&#13;$ORIGIN \[x00aa00bbcccc/48].ip6.arpa.
\[xdddd/16] IN DNAME ipv6-rev.example.com.
</PRE
><P
>and <TT
CLASS="literal"
>example2.net</TT
> would have:</P
><PRE
CLASS="programlisting"
>&#13;$ORIGIN \[x666655550004/48].ip6.arpa.
\[x0001/16] IN DNAME ipv6-rev.example.com.
</PRE
><P
><TT
CLASS="literal"
>example.com</TT
>
needs only one zone file to handle both of these reverse
mappings:</P
><PRE
CLASS="programlisting"
>&#13;$ORIGIN ipv6-rev.example.com.
\[x1234567812125675/64] IN PTR host.example.com.
</PRE
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="Bv9ARM.ch03.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="Bv9ARM.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="Bv9ARM.ch05.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Name Server Configuration</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>The <SPAN
CLASS="acronym"
>BIND</SPAN
> 9 Lightweight Resolver</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>