1. download bind-9.2.2.tar.gz(ftp://ftp.isc.org)
2. groupadd -g 200 named
useradd -m -g named -u 200 -s /bin/false named
cd /home/named
mkdir -p dev etc/namedb/slave var/run
mknod /home/named/dev/null c 1 3
mknod /home/named/dev/random c 1 8
chmod 666 /home/named/dev/{null,random}
mkdir /home/named/etc/namedb/pz
cp /etc/localtime /home/named/etc
3. 安装bind
tar -zxvf bind-9.2.2.tar.gz
cd bind-9.2.2
./configure --prefix=/usr --sysconfdir=/etc
make
make install
4. create: vi /etc/named.conf
options {
directory "/etc/namedb";
pid-file "/var/run/named.pid";
statistics-file "/var/run/named.stats";
};
zone "." {
type hint;
file "root.hints";
};
zone "0.0.127.in-addr.arpa" {
type master;
file "pz/127.0.0";
};
5. create 127.0.0: vi /home/named/etc/namedb/pz/127.0.0
$TTL 3D
@ IN SOA ns.local.domain. hostmaster.local.domain. (
1 ; Serial
8H ; Refresh
2H ; Retry
4W ; Expire
1D) ; Minimum TTL
NS ns.local.domain.
1 PTR localhost.
6. 创建 root.hints 文件: vi /home/named/etc/namedb/root.hints
. 6D IN NS A.ROOT-SERVERS.NET.
. 6D IN NS B.ROOT-SERVERS.NET.
. 6D IN NS C.ROOT-SERVERS.NET.
. 6D IN NS D.ROOT-SERVERS.NET.
. 6D IN NS E.ROOT-SERVERS.NET.
. 6D IN NS F.ROOT-SERVERS.NET.
. 6D IN NS G.ROOT-SERVERS.NET.
. 6D IN NS H.ROOT-SERVERS.NET.
. 6D IN NS I.ROOT-SERVERS.NET.
. 6D IN NS J.ROOT-SERVERS.NET.
. 6D IN NS K.ROOT-SERVERS.NET.
. 6D IN NS L.ROOT-SERVERS.NET.
. 6D IN NS M.ROOT-SERVERS.NET.
A.ROOT-SERVERS.NET. 6D IN A 198.41.0.4
B.ROOT-SERVERS.NET. 6D IN A 128.9.0.107
C.ROOT-SERVERS.NET. 6D IN A 192.33.4.12
D.ROOT-SERVERS.NET. 6D IN A 128.8.10.90
E.ROOT-SERVERS.NET. 6D IN A 192.203.230.10
F.ROOT-SERVERS.NET. 6D IN A 192.5.5.241
G.ROOT-SERVERS.NET. 6D IN A 192.112.36.4
H.ROOT-SERVERS.NET. 6D IN A 128.63.2.53
I.ROOT-SERVERS.NET. 6D IN A 192.36.148.17
J.ROOT-SERVERS.NET. 6D IN A 192.58.128.30
K.ROOT-SERVERS.NET. 6D IN A 193.0.14.129
L.ROOT-SERVERS.NET. 6D IN A 198.32.64.12
M.ROOT-SERVERS.NET. 6D IN A 202.12.27.33
(必须注意:这个文件中行首不能有空格。)
用下面的命令创建或修改 resolv.conf,以使用新的名称服务器:
注: 把 yourdomain.com 换成你自己的正确域名。
cp /etc/resolv.conf /etc/resolv.conf.bak