用bat脚本,测试DNS信息失效时长-创新互联

用bat脚本,测试DNS信息失效时长。
CentOS6.4中named.xx.zone的配置:
$TTL=7D
3D ; minimum

创新互联公司成都企业网站建设服务,提供网站设计、成都网站建设网站开发,网站定制,建网站,网站搭建,网站设计,响应式网站设计,网页设计师打造企业风格网站,提供周到的售前咨询和贴心的售后服务。欢迎咨询做网站需要多少钱:13518219792

测试结果:停止DNS服务,未达到设定的3天的最小期限,DNS信息就失效了。
或者客户端windows2003重启后,DNS信息失效。

1.重启DNS服务
[root@dns3sv named]# service named restart
Stopping named: .[ OK ]
Starting named: [ OK ]

2.编辑bat脚本,并运行

登录DNS客户端。edit wping2h.bat

echo off
:while1
date /t & time /t & ping usdb1.te -n 1 | find "usdb1" & @ping 127.0.0.1 -n 7199 -w 1000 > nul
goto while1

参数说明:
-n 7199个单位,约2小时输出一次结果。
-w 1000毫秒

3.停止DNS服务
[root@dns3sv ~]# date ; service named stop
Thu Sep 12 12:37:17 CST 2014
Stopping named: .[ OK ]

4.ping的结果
1天后DNS信息失效,Windows2003 ping不通域名指向的IP。

E:\>echo off
星期五 2019-09-13
12:36
Pinging usdb1.te [192.168.15.7] with 32 bytes of data:
星期五 2019-09-13
14:36
Pinging usdb1.te [192.168.15.7] with 32 bytes of data:
星期五 2019-09-13
16:36
Pinging usdb1.te [192.168.15.7] with 32 bytes of data:
星期五 2019-09-13
18:36
Pinging usdb1.te [192.168.15.7] with 32 bytes of data:
星期五 2019-09-13
20:36
Pinging usdb1.te [192.168.15.7] with 32 bytes of data:
星期五 2019-09-13
22:36
Pinging usdb1.te [192.168.15.7] with 32 bytes of data:
星期六 2019-09-14
00:35
Pinging usdb1.te [192.168.15.7] with 32 bytes of data:
星期六 2019-09-14
02:35
Pinging usdb1.te [192.168.15.7] with 32 bytes of data:
星期六 2019-09-14
04:35
Pinging usdb1.te [192.168.15.7] with 32 bytes of data:
星期六 2019-09-14
06:35
Pinging usdb1.te [192.168.15.7] with 32 bytes of data:
星期六 2019-09-14
08:35
Pinging usdb1.te [192.168.15.7] with 32 bytes of data:
星期六 2019-09-14
10:35
Pinging usdb1.te [192.168.15.7] with 32 bytes of data:
星期六 2019-09-14
12:35
Ping request could not find host usdb1.te. Please check the name and try again
.
星期六 2019-09-14
14:35
Ping request could not find host usdb1.te. Please check the name and try again
.

[EOF]

另外有需要云服务器可以了解下创新互联建站www.cdcxhl.com,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


名称栏目:用bat脚本,测试DNS信息失效时长-创新互联
文章起源:http://myzitong.com/article/djodes.html