CentOS 5.6 x86 64 下搭建DNS服务器

一、安装

# yum install -y bind bind-chroot ypbind bind-utils
# rpm -qa |grep bind
 bind-libs-9.3.6-16.P1.el5
 bind-utils-9.3.6-16.P1.el5
 ypbind-1.19-12.el5_6.1
 bind-9.3.6-16.P1.el5
 bind-chroot-9.3.6-16.P1.el5
# yum install -y caching-nameserver-9.3.*   //安装后可启动named
# service named start
# netstat -antup         //TCP 53\953端口开放,953提供给rndc工具用来管理DNS服务器

二、

  1.主区域配置

# cd /var/named/chroot/etc     //以下操作均在此路径下
# cp -p named.caching-nameserver.conf named.conf   //注意加 -p 所属组不变
# cp -p named.rfc1912.zones named.rfc1912.zones_back
# vim named.conf
### 配置内容如下:
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";
};

### 结束 ###

# vim named.rfc1912.zones
### 配置内容如下:
zone "." IN {
        type hint;
        file "named.ca";
};

相关推荐