[ Pobierz całość w formacie PDF ]
smtp.example.comis preferred over smtp.ipv4.example.combecause it has a lower preference
value. Both names point to the same IPv4 address, but smtpalso has an IPv6 address. Should
a remote mailserver have trouble with smtp.example.com, it will automatically fall back on
smtp.ipv4.example.com. The next two lines supply Aand AAAArecords for the domain itself.
These are useful when someone tries to connect to the domain itself, for instance, with the
URL http://example.com/.
The next three lines define the addresses for ns1.example.com. Even though regular appli-
cations don t look for A6records, BIND versions 9.x prior to 9.3 (which are still in wide use) do,
so supplying the IPv6 address of the nameserver in this format could speed things up a bit.
The AAAArecord is more important because it s the official way to publish an IPv6 address.
The wwwname has both an IPv4 and an IPv6 address and is supplemented by IPv4- and
IPv6-only versions (www.ipv4and www.ipv6, respectively). Having an IPv6-only name is useful
for quick IPv6 reachability tests: if the page loads, IPv6 is enabled and it works. If it doesn t,
IPv6 either isn t enabled, or there is no connectivity. The addresses for the smtpand smtp.ipv4
names reflect the earlier discussion. Finally, because the POP service is a critical one, and it s
difficult for email users to temporarily change the address for their POP server when there is
an IPv6 connectivity problem, the name corresponding to this service only has an IPv4 address.
However, there is an alternate name popv4v6with both an IPv4 and an IPv6 address for users
who prefer to use IPv6 when available, while maintaining the ability to fall back to IPv4.
Before the new domain can be used, it must be added to the named.conffile as in Listing 5-8.
It s a good idea to check the syntax of the zone file and the configuration file before reloading the
nameserver, like in Listing 5-10.
Listing 5-10. Checking a Zone and Configuration Files and Reloading named
# named-checkzone example.com /var/named/example.com
zone example.com/IN: loaded serial 2005020900
OK
# named-checkconf
# rndc reload
Reverse Mapping
The reverse mapping zones are by and large the same as regular zones, except that they con-
tain only PTRrecords, except for the initial SOAand NSrecords. However, the nibble format is
somewhat abrasive. The easiest way to turn IPv6 addresses into nibble format is by using the
hostcommand to look up the addresses in question. hostwill then echo back the nibble for-
mat query that it performs, which can then be copied and pasted into the zone file. Listing 5-11
shows the hostcommand and Listing 5-12 the resulting reverse zone file.
Listing 5-11. The hostCommand
host 2001:db8:31:1:201:2ff:fe29:2640
Host 0.4.6.2.9.2.e.f.f.f.2.0.1.0.2.0.1.0.0.0.1.3.0.0.8.b.d.0.1.0.0.2.ip6.arpa not ¥'
found: 3(NXDOMAIN)
5270_c05_final.qxd 10/1/05 12:56 AM Page 114
114 CHAPTER 5 % THE DNS
If the hostcommand tries to perform a bitlabel query, the program came with a BIND
version 9.x prior to 9.3. Use host -ninstead, and it will do an ip6.intquery.
Listing 5-12. A Reverse Zone
; 20050209 IvB created
$TTL 86400
@ IN SOA ns1.example.com. root.example.com. ( 2005020900 28800 7200 604800 ¥'
86400 )
IN NS ns1.example.com.
IN NS ns2.beispiel.de.
$ORIGIN 3.5.0.0.1.3.0.0.8.b.d.0.1.0.0.2.ip6.arpa.
; ns1 IN AAAA 2001:db8:31:53::53
3.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0 IN PTR ns1.example.com.
$ORIGIN 1.0.0.0.1.3.0.0.8.b.d.0.1.0.0.2.ip6.arpa.
; www IN AAAA 2001:db8:31:1:201:2ff:fe29:2640
0.4.6.2.9.2.e.f.f.f.2.0.1.0.2.0 IN PTR www.example.com.
; smtp IN AAAA 2001:db8:31:1:20a:95ff:fecd:987a
a.7.8.9.d.c.e.f.f.f.5.9.a.0.2.0 IN PTR smtp.example.com.
$ORIGIN 1.3.0.0.8.b.d.0.1.0.0.2.ip6.arpa.
0.0.2.c IN NS ns.research.example.com.
The $ORIGINdirective specifies which location in the DNS hierarchy the names that fol-
low are relative to. It s easiest to specify the top 64 address bits in a $ORIGINline and then
specify the remaining 64 bits on each individual line. This makes for one $ORIGINper subnet
and keeps the lines from becoming overly long. It can also be useful to keep the $ORIGIN
statements out of the zone file and let all names in the file be relative, so the same zone file
can be used for both the ip6.arpaand ip6.intzones.
This file holds the zone for prefix 2001:db8:31::/48, which corresponds to the
[ Pobierz całość w formacie PDF ]