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