rhel6缓存dns配置小结

安装bind软件包:

yum install bind bind-utils bind-chroot


编辑配置文件:

tips

1. 配置文件的所属组必须为named

2. 如果只是简单的配置缓存dns,最好注掉绿色部分,没注掉时当forwarders指向我自己配置的dns服务器或者8.8.8.8时总是无法解析(指向202.96.209.133又可以解析),不太明白

3. service named restart后,注意坚持/var/log/message看看有没有报错

4. 测试时注意修改/etc/resolv.conf的nameserver地址


vim /etc/named.conf


//
// named.conf
//
// Provided by Red Hat bind 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.
//

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";
allow-query { any; };
forward only;
forwarders { 192.168.17.253; };

#forwarders { 202.96.209.133; };

recursion yes;

# dnssec-enable yes;
# dnssec-validation yes;
# dnssec-lookaside auto;


/* Path to ISC DLV key */
# bindkeys-file "/etc/named.iscdlv.key";
};

logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};

zone "." IN {
type hint;
file "named.ca";
};

include "/etc/named.rfc1912.zones";


REF:http://linux.vbird.org/linux_server/0350dns.php

你可能感兴趣的:(rhel6缓存dns配置小结)