辅助DNS服务器部署文档(for linux平台)
一.配置yum,以便安装软件包
   yum全局文件编辑目录:  /etc/yum.repos.d/rhel-source.repo
[root@localhost ~]# vim //etc/yum.repos.d/rhel-source.repo
#[rhel-source]
#name=Red Hat Enterprise Linux $releasever - $basearch - Source
#baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/SRPMS/
#enabled=0
#gpgcheck=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

 

#[rhel-source-beta]
#name=Red Hat Enterprise Linux $releasever Beta - $basearch - Source
#baseurl=ftp://ftp.redhat.com/pub/redhat/linux/beta/$releasever/en/os/SRPMS/
#enabled=0
#gpgcheck=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[wanghong]
Name=123
Baseurl=file:///mnt/Server
enable=1
gpgcheck=0
备注: #是注释作用,在此对文件没用任何影响,可以去掉
二.安装DNS服务软件包
1.DNS服务软件包名如下:
   bind-9.3.3-7.el5.i386.rpm
   bind-chroot-9.3.3-7.el5.i386.rpm
[root@localhost ~]# mount /dev/cdrom  /mnt
[root@localhost ~]# yum install bind  bind-chroot
执行此过程,就可以正常的安装DNS服务包软件,或者用以下命令也可以正常安装DNS服务包软件
[root@localhost ~]# mount /dev/cdrom  /mnt
[root@localhost ~]# rpm -ivh bind-9.3.3-7.el5.i386.rpm  --force
[root@localhost ~]# rpm -ivh bind-chroot-9.3.3-7.el5.i386.rpm  --force
--foce 代表强制安装

 

2.编辑全局配置文件named.conf
如果目录/etc或/var/named/chroot/var/etc/named.conf没有named.conf文件,需要在目录底下创建named.conf文件(目录/var/named/chr    oot/etc/)
[root@localhost ~]# touch  /var/named/chroot/etc/named.conf
[root@localhost ~]# vim /var/named/chroot/etc/named.conf
    
options {
        directory       "/var/named";
};

 

zone "test.com" IN {
        type slave;
        masters { 192.168.2.1; };
        file "slaves/tets.com.zone";
};

 


zone "2.168.192.in-addr.arpa" IN {
       type  slave;
       masters { 192.168.2.1; };
       file "slaves/192.168.2.arpa";
};
3.编辑配置文件named.rfc1912.zones
如果目录/etc或/var/named/chroot/var/etc/named.rfc1912.zones没有named.rfc1912.zones文件,需要在目录底下创建named.rfc1912.zones文件(目录/var/named/chroot/etc/)
[root@localhost ~]# touch /var/named/chroot/etc/named.rfc1912.zones
[root@localhost ~]# vim /var/named/chroot/etc/named.rfc1912.zones
        type master;
        file "named.localhost";
        allow-update { none; };
};

 

zone "localhost" IN {
        type master;
        file "named.localhost";
        allow-update { none; };
};

 

zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {
        type master;
        file "named.loopback";
        allow-update { none; };
};

 

zone "1.0.0.127.in-addr.arpa" IN {
        type master;
        file "named.loopback";
        allow-update { none; };
};

 

zone "0.in-addr.arpa" IN {
        type master;
        file "named.empty";
        allow-update { none; };
};

 

 

 

zone "test.com" IN {
        type slave;
        masters { 192.168.2.1; };
        file "slaves/tets.com.zone";
};

 


zone "2.168.192.in-addr.arpa" IN {
       type  slave;
       masters { 192.168.2.1; };
       file "slaves/192.168.2.arpa";
};
4.确定关闭防火墙或清空防火墙,重启named服务
关闭防火墙服务
[root@localhost ~]# service iptables stop
[root@localhost ~]# chkconfig iptables off
或者执行清空防火墙命令
[root@localhost ~]# iptables -F
[root@localhost ~]# service iptables save
开起named服务
[root@localhost ~]# service named start
[root@localhost ~]# chkconfig named on

 

三.测试辅助DNS服务
1.配置客户端DNS地址192.168.2.*(这里地址为辅助DNS服务地址192.168.2.5)
 使用nslookup命令,解析www.test.com /ftp.test.com/mail.test.com /aa.test.com
2.给客户端配置主DNS和辅DNS192.168.2.*(这里主DNS地址为192.168.2.1,辅DNS地址为192.168.2.5), 再用nslookup命令,解析www.test.com /ftp.test.com  /              mail.test.com  /  aa.test.com