采用光盘安装方式:
[root@localhost ~]# mkdir -p /media/cdrom/
[root@localhost ~]# mount /dev/cdrom /media/cdrom/
[root@localhost ~]# rpm -ivh /media/cdrom/CentOS/bind-9.3.6-16.P1.el5.i386.rpm
[root@localhost ~]# rpm -ivh /media/cdrom/CentOS/bind-utils-9.3.6-16.P1.el5.i386.rpm
[root@localhost ~]# rpm -ivh /media/cdrom/CentOS/bind-chroot-9.3.6-16.P1.el5.i386.rpm
[root@localhost~]#rpm –ivh /media/cdrom/CentOS/caching-">nameserver-9.3.6-16.P1.el5.i386.rpm
安装完成后修改主文件
在修改主文件之前要对主文件进行复制(备份)
DNS域名服务的主配置文件位于 /var/named/chroot/etc/ 下,默认只提供了模板,只需复制就行了[root@localhost ~]# cd /var/named/chroot/etc/
[root@localhost etc]# cp -p named.caching-nameserver.conf named.conf
//cp –p 参数指的是全属性复制备份
修改主文件
[root@localhost etc]# vi named.conf
打开主文件如下:
//
// named.caching-nameserver.conf
//
// Provided by Red Hat caching-nameserver package to configure the
// ISC BIND named(8) DNS server as a caching only nameserver
// (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// DO NOT EDIT THIS FILE - use system-config-bind or an editor
// to create named.conf - edits to this file will be lost on
// caching-nameserver package upgrade.
//
options {
listen-on port 53 { any; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
// Those options should be used carefully because they disable port
// randomization
// query-source port 53;
// query-source-v6 port 53;
allow-query { any; };
allow-query-cache { any; };
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
view localhost_resolver {
match-clients { any; };
match-destinations { any; };
recursion yes;
include "/etc/named.rfc1912.zones";
};
修改上面文件,将loaclhost处修改为any(即修改为文中的红字部分)