10139N/ACONTENT="Modular DocBook HTML Stylesheet Version 1.61 10139N/ATITLE="BIND 9 Administrator Reference Manual" 10139N/ATITLE="Name Server Configuration" 10139N/ATITLE="The BIND 9 Lightweight Resolver" 10139N/A>BIND 9 Administrator Reference Manual</
TH 10139N/A>Chapter 4. Advanced DNS Features</
A 10139N/A>Incremental Zone Transfers (IXFR)</
A 10139N/A> NOTIFY is a mechanism that allows master
10139N/Aservers to notify their slave servers of changes to a zone's data. In
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 13980N/Athe description of the zone option <
B 15317N/Aprotocol is specified in RFC 1996.
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>Dynamic update is enabled on a zone-by-zone basis, by
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 on transaction signatures and an explicit server policy.</
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 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>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>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>Changes that result from incoming incremental zone transfers are also
10139N/A journalled in a similar way.</
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>If you have to make changes to a dynamic zone
10139N/A manually, the following procedure will work: Shut down
10139N/A sufficient). Wait for the server to exit,
10139N/A and restart the server. Removing the <
TT 10139N/A file is necessary because the manual edits will not be
10139N/A present in the journal, rendering it inconsistent with the
10139N/ANAME="incremental_zone_transfers" 10139N/A>4.3. Incremental Zone Transfers (IXFR)</
A 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
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
10139N/Ait is explicitly disabled. For more information about disabling
10139N/AIXFR, see the description of the <
B 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/A> setup. There are several reasons an organization
10139N/Awould want to set up its DNS this way.</
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/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>Here is an example of a split DNS setup:</
P 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 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>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>The internal servers will be configured to forward all queries,
10139N/ADMZ. These internal servers will have complete sets of information
10139N/Athe internal name servers must be configured to disallow all queries
10139N/Ato these domains from any external hosts, including the bastion
10139N/A>The external servers, which are on the bastion hosts, will
10139N/Abe configured to serve the "public" version of the <
TT 10139N/AThis could include things such as the host records for public servers
10139N/Aand mail exchange (MX) records (<
TT 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/A>Here's an example of a wildcard MX record:</
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>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>In order for all this to work properly, internal clients will
10139N/Aneed to be configured to query <
I 10139N/Aname servers for DNS queries. This could also be enforced via selective
10139N/A>If everything has been set properly, <
I 10139N/Ainternal clients will now be able to:</
P 10139N/A>Look up any hostnames in the <
TT 10139N/A>Look up any hostnames in the <
TT 10139N/A>Look up any hostnames on the Internet.</
P 10139N/A>Exchange mail with internal AND external people.</
P 10139N/A>Hosts on the Internet will be able to:</
P 12787N/A>Look up any hostnames in the <
TT 12787N/A>Exchange mail with anyone in the <
TT 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 11232N/A forwarders { // forward to external servers
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 forwarders { }; // do normal iterative
10139N/A allow-query { internals; externals; };
13725N/A allow-query { internals; externals; };
10139N/A>External (bastion host) DNS server config:</
P 10139N/Aacl externals { bastion-ips-go-here; };
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 allow-transfer { internals; externals; };
11925N/A masters { another_bastion_host_maybe; };
10139N/A allow-transfer { internals; externals; }
13872N/A>This is a short guide to setting up Transaction SIGnatures
11850N/A(TSIG) based transaction security in <
SPAN 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 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/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 program supports TSIG via the <
TT 10139N/A>4.5.1. Generate Shared Keys for Each Pair of Hosts</
A 10139N/A>A shared secret is generated to be shared between <
I 10139N/AAn arbitrary key name is chosen: "host1-host2.". The key name must
10139N/A>4.5.1.1. Automatic Generation</
A 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
15589N/A>dnssec-keygen -a hmac-md5 -b 128 -n HOST host1-host2.</
B 10139N/ANothing directly uses this file, but the base-64 encoded string
10139N/Acan be extracted from the file and used as a shared secret:</
P 10139N/Abe used as the shared secret.</
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 12374N/A>Also, a known string can be run through <
B 13738N/Aa similar program to generate base-64 encoded data.</
P 10915N/A>4.5.2. Copying the Shared Secret to Both Machines</
A 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 13360N/A>4.5.3. Informing the Servers of the Key's Existence</
A 12780N/Aboth servers. The following is added to each server's <
TT 13727N/A>The algorithm, hmac-md5, is the only one supported by <
SPAN 13695N/AThe secret is the one generated above. Since this is a secret, it
13685N/Areadable, or the key directive be added to a non-world readable
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 15815N/A>4.5.4. Instructing the Server to Use the Key</
A 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 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
13787N/A> sends a message that is a request
13891N/Ato that address, the message will be signed with the specified key. <
I 13891N/Aexpect any responses to signed messages to be signed with the same
13891N/A>A similar statement must be present in <
I 15244N/A>4.5.5. TSIG Key Based Access Control</
A 15257N/A> allows IP addresses and ranges to be specified in ACL
15257N/A>allow-{ query | transfer | update }</
B 15317N/AThis has been extended to allow TSIG keys also. The above key would
15341N/A>An example of an allow-update directive would be:</
P 15867N/A> allow-update { key host1-host2. ;};
15342N/A>This allows dynamic updates to succeed only if the request
10139N/A>You may want to read about the more
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>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> is a mechanism for automatically
10139N/A generating a shared secret between two hosts. There are several
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/A must use signed messages, signed either by TSIG or SIG(0). The
10139N/A> is a shared secret that can be
10139N/A used to sign messages with TSIG. <
B 10139N/A be used to delete shared secrets that it had previously
10139N/A> process is initiated by a client
10139N/A or server by sending a signed <
B 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> 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> mode. When using the Diffie-Hellman
10139N/A> mode, Diffie-Hellman keys are exchanged,
10139N/A and the shared secret is derived by both participants.</
P > 9 partially supports DNSSEC SIG(0) transaction
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>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>SIG(0) signing of multiple-message TCP streams is not
> 9 does not ship with any tools that generate SIG(0)
>Cryptographic authentication of DNS information is possible
through the DNS Security (<
I defined in RFC 2535. This section describes the creation and use
of DNSSEC signed zones.</
P>In order to set up a DNSSEC secure zone, there are a series
of steps which must be followed. <
SPAN that are used in this process, which are explained in more detail
below. In all cases, the "<
TT 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>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>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>4.8.1. Generating Keys</
A>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
>, 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>The following command will generate a 768 bit DSA key for
>Two output files will be produced:
12345 is an example of a key tag). The key file names contain
is DSA, 1 is RSAMD5, 5 is RSASHA1, etc.), and the key tag (12345 in this case).
The private key (in the <
TT used to generate signatures, and the public key (in the
> file) is used for signature
>To generate another key with the same properties (but with
a different key tag), repeat the above command.</
P>The public keys should be inserted into the zone file by
>4.8.2. Creating a Keyset</
A to create a key set from one or more keys.</
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>The list of keys to be inserted into the key set may also
included non-zone keys present at the top of the zone.
> may also be used at other
>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
>One output file is produced:
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>4.8.3. Signing the Child's Keyset</
A sign one child's keyset.</
P delegations which are secure, for example,
> administrator should receive
keyset files for each secure subzone. These keys must be signed
by this zone's zone keys.</
P>The following command signs the child's key set with the
>One output file is produced:
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>4.8.4. Signing the Zone</
A secure subzones should be present, as well as a
> file for this zone generated by
the parent (if there is one). The zone signer will generate
the zone, as well as incorporate the zone key signature from the
parent and indicate the security status at all delegation
>The following command signs the zone, assuming it is in a
default, all zone keys which have an available private key are
used to generate signatures.</
P>One output file is produced:
should be referenced by <
TT input file for the zone.</
P>4.8.5. Configuring Servers</
A> 9 does not verify signatures on load,
so zone keys for authoritative zones do not need to be specified
in the configuration file.</
P>The public key for any security root must be present in
the configuration file's <
Bstatement, as described later in this document. </
P>4.9. IPv6 Support in <
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
>For forward lookups, <
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>For IPv6 reverse lookups, <
SPAN "binary label" (also known as "bitstring")
domain, as well as the older, deprecated "nibble" format used in
> 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>. 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>For an overview of the format and structure of IPv6 addresses,
>4.9.1. Address Lookups Using AAAA Records</
A>The AAAA record is a parallel to the IPv4 A record. It
specifies the entire address in a single record. For
host 3600 IN AAAA 3ffe:8050:201:1860:42::1
>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>4.9.2. Address Lookups Using A6 Records</
A>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:</
Phost 3600 IN A6 0 3ffe:8050:201:1860:42::1
>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>In the company's address space:</
Pcompany 3600 IN A6 0 3ffe:8050:201:1860::
company 3600 IN A6 0 1234:5678:90ab:fffa::
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>4.9.2.2. A6 Records for DNS Servers</
A>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:</
Pns0 14400 IN A6 0 3ffe:8050:201:1860:42::1
ns1 14400 IN A 192.168.42.1
>It is recommended that IPv4-in-IPv6 mapped addresses not
be used. If a host has an IPv4 address, use an A record, not
>4.9.3. Address to Name Lookups Using Nibble Format</
A>While the use of nibble format to look up names is
deprecated, it is supported for backwards compatibility with
existing IPv6 applications.</
P>When looking up an address in nibble format, the address
components are simply reversed, just as in IPv4, and
> is appended to the resulting name.
For example, the following would provide reverse name lookup for
>3ffe:8050:201:1860:42::1</
TT>4.9.4. Address to Name Lookups Using Binary Label Format</
A>Binary labels can start and end on any bit boundary,
rather than on a multiple of 4 bits as in the nibble
>To replicate the previous example using binary labels:</
P>4.9.5. Using DNAME for Delegation of IPv6 Reverse Addresses</
A>In IPv6, the same host may have many addresses from many
network providers. Since the trailing portion of the address
usually remains constant, <
B reduce the number of zone files used for reverse mapping that
need to be maintained.</
P>For example, consider a host which has two providers
therefore two IPv6 addresses. Since the host chooses its own 64
bit host address portion, the provider address is the only part
ipv6net IN A6 0 aa:bb:cccc::
ipv6net2 IN A6 0 6666:5555:4::
>This sets up forward lookups. To handle the reverse lookups,
needs only one zone file to handle both of these reverse
>Name Server Configuration</
TD> 9 Lightweight Resolver</
TD