温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

用bat脚本,测试DNS信息失效时长

发布时间:2020-03-10 11:11:54 来源:网络 阅读:348 作者:lujj45 栏目:系统运维

用bat脚本,测试DNS信息失效时长。

CentOS6.4中named.xx.zone的配置:
$TTL=7D
3D ; minimum

测试结果:停止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]

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI