标签:info config red about ddc ogg 指定 重要 blog
(一)简述(2)如果不能使用本地数据解析查询,此时它作为客户端,会将查询转发给外网DNS服务器;
(3)本地DNS(转发器)收到客户端的请求后会等待一段很短的时间,等待来自外网DNS的应答;
(4)对于外网DNS来说,它接收到的查询请求是递归查询,此时,它自己需要向外层层迭代找到最终答案返回给转发器(此时转发器作为DNS客户端)
(5)转发器将外网DNS返回的查询结果送到客户端(非权威答案),完成解析过程。
三,转发的类型
(1)全局转发:针对凡本地没有通过zone定义的区域查询请求,全部转给某转发器
options {
forwarders { ip; }; #指明转发器是谁
forward only|first; #only表示仅转发 ;first表示先进行转发,如果没查询到结果,那么它自己还会根据根提示向外迭代查询
};
(2)局部转发:仅转发对某特定区域的解析请求
options {
forwarders { ip; }; #指明转发器是谁
forward only|first; #only表示仅转发 ;first表示先进行转发,如果没查询到结果,那么它自己还会根据根提示向外迭代查询
};
(二)具体的配置
1,全局转发配置
[root@DNS-Slave chroot]# vim etc/named.conf
/*
Sample named.conf BIND DNS server ‘named‘ configuration file
for the Red Hat BIND distribution.
See the BIND Administrator‘s Reference Manual (ARM) for details about the
configuration located in /usr/share/doc/bind-{version}/Bv9ARM.html
*/
options
{
directory "/var/named"; // "Working" directory
dump-file "data/cache_dump.db";
statistics-file "data/named_stats.txt";
memstatistics-file "data/named_mem_stats.txt";
listen-on port 53 { any; };
listen-on-v6 port 53 { any; };
allow-query { any; };
recursion yes;
forward first; #本机不能解析的转发给202.96.209.5做解析#first:首先转发;转发器不响应时,自行去迭代查询;only:只转发;
forwarders {
202.96.209.5;
210.22.84.3;
202.96.209.133;
223.5.5.5;
# 114.114.114.114;
# 8.8.8.8;
};
dnssec-enable yes;
dnssec-validation yes;
pid-file "/run/named/named.pid";
session-keyfile "/run/named/session.key";
managed-keys-directory "/var/named/dynamic";
};
logging
{
channel default_debug {
file "data/named.run";
severity dynamic;
};
channel gsquery {
file "data/query.log" versions 3 size 20m;
severity info;
print-time yes;
print-category yes;
print-severity yes;
};
category queries { gsquery; };
};
}
2,局部转发
[root@DNS-Slave chroot]#vim /etc/named.rfc1912.zones
zone "google.com.hk" IN {
type forward;
forward only;
forwarders {8.8.8.8;};
};
3,检查语法并重启服务
[root@DNS-Slave chroot]# named-checkconf /var/named/chroot/etc/named.conf
[root@DNS-Slave chroot]# systemctl restart named-chroot
[root@DNS-Slave chroot]#
标签:info config red about ddc ogg 指定 重要 blog
原文地址:http://blog.51cto.com/liqingbiao/2130920