Windows下DNS cache相关命令

刷新DNS cache:

C:/>ipconfig /flushdns
Windows IP Configuration
Successfully flushed the DNS Resolver Cache.


查看DNS cache:

C:/>ipconfig /displaydns

禁止DNS cache:

C:/>net stop dnscache
C:/>sc servername stop dnscache

也可以在控制面板->服务里关闭DNS client。

更改DNS cache时间:

修改注册表HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Dnscache/Parameters

MaxCacheTtl 最大DNS cache时间
MaxNegativeCacheTtl 最大失败DNS cache时间

Linux下的DNS cache相关命令

重启或停止nscd(name server cache daemon)就可以了:

$service nscd restart
$/etc/rc.d/init.d/nscd restart
$service nscd stop
$/etc/rc.d/init.d/nscd stop

也可以在service里把nscd关闭。


转自http://blog.sina.com.cn/s/blog_4e0987310101dpkp.html