本次安装以RHEL 5光盘自带的BIND包以RPM方式安装.
[root@localhost ~]# rpm -qa|grep bind //查看当前已安装的bind所需要的包
bind-utils-9.3.3 -10.el5 //表明安装的是bind-9.3.3-10
kdebindings-3.5.4 -1.fc6
ypbind-1.19-8.el5
bind-libs-9.3.3 -10.el5
[root@localhost ~]# mkdir /mnt/cdrom //创建用来挂载光盘的目录
[root@localhost ~]# mount /dev/cdrom /mnt/cdrom/ //将光盘挂载到/mnt/cdrom/
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@localhost ~]# cd /mnt/cdrom/Server/ //切换目录到/mnt/cdrom/Server/
[root@localhost Server]# ls -l bind* //查看该目录下以bind开头的所有文件
-rw-r--r-- 113 root root 977426 2007-08-14 bind-9.3.3 -10.el5.i386.rpm
-rw-r--r-- 109 root root 39879 2007-08-14 bind-chroot-9.3.3 -10.el5.i386.rpm
-rw-r--r-- 124 root root 2679780 2007-08-14 bind-devel-9.3.3 -10.el5.i386.rpm
-rw-r--r-- 125 root root 449579 2007-08-14 bind-libbind-devel-9.3.3 -10.el5.i386.rpm
-rw-r--r-- 133 root root 857545 2007-08-14 bind-libs-9.3.3 -10.el5.i386.rpm
-rw-r--r-- 109 root root 227173 2007-08-14 bind-sdb-9.3.3 -10.el5.i386.rpm
-rw-r--r-- 113 root root 166398 2007-08-14 bind-utils-9.3.3 -10.el5.i386.rpm
[root@localhost Server]# rpm -ivh bind-chroot-9.3.3 -10.el5.i386.rpm 用rpm工具安装包
warning: bind-chroot-9.3.3 -10.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
error: Failed dependencies:
bind = 30:9.3.3 -10.el5 is needed by bind-chroot-9.3.3-10.el5.i386
[root@localhost Server]# rpm -ivh bind-9.3.3 -10.el5.i386.rpm
warning: bind-9.3.3 -10.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:bind ########################################### [100%]
[root@localhost Server]# rpm -ivh bind-chroot-9.3.3 -10.el5.i386.rpm
warning: bind-chroot-9.3.3 -10.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:bind-chroot ########################################### [100%]
Locating /var/named/chroot//etc/named.conf failed:
[失败]
[root@localhost Server]# rpm -ivh bind-devel-9.3.3 -10.el5.i386.rpm
warning: bind-devel-9.3.3 -10.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:bind-devel ########################################### [100%]
[root@localhost Server]# rpm -ivh bind-libbind-devel-9.3.3 -10.el5.i386.rpm
warning: bind-libbind-devel-9.3.3 -10.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:bind-libbind-devel ########################################### [100%]
[root@localhost Server]# rpm -ivh bind-libs-9.3.3 -10.el5.i386.rpm
warning: bind-libs-9.3.3 -10.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
package bind-libs-9.3.3 -10.el5 is already installed
[root@localhost Server]# rpm -ivh bind-chroot-9.3.3 -10.el5.i386.rpm
warning: bind-chroot-9.3.3 -10.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
package bind-chroot-9.3.3 -10.el5 is already installed
[root@localhost Server]# rpm -ivh bind-sdb-9.3.3 -10.el5.i386.rpm
warning: bind-sdb-9.3.3 -10.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
error: Failed dependencies:
libpq.so.4 is needed by bind-sdb-9.3.3 -10.el5.i386
[root@localhost Server]# rpm -qa|grep bind
bind-chroot-9.3.3 -10.el5
bind-utils-9.3.3 -10.el5
kdebindings-3.5.4 -1.fc6
bind-libbind-devel-9.3.3 -10.el5
bind-9.3.3 -10.el5
ypbind-1.19-8.el5
bind-libs-9.3.3 -10.el5
bind-devel-9.3.3 -10.el5
[root@localhost Server]# rpm -ivh cach //按下Tab键补余
cachefilesd-0.8-2.el5.i386.rpm
caching-nameserver-9.3.3 -10.el5.i386.rpm
[root@localhost Server]# rpm -ivh caching-nameserver-9.3.3 -10.el5.i386.rpm
// 这是最重要的一个包,和RHEL 4不同之处就在这里,这个包在RHEL 5中BIND服务是必须的。
warning: caching-nameserver-9.3.3 -10.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:caching-nameserver ########################################### [100%]
[root@localhost Server]# rpm -qa|grep bind
bind-chroot-9.3.3 -10.el5
bind-utils-9.3.3 -10.el5
kdebindings-3.5.4 -1.fc6
bind-libbind-devel-9.3.3 -10.el5
bind-9.3.3 -10.el5
ypbind-1.19-8.el5
bind-libs-9.3.3 -10.el5
bind-devel-9.3.3 -10.el5
[root@localhost Server]# cd /var/named/chroot/etc/ //查看是否安装正确正确情况是包括以下文件的:
/var/named/chroot/etc/下面有
named.caching-nameserver.conf
named.rfc1912.zones
/var/named/chroot/var/named/下面有
localdomain.zone
localhost.zone
named.ca
named.local
[root@localhost etc]# ls -l
总计 32
-rw-r--r-- 1 root root 405 12-14 20:06 localtime
-rw-r----- 1 root named 1100 2007-07-19 named.caching-nameserver.conf
-rw-r----- 1 root named 955 2007-07-19 named.rfc1912.zones
-rw-r--r-- 1 root named 113 12-14 20:07 rndc.key
[root@localhost etc]# cd /var/named/chroot/var/named/
[root@localhost named]# ls -l
总计 72
drwxrwx--- 2 named named 4096 2004-08-26 data
-rw-r----- 1 root named 198 2007-07-19 localdomain.zone
-rw-r----- 1 root named 195 2007-07-19 localhost.zone
-rw-r----- 1 root named 427 2007-07-19 named.broadcast
-rw-r----- 1 root named 2518 2007-07-19 named.ca
-rw-r----- 1 root named 424 2007-07-19 named.ip6.local
-rw-r----- 1 root named 426 2007-07-19 named.local
-rw-r----- 1 root named 427 2007-07-19 named.zero
drwxrwx--- 2 named named 4096 2004-07-27 slaves
[root@localhost named]# cd ..
[root@localhost var]# cd ..
[root@localhost chroot]# cd etc/
[root@localhost etc]# cp -b named.caching-nameserver.conf named.caching-nameserver.conf.bak
[root@localhost etc]# cp -b named.rfc1912.zones named.rfc1912.zones.bak
//上面这两行是备份文件,以免不小心把文件破坏