环境 CENTOS 6.7
Bind BIND 9.8.2
一 安装bind
#yum install bind
#chkconfig named on //设置开机启动
二 配置DNS CACHE
# vim /etc/named.comf
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; };
recursion yes;
forward only;
forwarders {
114.114.114.114;
223.5.5.5;
202.96.209.5;
};
dnssec-enable yes;
dnssec-validation yes;
};
三 测试
[root@localhost etc]# nslookup
> server 188.188.33.35
Default server: 188.188.33.35
Address: 188.188.33.35#53
>
Server: 188.188.33.35
Address: 188.188.33.35#53
Non-authoritative answer:
canonical name =
Name:
Address: 115.239.210.27
Name:
Address: 115.239.211.112
四 设置强制cache, TTL决定了CACHE的时间,但有些没有过期,我们希望可以刷新可以用下面的命令
# rndc flush
另外也可以设置crontab,没隔一段时间来刷新:
crontab -e
01 01 01 * * rndc flush
阅读(1484) | 评论(0) | 转发(0) |