bind条件转发器

蒜香大龙虾 2024-08-07 23:25:10
Categories: Tags:

环境

linux1作为dns主服务器
linux2作为条件转发服务器
linux3作为全局转发服务器

自行在linux2创建chinaskills.com域名解析

bind条件转发器

区域转发

linux1编辑/etc/named.rfc1912.zones

1
2
3
4
zone "chinaskills.com" IN {
type forward;
forwarders { 172.20.20.12; };
};

这里会把chinskills.com的域名解析转发给172.20.20.12解析,需要对方能够解析

结果be like:

1
2
3
4
5
6
7
8
[root@linux1 ~]# nslookup homo.chinaskills.com
Server: 172.20.20.11
Address: 172.20.20.11#53

Non-authoritative answer:
Name: homo.chinaskills.com
Address: 114.51.41.91

全局转发

编辑/etc/named.conf

例如把linux3所有的dns查询转发到172.20.20.11

1
2
3
4
5
6
7
8
options {
...
dnssec-validation no; # 改一下no
...
forwarders {
172.20.20.11;
};
};

测试:

1
2
3
4
5
6
7
[root@linux3 ~]# nslookup linux1.skills.com 127.0.0.1
Server: 127.0.0.1
Address: 127.0.0.1#53

Non-authoritative answer:
Name: linux1.skills.com
Address: 172.20.20.11