Summary of methods to make the hosts configuration file immediately effective
Do Web development and testing, it is inevitable to modify the hosts frequently to specify a domain name to access a particular IP; In Windows, every time you modify the C:\windows\system32\drivers\etc\hosts, you need to restart the browser to take effect. Today I do this problem on the line to learn, the following three methods, of course, not necessarily for everyone is effective, you can try it.
method One:
Command Line (CMD) run: Ipconfig/flushdns
#清除DNS缓存内容.
Ps:ipconfig/displaydns //display of DNS cache content
Method Two:
Modify registry: Hkeycurrentuser\software\microsoft\windows\currentversion\internet Settings,
NEW: dnscacheenabled 0x0 (REG_DWORD)
Dnscachetimeout 0x0 (REG_DWORD)
Serverinfotimeout 0x0 (REG_DWORD) these three DWORD.
Method Three:
Open: Control Panel-admin tools-Services, where "DNS Client" is found to deactivate it and change it to manual mode (
after doing this, running Ipconfig/flushdns is not necessary, nor is it running successfully)
Attention:
If you are using the Firefox browser, strongly recommend the DNS Flusher plug-in, after the host binding, only need to use
this plug-in, will make the binding immediately effective; very useful. ~
In addition, modify the/etc/hosts under Linux, if you want it to take effect immediately, run source/etc/hosts should be able
to