php editor Yuzai discovered that when we use Win11 computers, we sometimes encounter problems with abnormal configuration of the hosts file, resulting in the inability to access the Internet. In this case, how should we solve it? Below, I will introduce you to some solutions to help you successfully restore Internet access. Let’s take a look!
Win11 computer hosts file configuration is abnormal and unable to access the Internet problem analysis
1. In the search box of the taskbar, enter: cmd
right-click "Command Prompt" and select " Run as administrator".
#2. The "User Account Control" interface will appear, click "Yes".
3. Enter in "Administrator: Command Prompt":
01for /f %P in ('dir %windir%\WinSxS\ hosts /b /s') do copy %P %windir%\System32\drivers\etc & echo %P & Notepad %P
and then press the Enter key (Enter key on the keyboard).
#4. You need to wait for a while and some prompts will appear.
(If the hosts file is lost, it will be created, otherwise it will be overwritten)
Then enter:
a
and then press the Enter key (on the keyboard Enter key).
5. After completion, the hosts file will be opened and just close it.
The above is the detailed content of What should I do if my Windows 11 computer's hosts file configuration is abnormal and I cannot access the Internet?. For more information, please follow other related articles on the PHP Chinese website!