二、特殊DNS解析

一、DNS轮询

1.为站点 www.tedu.cn 提供DNS轮询解析,三台Web服务器节点的IP地址分别为: 192.168.4.10、192.168.4.20、192.168,4.30

步骤:

虚拟机A:
[root@svr7 ~]# vim /var/named/tedu.cn.zone

tedu.cn. NS svr7
svr7 A 192.168.4.7
www A 192.168.4.10
www A 192.168.4.20
www A 192.168.4.30
ftp A 2.2.2.2

[root@svr7 ~]# systemctl restart named

虚拟机B:验证
[root@pc207 ~]# ping -c 1 www.tedu.cn
[root@pc207 ~]# ping -c 1 www.tedu.cn
[root@pc207 ~]# ping -c 1 www.tedu.cn

[root@pc207 ~]# host www.tedu.cn

二、配置多对一的泛域名解析

[root@server7 ~]# vim /var/named/tedu.cn.zone

tedu.cn.  NS  server7
* A 10.20.30.40

[root@server7 ~]# systemctl restart named

三、有规律的泛域名解析

[root@server7 ~]# vim /var/named/tedu.cn.zone
tedu.cn.      NS            server7
*                  A              10.20.30.40       #无规则
$GENERATE   1-50   stu$    A      192.168.10.$   #有规则
[root@server7 ~]# systemctl restart named
[root@pc207 ~]# nslookup stu50.tedu.cn
Server: 192.168.4.7
Address: 192.168.4.7#53

Name: stu50.tedu.cn
Address: 192.168.10.50

[root@pc207 ~]# nslookup stu51.tedu.cn

Server: 192.168.4.7
Address: 192.168.4.7#5

 

posted @ 2021-06-02 14:34  落樰兂痕  阅读(187)  评论(0编辑  收藏  举报