RHEL5――从DNS服务器的搭建

RHEL5――从DNS服务器的搭建

本文接上一篇主DNS服务器的搭建 http://ssxiaoguai.blog.51cto.com/5376644/1436057

1)设置IP地址

[root@DNS_2~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
#Intel Corporation 82545EM Gigabit Ethernet Controller (Copper)
DEVICE=eth0
BOOTPROTO=none
HWADDR=00:0C:29:22:36:43
ONBOOT=yes
IPADDR=192.168.1.253
NETMASK=255.255.255.0


2)安装软件包

[root@DNS_2 ~]# yum -y install bindbind-chroot caching-nameserver

3)修改从DNS的配置文件

[root@DNS_2 ~]# cd /var/named/chroot/etc/
localtime named.caching-nameserver.conf named.rfc1912.zones  rndc.key
[root@DNS_2 etc]# cp -pnamed.caching-nameserver.conf named.conf
[root@DNS_2 etc]# vim named.conf
options {
        listen-on port 53{ any; };
//      listen-on-v6 port53 { ::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 optionsshould be used carefully because they disable port
        // randomization
        //query-source    port 53;    
        // query-source-v6port 53;
        allow-query     { any; };
        allow-query-cache{ any; };
};
logging {
        channeldefault_debug {
                file"data/named.run";
                severity dynamic;
        };
};
view localhost_resolver {
        match-clients      { any; };
        match-destinations{ any; };
        recursion yes;
        include"/etc/named.rfc1912.zones";
};
[root@DNS_2etc]# vim named.rfc1912.zones
zone "ssxiaoguai.com" IN {
        type slave;
        file"slave/ssxiaoguai.zone";
        masters{192.168.1.254;};
};
zone "1.168.192.in-addr.arpa" IN {
        type slave;
        file"slaves/ssxiaoguai.arpa";
        masters{192.168.1.254;};
};


4)检测配置文件语法

[root@DNS_2 etc]# named-checkconfnamed.conf
[root@DNS_2 etc]# named-checkconfnamed.rfc1912.zones


5)修改主DNS配置文件

[root@DNS_1 ~]# vim/var/named/chroot/etc/named.conf
allow-transfer { 192.168.10.101; };

6)分别重启主从服务器的服务。

[root@DNS_1 ~]# service named restart
停止 named:.                                              [确定]
启动 named:                                               [确定]
[root@DNS_2 etc]# service named restart
停止 named:                                               [确定]
启动 named:                                               [确定]
[root@DNS_2 etc]# chkconfig named on

7)测试


成功同步主服务器数据库文件,并能够正常解析。

wKiom1PIsb2jlrUcAACQEvpNNhc061.jpg


你可能感兴趣的:(服务器,IP地址,DNS服务器)