1. 程式人生 > >關於DNS cache

關於DNS cache

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關閉。

參考: