1.使用光碟片內建的軟體包,安裝以下包:
bind
bind-utils
bind-libs
(rpm -i xxx.rpm)
2.
將named服務設定為自啟動
(使用ntsysv,chkconfig等工具)
3.
假設你需要解析bcomcn.com,如下操作:
cd /var/named
cp localdomain.zone bcomcn.zone
vi bcomcn.zone
$TTL 86400
@ IN SOA ns.bcomcn.com. root.bcomcn.com. (
200612230 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS ns.bcomcn.com.
IN MX 10 mail.bcomcn.com.
ns.bcomcn.com. IN A 192.168.1.5
mail.bcomcn.com. IN A 192.168.1.5
www.bcomcn.com. IN A 192.168.1.5
注意,主機名稱後面帶"點"的,表示是一個完整主機,不帶點的,表示還要加上當前網域名稱,比如:mail.bcomcn.com. = mail
cp localdomain.zone 192.zone
vi 192.zone
$TTL 86400
@ IN SOA localhost. root.bcomcn.com. (
200612230 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS localhost.
5 IN PTR www.bcomcn.com.
4.修改/etc/named.conf,加入:
zone "bcomcn.com" IN {
type master;
file "bcomcn.zone";
allow-update { none; };
};
zone "1.168.192.in-addr.arpa" IN {
type master;
file "192.zone";
allow-update { none; };
};
啟動named,將原生DNS伺服器設定為本機,用nslookup,或其它工具檢測:
nslookup
> set type=mx
> bcomcn.com
(可以查看/var/log/message檢查named是否正確啟動,是否載入某個Domain的解析.)