全局转发
需要服务器:
主服务器:172.31.0.38
从服务器:172.31.0.48
转发服务器:172.31.0.17
first:先转发至指定DNS服务器,如果无法解析查询请求,则本服务器再去根服务器查询
only: 先转发至指定DNS服务器,如果无法解析查询请求,则本服务器将不再去根服务器查询
17服务器安装软件
[root@localhost ~]# yum install bind -y
改配置文件 only
[root@localhost ~]# vim /etc/named.conf
# 添加下面两条
options {
// listen-on port 53 { 127.0.0.1; };
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";
recursing-file "/var/named/data/named.recursing";
secroots-file "/var/named/data/named.secroots";
// allow-query { localhost; };
forward only;
forwarders {172.31.0.38;};