Dynamic update is the term used for the ability under certain specified conditions to add, modify or delete records or RRsets in the master zone files. Dynamic update is fully described in RFC 2136.
Dynamic update is enabled on a zone-by-zone basis, by including an
allow-update
or
update-policy
clause in the
zone
statement.
Updating of secure zones (zones using DNSSEC) works as specified in the simple-secure-update proposal. SIG and NXT records affected by updates are automatically regenerated by the server using an online zone key. Update authorization is based on transaction signatures and an explicit server policy.
The zone files of dynamic zones must not be edited by hand. The zone file on disk at any given time may not contain the latest changes performed by dynamic update. The zone file is written to disk only periodically, and changes that have occurred since the zone file was last written to disk are stored only in the zone's journal ( .jnl ) file. BIND 9 currently does not update the zone file when it exits like BIND 8 does, so editing the zone file manually is unsafe even when the server has been shut down.
The incremental zone transfer protocol (IXFR, RFC1995--see the list of Proposed Standards in the Appendices ) is a way for slave servers to transfer only changed data, instead of having to transfer the entire zone every time it changes.
When acting as a master, BIND 9 supports IXFR for those zones where the necessary change history information is available. These include master zones maintained by dynamic update and slave zones whose data was obtained by IXFR, but not manually maintained master zones nor slave zones obtained by AXFR.
When acting as a slave, BIND 9 will attempt to use IXFR unless it is explicitly disabled. For more information about disabling IXFR, see the description of the
request-ixfr
clause of the
server
statement.
Setting up different views, or visibility, of DNS space to internal , as opposed to external, resolvers is usually referred to as a "Split DNS" or "Split Brain DNS" setup. There are several reasons an organization would want to set its DNS up this way.
One common reason for setting up a DNS system this way is to hide "internal" DNS information from "external" clients on the Internet. There is some debate as to whether or not this is actually useful. Internal DNS information leaks out in many ways (via e-mail headers, for example) and most savvy "attackers" can find the information they need using other means.
Another common reason for setting up a Split DNS system is to allow internal networks that are behind filters or RFC1918 space (reserved IP space, as documented in RFC 1918) to resolve DNS on the Internet. Split DNS can also be used to allow mail from outside back in to the internal network.
Here is an example of a split DNS setup:
Let's say a company named Example, Inc. (example.com) has several corporate sites that have an internal network with reserved IP space and an external DMZ (the demilitarized zone, or "outside" section of a network) that is available to the public.
Example, Inc. wants its internal clients to be able to resolve external hostnames and to exchange mail with people on the outside. The company also wants its internal resolvers to have access to certain internal-only zones that are not available at all outside of the internal network.
In order to accomplish this, the company will set up two sets of nameservers. One set will be on the inside network (in the reserved IP space) and the other set will be on bastion hosts, which are "proxy" hosts that can talk to both sides of its network, in the DMZ.
The internal servers will be configured to forward all queries, except queries for site1.example , site2.example , site1.example.com , and site2.example.com , to the servers in the DMZ. These internal servers will have complete sets of information for site1.example.com , site2.example.com , site1.internal , and site2.internal .
To protect the site1.internal and site2.internal domains, the internal nameservers must be configured to disallow all queries to these domains from any external hosts, including the bastion hosts.
The external servers, which are on the bastion hosts, will be configured to serve the "public" version of the site1 and site2.example.com zones. This could include things such as the host records for public servers ( www.example.com , ftp.example.com ), and mail exchanger records ( a.mx.example.com and b.mx.example.com ).
In addition, the public site1 and site2 .example.com zones should have special MX records that contain wildcard (*) records pointing to the bastion hosts. This is needed because external mail servers do not have any other way of looking up how to deliver mail to those internal hosts. With the wildcard records, the mail will be delivered to the bastion host, which can then forward it on to internal hosts.
Here's an example of a wildcard MX record:
* IN MX 10 external1.example.com.
Now that they accept mail on behalf of anything in the internal network, the bastion hosts will need to know how to deliver mail to internal hosts. In order for this to work properly, the resolvers on the bastion hosts will need to be configured to point to the internal nameservers for DNS resolution.
Queries for internal hostnames will be answered by the internal servers, and queries for external hostnames will be forwarded back out to the DNS servers on the bastion hosts.
In order for all this to work properly, internal clients will need to be configured to query only the internal nameservers for DNS queries. This could also be enforced via selective filtering on the network.
If everything has been set properly, Example, Inc. 's internal clients will now be able to:
Hosts on the Internet will be able to:
Here is an example configuration for the setup we just described above. Note that this is only configuration information; see Sample Configuration and Logging for information on how to configure your zone files.
acl internals { 172.16.72.0/24; 192.168.1.0/24; }; acl externals { bastion-ips-go-here; }; options { ... ... forward only; forwarders { bastion-ips-go-here; }; // forward to external servers allow-transfer { none; }; // sample allow-transfer (no one) allow-query { internals; externals; }; // restrict query access allow-recursion { internals; }; // restrict recursion ... ... };
zone "site1.example.com" { // sample slave zone type master; file "m/site1.example.com"; forwarders { }; // do normal iterative resolution (do not forward) allow-query { internals; externals; }; allow-transfer { internals; }; };
zone "site2.example.com" { type slave; file "s/site2.example.com"; masters { 172.16.72.3; }; forwarders { }; allow-query { internals; externals; }; allow-transfer { internals; }; };
zone "site1.internal" { type master; file "m/site1.internal"; forwarders { }; allow-query { internals; }; allow-transfer { internals; } };
zone "site2.internal" { type slave; file "s/site2.internal"; masters { 172.16.72.3; }; forwarders { }; allow-query { internals }; allow-transfer { internals; } };
External (bastion host) DNS server config:
acl internals { 172.16.72.0/24; 192.168.1.0/24; }; acl externals { bastion-ips-go-here; }; options { ... ... allow-transfer { none; }; // sample allow-transfer (no one) allow-query { internals; externals; }; // restrict query access allow-recursion { internals; externals; }; // restrict recursion ... ... };
zone "site1.example.com" { // sample slave zone type master; file "m/site1.foo.com"; allow-query { any; }; allow-transfer { internals; externals; }; };
zone "site2.example.com" { type slave; file "s/site2.foo.com"; masters { another_bastion_host_maybe; }; allow-query { any; }; allow-transfer { internals; externals; } };
In the resolv.conf (or equivalent) on the bastion host(s):
search ... nameserver 172.16.72.2 nameserver 172.16.72.3 nameserver 172.16.72.4
Information about TSIG in this section was provided by Brian Wellington of TISLabs. This is a short guide to setting up TSIG based transaction security in BIND. It describes changes to the configuration file as well as what changes are required for different features, including the process of creating transaction keys and using transaction signatures with BIND.
BIND primarily supports TSIG for server-server communication. This includes zone transfer, notify, and recursive query messages. The resolver bundled with BIND 8.2 has limited support for TSIG, but it is doubtful that support will be integrated into any client applications.
TSIG might be most useful for dynamic update. A primary server for a dynamic zone should use access control to control updates, but IP-based access control is insufficient. Key-based access control is far superior (see
draft-ietf-dnsext-simple-secure-update-00.txt
in
Internet Drafts
). The
nsupdate
program that is shipped with BIND 8 supports TSIG via the "
-k
" command line option.
A shared secret is generated to be shared between host1 and host2. The key name is chosen to be "host1-host2.", which is arbitrary. The key name must be the same on both hosts.
The following command will generate a 128 bit (16 byte) HMAC-MD5 key as described above. Longer keys are better, but shorter keys are easier to read. Note that the maximum key length is 512 bits; keys longer than that will be digested with MD5 to produce a 128 bit key.
src/bin/dnskeygen/dnskeygen -H 128 -h -n host1-host2.
The key is in the file "Khost1-host2.+157+00000.private". Nothing actually uses this file, but the base64 encoded string following "Key:" can be extracted:
La/E5CjG9O+os1jq0a2jdA==
The shared secret is simply a random sequence of bits, encoded in base64. Most ASCII strings are valid base64 strings (assuming the length is a multiple of 4 and only valid characters are used), so the shared secret can be manually generated.
Also, a known string can be run through mmencode or a similar program to generate base64 encoded data.
This is beyond the scope of DNS. A secure transport mechanism should be used. This could be secure FTP, ssh, telephone, etc.
Imagine host1 and host 2 are both servers. The following is added to each server's named.conf file:
key host1-host2. { algorithm hmac-md5; secret "La/E5CjG9O+os1jq0a2jdA=="; };
The algorithm, hmac-md5, is the only one supported by BIND. The secret is the one generated above. Since this is a secret, it is recommended that either
named.conf
be non-world readable, or the key directive be added to a non-world readable file that's included by named.conf.
At this point, the key is recognized. This means that if the server receives a message signed by this key, it can verify the signature. If the signature succeeds, the response is signed by the same key.
Since keys are shared between two hosts only, the server must be told when keys are to be used. The following is added to host1's named.conf file, if host2's IP address is 10.1.2.3:
server 10.1.2.3 { keys {host1-host2.;}; };
Multiple keys may be present, but only the first is used. This directive does not contain any secrets, so it may be in a world-readable file.
If host1 sends a message that is a response to that address, the message will be signed with the specified key. host1 will expect any responses to signed messages to be signed with the same key.
A similar statement must be present in host2's configuration file (with host1's address) for host2 to sign non-response messages to host1.
BIND allows IP addresses and ranges to be specified in ACL definitions and
allow-{query|transfer|update}
directives. This has been extended to allow TSIG keys also. The above key would be denoted
key host1-host2
.
An example of an allow-update directive would be:
allow-update {key host1-host2.;};
This allows dynamic updates to succeed only if the request was signed by a key named "
host1-host2.
"
The processing of TSIG signed messages can result in several errors. If a signed message is sent to a non-TSIG aware server, a FORMERR will be returned, since the server will not understand the record. This is a result of misconfiguration, since the server must be explicitly configured to send a TSIG signed message to a specific server.
If a TSIG aware server receives a message signed by an unknown key, the response will be unsigned with the TSIG extended error code set to BADKEY. If a TSIG aware server receives a message with a signature that does not validate, the response will be unsigned with the TSIG extended error code set to BADSIG. If a TSIG aware server receives a message with a time outside of the allowed range, the response will be signed with the TSIG extended error code set to BADTIME, and the time values will be adjusted so that the response can be successfully verified. In any of these cases, the message's rcode is set to NOTAUTH.
TSIG verification errors are logged by the server as
"ns_req: TSIG verify failed - (reason)"
Cryptographc authentication of DNS information is made possible through the DNS Security (DNSSEC) extension to the domain system. This describes the processing of creating and using DNSSEC signed zones. The zones used in this exercise will be
dnssec.example
and
sub.dnssec.example
.
The following commands generate 640 bit DSA keys to be used as zone keys for the zones:
src/bin/dnskeygen/dnskeygen -D 640 -z -n dnssec.example. src/bin/dnskeygen/dnskeygen -D 640 -z -n sub.dnssec.example.
In our example, keys with id 64555 and 39020 were generated.
Four files were created on disk:
Kdnssec.example.+003+64555.key
(public key)
Kdnssec.example.+003+64555.private
(private key)
Ksub.dnssec.example.+003+39020.key
(public key)
Ksub.dnssec.example.+003+39020.private
(private key)
The
.key
files contain public keys in DNS RR format, which is base 64. The
.private
files contain private keys, with each field encoded in base 64.
The parent zone needs its own key and the child key (as glue). The child zone needs its own key.
cat Kdnssec.example.+003+64555.key >> zone.dnssec.example cat Ksub.dnssec.example.+003+39020.key >> zone.dnssec.example cat Ksub.dnssec.example.+003+39020.key >> zone.sub.dnssec.example
Edit the zone files if desired (to move and/or format KEY records, etc.). This is also a good time to add
$ORIGIN
directives to the zone files if they aren't present.
The following command uses the zone.dnssec.example as input and creates the zone.dnssec.example.signed file. The key used is the dsa key for dnssec.example with id 64555 (
-ki
), and statistics are printed (
-st
). Parent files are generated for each child zone (
-ps
), and no global parent file is produced (
-no-p1
).
contrib/dns_signer/signer/dnssigner -zi zone.dnssec.example \ -zo zone.dnssec.example.signed -st -k1 dnssec.example dsa 64555 -ps -no-p1
The following files are created:
zone.dnssec.example.signed
(signed zone)
sub.dnssec.example..PARENT
(parent file for sub.dnssec.example)
The following command is similar to the previous one. The main difference is that the input parent file sub.dnssec.example..PARENT is specified (
-pi
) in addition to the input zone file; this file was generated by the previous call to the signer. Also, the -ps and -no-p1 options are omitted since there are no child zones of this zone. If this zone had child zones, these options should be present.
contrib/dns_signer/signer/dnssigner
-zi zone.sub.dnssec.example \
-pi sub.dnssec.example..PARENT -zo zone.sub.dnssec.example.signed \
-st -k1 sub.dnssec.example dsa 39020
The following file is created:
zone.sub.dnssec.example.signed
(signed zone)
The public key for the top-level signed zone must be present in named.conf, so that the server can verify the data on load (it must be able to traverse a keychain and end at a trusted key). This key is added in a zone pubkey directive (which has a format similar to a KEY record, but not identical). Note that this is not needed for the subzone, as its key is signed by the trusted key in the parent zone.
This uses the key from Kdnssec.example.+003+64555.key
zone "dnssec.example" { type master; file "zone.dnssec.example.signed"; pubkey 16641 3 3 "AuNiWOmzSHwrzLMWv1C1gbKQBNAHwMeX+C0owQkfmdxjoTJvnmbN CdbGM/fnejQhEXsRT5l3NLy0H4UCX3ElGJT49n3nFb2jPuDYbkPh VV4sLfLJzQs/RWeQmQnNFF2HNmwksWlPvUT66k4mqJDtIk60Dio6 1PML5sVDMQns7Zukq4aSn4jzRGkbDGhB9S3yzXVMVjYDwlM9frW9 Ayt0vqDa0zG+V52YiCSOdFGWJ0bSFa8sTwcp4BEVUt/Kg2Zo4VAy +AeYLcQLb6vDZUX8x/BPByKKptfXirhNPv43xE6vT4xCxYPhvyDk Y7Qlf4W+/sSNNKE7P/JAKmQxxXAVPoXtBpa6"; };
This uses the same key as above.
trusted-keys { dnssec.example 16641 3 3 "AuNiWOmzSHwrzLMWv1C1gbKQBNAHwMeX+C0owQkfmdxjoTJvnmbN CdbGM/fnejQhEXsRT5l3NLy0H4UCX3ElGJT49n3nFb2jPuDYbkPh VV4sLfLJzQs/RWeQmQnNFF2HNmwksWlPvUT66k4mqJDtIk60Dio6 1PML5sVDMQns7Zukq4aSn4jzRGkbDGhB9S3yzXVMVjYDwlM9frW9 Ayt0vqDa0zG+V52YiCSOdFGWJ0bSFa8sTwcp4BEVUt/Kg2Zo4VAy +AeYLcQLb6vDZUX8x/BPByKKptfXirhNPv43xE6vT4xCxYPhvyDk Y7Qlf4W+/sSNNKE7P/JAKmQxxXAVPoXtBpa6"; }
IPv6 addresses are 128-bit identifiers for interfaces and sets of interfaces which were introduced in the DNS to facilitate scalable Internet routing. There are three types of addresses: Unicast , an identifier for a single interface; Anycast , an identifier for a set of interfaces; and Multicast , an identifier for a set of interfaces. Here we describe the global Unicast address scheme. For more information, see RFC 2374.
The aggregatable global Unicast address format is as follows:
The `Public Topology' is provided by the upstream provider or ISP, and (roughly) corresponds to the IPv4 `network' section of the address range. The `Site Topology' is where you can subnet this space, much like subnetting an IPv4 class A or B network into class Cs. The `Interface Identifier' is the address of an individual interface on a given network. (With IPv6, addresses belong to interfaces rather than machines.)
The subnetting capability of IPv6 is much more flexible than that of IPv4: subnetting can now be carried out on bit boundaries, in much the same way as Classless InterDomain Routing (CIDR).
The internal structure of the `Public Topology' for an A6 global unicast address consists of:
A 3 bit FP (Format Prefix) of 001 indicates this is a global unicast address. FP lengths for other types of addresses may vary.
13 TLA (Top Level Aggregator) bits give the prefix of your top-level IP backbone carrier.
24 bits for Next Level Aggregators. This allows organizations with a TLA to hand out portions of their IP space to client organizations, so that the client can then split up the network further by filling in more NLA bits, and hand out IPv6 prefixes to their clients, and so forth.
There is no particular structure for the `Site topology' section. Organizations can allocate these bits in any way they desire, in the same way as they would subnet an IPv4 class A (8 bit prefix) network.
The Interface identifier must be unique on that network. On ethernet networks, one way to ensure this is to set the address to the first three bytes of the hardware address, `FFFE', then the last three bytes of the hardware address. The lowest significant bit of the first byte should then be complemented. Addresses are written as 32-bit blocks separated with a colon, and leading zeros of a block may be omitted, for example:
3ffe:8050:201:9:a00:20ff:fe81:2b32
IPv6 address specifications are likely to contain long strings of zeros, so the architects have included a shorthand for specifying them. The double colon `::' indicates the longest possible string of zeros that can fit, and can be used only once in an address.
Forward name lookups (host name to IP address) under IPv6 do not necessarily return the complete IPv6 address of the host. Because the provider-assigned prefix may change, the A6 record can simply specify the locally assigned portion of the name, and refer to the provider for the remainder.
A complete IPv6 A6 record that provides the full 128 bit address looks like:
Note that the number preceding the address is the number of bits to be provided via the referral. This is probably the easiest way to roll out an IPv6 installation, though you may wish to provide a reference to your provider assigned prefix:
The referral where there are no more bits is to `.', the root zone. Be warned that excessive use of this chaining can lead to extremely poor name resolution for people trying to access your hosts.
Reverse IPv6 addresses may appear as one or more hex strings, known as "bitstring labels," each followed by a number of valid bits. A full 128 bits may be specified at the ip6.int top level, or more likely, the provider will delegate you a smaller chunk of addresses for which you will need to supply reverse DNS.
The address can be split up along arbitrary boundaries, and is written with hex numbers in forward order, rather than in reverse order as IPv4 PTR records are written. The sections between dot separators are reversed as usual. If the number of valid bits in the hex string is less than the string specifies, it is the first N bits that are counted. Thus, \[x2/3] gives a bit pattern of 0010, the first three bits of which, 001, are valid.
\[x3FFE8050020100090A0020FFFE812B32/128].ip6.int.
(not divided)
\[x00090A0020FFFE812B32/80].\[xFFF402801008/45].\[x2/3].ip6.int.
(divided into FP, TLA/RES/NLA, and local)
\[x00090A0020FFFE812B32/80].\[x80500201/32].\[xFFF0/13].\[x2/3].ip6.int.
(divided into FP, TLA, RES/NLA, and local)
These strings are all equivalent. The combined TLA/RES/NLA in the second example bears no resemblance to any string in the address because it is offset by three bits.
Delegation of reverse addresses is done through the new DNAME RR. In the example above, where
\[x2/3].ip6.int.
needs to delegate
\[xFFF0]
to an organization (
example2.com
), the domain administrator would insert a line similar to the following in the
\[x2/3].ip6.int.
zone:
$ORIGIN \[x2/3].ip6.int. \[xFFF0/13] 1h IN DNAME ip6.example2.com.
example2.com would then place into the ip6 zone:
$ORIGIN ip6.example.com. \[x80500201/32] 1h IN DNAME ip6.example.com.
Finally, example.com needs to include in the ip6.example.com zone:
$ORIGIN ip6.example.com. \[x00090A0020FFFE812B32/80] 1h IN PTR host.example.com.
We suggest that the top of your administrative control (
example.com
, in this case) provide all the bits required for reverse and forward resolution to allow name resolution even if the network is disconnected from the Internet. This will also allow operation with DNSSEC if you set up a false trusted server for "." containing only delegations for your forward and reverse zones directly to the top of your administrative control. This should be signed with a key trusted by all of your clients, equivalent to the real key for "
.
".
Return to BINDv9 Administrator Reference Manual table of contents.