Modify the hosts invalid solution

  1. According to Microsoft's related documents, the hosts file must be in ascii encoding. If you save it in unicode format, it will not be read correctly.
  2. Modifying hosts to point the domain name to the new ip always fails to take effect. I tried many methods, but the problem still exists. So I went to the Microsoft website to find the answer, and finally found a problem with the "DNS Client" service. The "DNS CLient" service was It is used for caching dns, so the modified hosts file does not take effect immediately. It takes a period of delay. Usually you can use ipconfig /flushdns to refresh the dns cache, but this method seems to have no effect on my problem, so just Open the Control Panel-Administrative Tools-Services, find "DNS Client" in it, disable it and change it to manual mode.
    So the problem is solved, the hosts file can be modified at any time to take effect. Note that the invalidity mentioned in this article refers to the invalidity after the setting, not the lack of permission to modify the hosts.

Guess you like

Origin blog.csdn.net/qq_35576225/article/details/109161394