How to solve the failure of Win8 system Hosts file?

  

I believe everyone has encountered the problem of the Hosts file invalidation. What is going on? The failure of the Hosts file has caused me a lot of trouble in my work. How can I solve this problem? I believe many users are still not clear, the following small series for everyone to introduce the solution to the failure of the Hosts file.

Win8 system Hosts file to test failure phenomenon:

1, for everyone to be a demonstration test, see below:

2, hosts file path is And only one row mapping ensures that there are no other distracters. Use ipconfig /flushdns to clean up the DNS cache, and in fact I stopped the DNS Client service. Then continue to ping, still returning the address of the real DNS resolution. As shown in FIG:

3, the system is also visible permission assignment. The permissions of the account in my own account and the Admin group below are also completely controlled. As shown:

This is the case, I do not know why the recent sudden failure.

Win8 system Hosts file failure recovery method:

1, edit the access permissions of the etc folder, add the Network Service security principal and give at least read permissions, and then restart the DNS Client service Just fine. Currently my hosts are all fine.

2, press Win + X, click “ command prompt (administrator) & rdquo;, enter the following command in turn, press Enter (Enter) to execute:

SC stop Dnscache

SC config Dnscache obj= “NT AUTHORITY\\NetworkService”

TAKEOWN /F “%windir%\\System32\\drivers\\etc” /A

icacls “%windir %\\System32\\drivers\\etc” /grant “NT AUTHORITY\\NetworkService”:RX

SC start Dnscache

Command Explanation:

Stop Dnscache (DNS Client) Service

Configure the security principal running the Dnscache service as Network Service

Give the etc folder ownership to the administrator group

Add the read in the etc folder for the Network Service Take and execute access rights

Start Dnscache service

The above is the solution to the failure of the Hosts file introduced by Xiaobian. If the user encounters the problem that the Hosts file is invalid, you can follow the above steps. Take action.

Copyright © Windows knowledge All Rights Reserved