RHEL6上配置DNS服务以及主从复制

Site出现一个critical issue,内网DNS宕机了。想起来还没在RHEL6上配置过,今天测试了一下,发现与在RHEL5上配置略有不同。

一.配置单节点DNS
1)安装bind软件包
yum -y install bind-*
RHEL6中没有caching-namedserver这个包了,配置文件遵守默认的系统规范,放在了/etc里

2)cd /etc
cp -p named.conf named.conf.`date +%Y%m%d`

3)配置DNS主配置文件,named.conf
cat named.conf
options {
        listen-on port 53 { 192.168.0.254; };
        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";
        allow-query     { 192.168.0.0/24; };
};
zone "." IN {
        type hint;
        file "named.ca";
};
zone "sys.com" IN {
        type master;
        file "sys.com.zone";
};
zone "0.168.192.in-addr.arpa" IN {
        type master;
        file "0.168.192.in-addr.arpa.zone";
};

4)配置正向解析域zone文件
cd /var/named/
cp -p localhost.zone sys.com.zonevim sys.com.zone
$TTL    86400
@               IN SOA  sys.com  root.sys.com (
                                        2009040500      ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum
@               IN NS           sys.com.
                IN A            192.168.0.254
ldap            IN A            192.168.0.254
server          IN A            192.168.0.254
stu1            IN A            192.168.0.2

5)配置反向解析zone文件
在配置反向解析时候也要加入A记录, 这个在RHEL5中配置DNS时候不是必须的。
cd /var/named/
cp -p sys.com.zone 0.168.192.in-addr.arpa.zone
vi 0.168.192.in-addr.arpa.zone
$TTL    86400
@               IN SOA  sys.com.  root.sys.com (
                                        2009040500      ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum
@               IN NS           sys.com.
                IN A            127.0.0.1
254             IN PTR          ldap.sys.com.
254             IN PTR          server.sys.com.
2               IN PTR          stu1.sys.com.

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/2a7e2c5aea33d5e47a32beaa6ae70c43.html