windows下清空本机DNS缓存
firefox和ie在修改了本机的hosts文件后,必须重起一下ie才起作用,今天看到有人讨论这个问题,问有没有办法可以用命令行清空dns的cache,直接使修改过的hosts文件生效,而不需要重起ff或者ie。
方法很简单
ipconfig /flushdns
相应的还有
ipconfig/displaydns Display the contents of the DNS Resolver Cache.
显示dns cache的内容,包括hosts文件里的信息也会显示出来。
ipconfig这个命令经常用,常用的有:
/all Display full configuration information.
/release Release the IP address for the specified adapter.
/renew Renew the IP address for the specified adapter.
但是这个关于dns的功能很少用。还有
/registerdns Refreshes all DHCP leases and re-registers DNS names
/showclassid Displays all the dhcp class IDs allowed for adapter.
/setclassid Modifies the dhcp class id.
windows下清空本机DNS缓存
ipconfig /flushdns can clear the cache;
ipconfig /displaydns can display the dns cache.
本机的hosts文件也会在/displaydns时显示.其实这个在ipconfig –help里面有显示,就是一直没注意@_@
/all Display full configuration information.
/release Release the IP address for the specified adapter.
/renew Renew the IP address for the specified adapter.
/flushdns Purges the DNS Resolver cache.
/registerdns Refreshes all DHCP leases and re-registers DNS names
/displaydns Display the contents of the DNS Resolver Cache.
/showclassid Displays all the dhcp class IDs allowed for adapter.
/setclassid Modifies the dhcp class id.