Cover | Table of Contents
www.oreilly.com." (It actually ends with a dot—the separator—and the root's null label.) When the root node's label appears by itself, it is written as a single dot, ".", for convenience. Consequently, some software interprets a trailing dot in a domain name to indicate that the domain name is absolute. An absolute domain name is written relative to the root and unambiguously specifies a node's location in the hierarchy. An absolute domain name is also referred to as a fully qualified domain name, often abbreviated FQDN. Names without trailing dots are sometimes interpreted as relative to some domain name other than the root, just as directory names without a leading slash are often interpreted as relative to the current directory.hp.com), Sun Microsystems (sun.com), and IBM (ibm.com).berkeley.edu) and Purdue University (purdue.edu).nasa.gov) and the National Science Foundation (stanford.edu, for example, is delegated to the folks at Stanford who run the university's networks (Figure 2-7).
rockaway.acme.com subdomain and a kalamazoo.acme.com subdomain. However, the few hosts in the Acme sales offices scattered throughout the United States would fit better under acme.com than under either subdomain.berkeley.edu and hp.com, are broken into smaller, more manageable units by delegation. These units are called zones. The edu domain, shown in Figure 2-8, is divided into many zones, including the berkeley.edu zone, the purdue.edu zone, and the nwu.edu zone. At the top of the domain, there's also an edu zone. It's natural that the folks who run edu would break up the edu domain: otherwise, they'd have to manage the berkeley.edu subdomain themselves. It makes much more sense to delegate berkeley.edu to Berkeley. What's left for the folks who run edu? The edu zone, which contains mostly delegation information for the subdomains of edu.
berkeley.edu subdomain is, in turn, broken up into multiple zones by delegation, as shown in Figure 2-9. There are delegated subdomains called cc, cs, ce, me, and more. Each subdomain is delegated to a set of nameservers, some of which are also authoritative for berkeley.edu. However, the zones are still separate and may have totally different groups of authoritative nameservers.
eecs.berkeley.edu. In the process, it cached the names and addresses of the eecs.berkeley.edu and berkeley.edu nameservers (plus eecs.berkeley.edu's IP address). Now if a resolver were to query our nameserver for the address of baobab.cs.berkeley.edu, our nameserver could skip querying the root nameservers. Recognizing that berkeley.edu is the closest ancestor of baobab.cs.berkeley.edu that it knows about, our nameserver would start by querying a ftp.isc.org, in /isc/bind/src/8.4.7/bind-src.tar.gz and /isc/bind9/9.3.2/bind-9.3.2.tar.gz, respectively. Compiling these releases on most common Unix platforms is relatively straightforward. The ISC includes a list of Unix-ish operating systems that BIND is known to compile on in the file src/INSTALL (for BIND 8) and README (for BIND 9), including several versions of Linux, Unix, and even Windows. There's also a list of other Unix-ish and not-so-Unix-ish (MPE, anyone?) operating systems BIND has supported in the past, most recent versions of BIND will probably compile on these systems without much effort. Regardless of which category your operating system falls into, we strongly recommend reading all of the sections of the file that are relevant to your OS. In Appendix C, we also include instructions for compiling BIND 8.4.7 and 9.3.2 on Linux; it's a remarkably short appendix.ftp.isc.org example) to get you going.ftp.rs.internic.net), limited access (restricted by a security firewall), or no access at all. This chapter assumes you have complete access. We'll discuss the other cases in Chapter 11.movie.edu. A recent grant has enabled us to connect to the Internet.movie.edu. A recent grant has enabled us to connect to the Internet.127.0.0.1 localhost # These are our main machines 192.249.249.2 shrek.movie.edu shrek 192.249.249.3 toystory.movie.edu toystory toys 192.249.249.4 monsters-inc.movie.edu monsters-inc mi # These machines are in horror(ible) shape and will be replaced # soon. 192.253.253.2 misery.movie.edu misery 192.253.253.3 shining.movie.edu shining 192.253.253.4 carrie.movie.edu carrie # A wormhole is a fictitious phenomenon that instantly transports # space travelers over long distances and is not known to be # stable. The only difference between wormholes and routers is # that routers don't transport packets as instantly—especially # ours. 192.249.249.1 wormhole.movie.edu wormhole wh wh249 192.253.253.1 wormhole.movie.edu wormhole wh wh253
movie.edu, this file is called db.movie.edu. The files mapping addresses to hostnames are called db.ADDR, where ADDR is the network number without trailing zeros or the specification of a netmask. In our example, the files are called db.192.249.249 and db.192.253.253; there's one for each network. (The db is short for database.) We'll refer to the collection of db.DOMAIN and db.ADDR files as zone datafiles.
There are a few other zone datafiles: db.cache and db.127.0.0. These files are overhead. Each nameserver must have them, and they are more or less the same for each server.Titanic.movie.edu to your zone data, people looking up titanic.movie.edu will find the records, but with a capital "T" in the domain name./* This is a C-style comment */ // This is a C++-style comment # This is a shell-style comment
options {
directory "/var/named";
// Place additional options here.
};
zone "movie.edu" in {
type master;
file "db.movie.edu";
};
shrek.movie.edu's address in db.movie.edu like this:shrek.movie.edu. IN A 192.249.249.2
shrek IN A 192.249.249.2
2.249.249.192.in-addr.arpa. IN PTR shrek.movie.edu.
2 IN PTR shrek.movie.edu.
shrek.movie.edu IN A 192.249.249.2
shrek.movie.edu.movie.edu, not what you intended at all.
@ IN SOA toystory.movie.edu. al.movie.edu. (
1 ; Serial
3h ; Refresh after 3 hours
1h ; Retry after 1 hour
1w ; Expire after 1 week
1h ) ; Negative caching TTL of 1 hour
<name> <class> <type> <data> toystory IN A 192.249.249.3
ID4 IN A 192.249.249.10 postmanring2x IN A 192.249.249.11
fx-gateway IN A 192.249.249.12
<ASCII-characters>.<hostname-characters>
movie.edu. IN SOA toystory.movie.edu. key_grip.movie.edu. (
1 ; Serial
3h ; Refresh after 3 hours
1h ; Retry after 1 hour
1w ; Expire after 1 week
1h ) ; Negative caching TTL of 1 hour
% h2n -d movie.edu -s toystory -s shrek \ -n 192.249.249 -n 192.253.253 \ -u al.movie.edu
% named-checkconf
/etc/named.conf:14: zone '.': missing 'file' entry
toystory.movie.edu.
# /usr/sbin/named