一。首先从http://www.isc.org/index.pl?/sw/bind/index.php 下载最新的bind 9.4.2版本 。
然后解包安装很简单的./configure --sysconfdir=/etc
make && make install && make clean
二。配置DNS
首先编辑/etc/named.conf
输入一下的内容options {
directory "/var/named";
};
zone "." {
type hint;
file "named.ca";
};
保存退出,因为现在没有named.ca所以我们要自己建立一个
建立办法是cd /var/named/;dig -t NS . >/var/named/named.ca
; <<>> DiG 9.4.2 <<>> -t NS .
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2616
;; flags: qr rd ra; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 13
;; QUESTION SECTION:
;. IN NS
;; ANSWER SECTION:
. 518179 IN NS H.ROOT-SERVERS.NET.
. 518179 IN NS M.ROOT-SERVERS.NET.
. 518179 IN NS F.ROOT-SERVERS.NET.
. 518179 IN NS D.ROOT-SERVERS.NET.
. 518179 IN NS E.ROOT-SERVERS.NET.
. 518179 IN NS I.ROOT-SERVERS.NET.
. 518179 IN NS J.ROOT-SERVERS.NET.
. 518179 IN NS G.ROOT-SERVERS.NET.
. 518179 IN NS B.ROOT-SERVERS.NET.
. 518179 IN NS K.ROOT-SERVERS.NET.
. 518179 IN NS A.ROOT-SERVERS.NET.
. 518179 IN NS C.ROOT-SERVERS.NET.
. 518179 IN NS L.ROOT-SERVERS.NET.
;; ADDITIONAL SECTION:
I.ROOT-SERVERS.NET. 604579 IN A 192.36.148.17
J.ROOT-SERVERS.NET. 604579 IN A 192.58.128.30
K.ROOT-SERVERS.NET. 604579 IN A 193.0.14.129
L.ROOT-SERVERS.NET. 604579 IN A 199.7.83.42
M.ROOT-SERVERS.NET. 604579 IN A 202.12.27.33
A.ROOT-SERVERS.NET. 604579 IN A 198.41.0.4
B.ROOT-SERVERS.NET. 604579 IN A 192.228.79.201
C.ROOT-SERVERS.NET. 604579 IN A 192.33.4.12
D.ROOT-SERVERS.NET. 604579 IN A 128.8.10.90
E.ROOT-SERVERS.NET. 604579 IN A 192.203.230.10
F.ROOT-SERVERS.NET. 604579 IN A 192.5.5.241
G.ROOT-SERVERS.NET. 604579 IN A 192.112.36.4
H.ROOT-SERVERS.NET. 604579 IN A 128.63.2.53
;; Query time: 128 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Jan 18 19:38:01 2008
;; MSG SIZE rcvd: 436
编辑/etc/resolv.conf
search localdomain
nameserver 127.0.0.1
替换成自己的IP地址,然后启动named这个时候就可以查询互联网上的任何一台主机了。
三。启动rndc
#rndc-confgen > /etc/rndc.conf
#tail #13 /etc/rndc.conf >> /etc/named.conf
然后启动named
#tail /var/log/messages查看进程运行状态
然后把/etc/named.conf中的rndc.conf中的#都去掉就可以了