Previous Next Contents

7. Converting from version 4 to version 8

This was originally a section on using bind 8 written by David E. Smith (dave@bureau42.ml.org). I have edited it some to fit the new section name.

There's not much to it. Except for using named.conf instead of named.conf, everything is identical. And bind8 comes with a perl script that converts old-style files to new. Example named.conf (old style) for a cache-only name server:


directory /var/named
cache   .                                       root.hint
primary 0.0.127.IN-ADDR.ARPA                    127.0.0.zone
primary localhost                               localhost.zone          

On the command line, in the bind8/src/bin/named directory (this assumes you got a source distribution. If you got a binary package the script is probably around, I'm not sure where it would be though. -ed.), type:


./named-bootconf.pl < named.conf > named.conf

Which creates named.conf:


// generated by named-bootconf.pl

options {
        directory "/var/named";
};

zone "." {
        type hint;
        file "root.hint";
};

zone "0.0.127.IN-ADDR.ARPA" {
        type master;
        file "127.0.0.zone";
};

zone "localhost" {
        type master;
        file "localhost.zone";
};

It works for everything that can go into a named.conf file, although it doesn't add all of the new enhancements and configuration options that bind8 allows. Here's a more complete named.conf that does the same things, but a little more efficiently.


// This is a configuration file for named (from BIND 8.1 or later).
// It would normally be installed as /etc/named.conf.
// The only change made from the `stock' named.conf (aside from this
// comment :) is that the directory line was uncommented, since I
// already had the zone files in /var/named.

options {
        directory "/var/named";
        check-names master warn;                /* default. */
        datasize 20M;
};

zone "localhost" IN {
        type master;
        file "localhost.zone";
        check-names fail;
        allow-update { none; };
        allow-transfer { any; };
};

zone "0.0.127.in-addr.arpa" IN {
        type master;
        file "127.0.0.zone";
        check-names fail;
        allow-update { none; };
        allow-transfer { any; };
};

zone "." IN {
        type hint;
        file "root.hint";
};

bind8/src/bin/named/test has this, and copies of the zone files, that many people can just drop in and use instantly.

The formats for zone files and root.hint (root.hints) files are identical, as are the commands for updating them.


Previous Next Contents