我示範的版本是 CentOS 5,當然也適用於 RHLE 5
安裝這些套件 bind,bind-chroot,bind-utils,system-config-bind
# yum -y install bind bind-chroot bind-utils system-config-bind
拷貝 named.conf 示範檔到 /var/named/chroot/etc/
# cp /usr/share/system-config-bind/profiles/default/named.conf /var/named/chroot/etc/
編輯一下 named.conf
# vi /var/named/chroot/etc/named.conf
options {
directory "/var/named"
dump-file "/var/named/data/cache_dump.db"
statistics-file "/var/named/data/named_stats.txt"
forwarders { 168.95.1.1; 139.175.10.20; };
allow-query { any; };
};
zone "." IN {
type hint;
file "named.root"
};
zone "localdomain." IN {
type master;
file "localdomain.zone"
allow-update { none; };
};
zone "localhost." IN {
type master;
file "localhost.zone"
allow-update { none; };
};
zone "0.0.127.in-addr.arpa." IN {
type master;
file "named.local"
allow-update { none; };
};
zone "yourdomain.tw" IN {
type master;
file "yourdomain.tw.zone"
allow-update { none; };
};
include "/etc/rndc.key"
拷貝 localdomain.zone,localhost.zone,named.local,這些預設檔案到 /var/named/chroot/var/named/
# cd /usr/share/system-config-bind/profiles/default/named
# cp localdomain.zone localhost.zone named.local /var/named/chroot/var/named/
拷貝 named.root 這個重要檔案到 /var/named/chroot/var/named/
# cp /usr/share/doc/bind-9.3.3/sample/var/named/named.root /var/named/chroot/var/named/
再來就設定自已網域設定檔
# cd /var/named/chroot/var/named
# vi yourdomain.tw.zone