Home  >  Article  >  System Tutorial  >  What should I do if my Windows 11 computer’s hosts file configuration is abnormal and I cannot access the Internet?

What should I do if my Windows 11 computer’s hosts file configuration is abnormal and I cannot access the Internet?

PHPz
PHPzforward
2024-02-05 17:48:071311browse

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".

What should I do if my Windows 11 computer’s hosts file configuration is abnormal and I cannot access the Internet?

#2. The "User Account Control" interface will appear, click "Yes".

What should I do if my Windows 11 computer’s hosts file configuration is abnormal and I cannot access the Internet?

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).

What should I do if my Windows 11 computer’s hosts file configuration is abnormal and I cannot access the Internet?

#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).

What should I do if my Windows 11 computer’s hosts file configuration is abnormal and I cannot access the Internet?

5. After completion, the hosts file will be opened and just close it.

What should I do if my Windows 11 computer’s hosts file configuration is abnormal and I cannot access the Internet?

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!

Statement:
This article is reproduced at:xpwin7.com. If there is any infringement, please contact admin@php.cn delete