The BIND configuration file syntax changed significantly between Version 4 and Version 8. Mercifully, it didn't change at all between BIND 8 and BIND 9. We'll first show you the BIND 4 syntax, and then the equivalent BIND 8 and 9 syntax. You'll have to check the named [24] manual page to find out which you need to use. If you already have a BIND 4 configuration file, you can convert it to a BIND 8 or 9 configuration file by running the program named-bootconf, which is distributed with the BIND source code. In BIND 8, the program is in src/bin/named-bootconf. In BIND 9, it's in contrib/named-bootconf.
[24]named is pronounced "name-dee" and stands for "name server daemon." BIND is pronounced to rhyme with "kind." Some creative people have noticed the similarities in the names and choose to mispronounce them "bin-dee" and "named" (like "tamed").
; This is a comment
/* This is a C-style comment */ // This is a C++-style comment # This is a shell-style comment
Usually, configuration files contain a line indicating the directory in which the zone data files are located. The name server changes its directory to this location before reading the zone data files. This allows the filenames to be specified relative to the current directory instead of as full pathnames. Here's how a BIND 4 directory line looks:
directory /var/named
options { directory "/var/named"; // Place additional options here. };
TIP: Only one options statement is allowed in the configuration file, so any additional options mentioned later in this book must be added along with the directory option.
primary movie.edu db.movie.edu primary 249.249.192.in-addr.arpa db.192.249.249 primary 253.253.192.in-addr.arpa db.192.253.253 primary 0.0.127.in-addr.arpa db.127.0.0
zone "movie.edu" in { type master; file "db.movie"; };
Here is the BIND 4 configuration file line to read the root hints file:
cache . db.cache
[25]Actually, BIND 9 has a built-in hints zone, so you don't need to include a zone statement for the hints zone in named.conf. Including one doesn't hurt, though, and it gives us the willies not to see one in the configuration file, so we include one anyway.
zone "." in { type hint; file "db.cache"; };
By default, BIND 4 expects the configuration file to be named /etc/named.boot, but it can be changed with a command-line option. BIND 8 and 9 expect the configuration file to be named /etc/named.conf instead of /etc/named.boot. The zone data files for our example are in the directory /var/named. Which directory you use doesn't really matter. Just avoid putting the directory in the root filesystem if the root filesystem is short on space, and make sure that the filesystem the directory is in is mounted before the name server starts. Here is the complete BIND 4 /etc/named.boot file:
; BIND configuration file directory /var/named primary movie.edu db.movie.edu primary 249.249.192.in-addr.arpa db.192.249.249 primary 253.253.192.in-addr.arpa db.192.253.253 primary 0.0.127.in-addr.arpa db.127.0.0 cache . db.cache
// BIND configuration file options { directory "/var/named"; // Place additional options here. }; zone "movie.edu" in { type master; file "db.movie.edu"; }; zone "249.249.192.in-addr.arpa" in { type master; file "db.192.249.249"; }; zone "253.253.192.in-addr.arpa" in { type master; file "db.192.253.253"; }; zone "0.0.127.in-addr.arpa" in { type master; file "db.127.0.0"; }; zone "." in { type hint; file "db.cache"; };
Copyright © 2002 O'Reilly & Associates. All rights reserved.