Next Previous Contents

7. Bind version 8

Bind version 8 是最新的 bind 技术.我还没有尝试使用,但 David E. Smith < dave@bureau42.ml.org> 有.他写了这小节的其馀部份.

没有太多的不同.除了使用 named.conf 而不是 named.boot, 其馀都相同. 而且 bind 8 包含了一个 perl 指令稿来将旧格式的档案转换成新的. 例如一份暂存专用名称伺服器的 named.boot (旧格式):


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

在指令列下,於 bind8/src/bin/named 目录中键入:


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

这会产生 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";
};

它将 named.boot 中的每样东西都转换过来,然而它并未加入所有 bind 8 所允许的新强化及配置选项. 这里有份较完整的 named.conf 做同样的事,但是效率更好一点.


// 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 里有这个□例,以及领域档案的拷贝,许多人可以直接拿来修改使用.

领域档案及 root.hint (root.cache) 完全相同,更新它们的指令也是.


Next Previous Contents