Summary of methods to make the hosts configuration file immediately effective

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.