Hosts file not working on Windows 11/10

A Hosts file is a file that contains specific IP addresses and domain names. It is used for testing purposes to replace a DNS (Domain Name System) so that a web browser can be redirected to a specific IP address. For some users, the The hosts file is not working properly on their Windows 11/10 systems. If such a thing happens to you, you can try the solutions explained in this article to fix the problem.

Why is the Hosts file not working?

There can be several reasons why the Hosts file is not working on your Windows computer. You may be using the wrong format in your Hosts file. Apart from this, Hosts file permission issues are also one of the causes. If you have configured Proxy on your Windows 11/10 computer, it may bypass the Hosts file. We have explained the solutions to fix this problem below in this article.

Hosts file not working on Windows 11/10

Before trying the solutions mentioned below, make sure that you are using the correct format in the Hosts file to redirect websites in your web browser. The Hosts file will not work if you added the websites in the wrong format. The correct format is:

IP Address

There is a space between the IP address and the domain name. You can also separate IP address and domain name with Tongue so separating them with space doesn’t work.

Also, the same IP address should not be on different lines. If you want to add multiple entries for the same IP address, you can add all of these entries on the same line by separating them with a space.

If you have used the correct format but the Hosts file still does not work, try the solutions mentioned below:

  1. Clear your DNS cache
  2. Reset your NetBios cache
  3. Check Hosts file encoding format
  4. Check for permission issues
  5. Reset Hosts File
  6. Disable proxy
  7. Create a new Hosts file
  8. Chrome recessed pools
  9. Disable DoH in Firefox

Let’s see all these fixes in detail.

1]Clear your DNS cache

Changes to the Hosts file should take effect immediately. But this is not the case. Therefore, flushing the DNS cache may resolve the issue. To do this, you need to run the following command in an elevated command prompt.

ipconfig /flushdns

2]Reset NetBios Cache

If flushing the DNS cache did not solve your problem, resetting the NetBios cache may help. Open the command prompt as an administrator, type the following command and press Enter.

nbtstat -R

Now check if the problem still occurs.

3]Check the encoding format of the Hosts file

The Hosts file must have one of the following encoding formats:

Check the encoding format of your Hosts file. To do this, right-click on the Hosts file and select “Open With > Notepad.” If Notepad option is not there, open Notepad then press the CTRL+O keys. Now select the Hosts file to open it. Go to “File > Save As.” Notepad will show you the same encoding format used for the Hosts file.

You can also use Firefox to view the Hosts file encoding format. The steps to do this are as follows:

View Hosts file encoding format

  1. Open Firefox.
  2. press the CTRL+T keys to open a new tab.
  3. press the CTRL+O keys and select the Hosts file to open it in Firefox.
  4. When the Hosts file opens in Firefox, tap the CTRL+I keys to display the encoding format.

Save Hosts file in correct encoding format

If the encoding format is other than those mentioned above, you can change it using Notepad. Open the file in Notepad and go to “File > Save As.” Select UTF-8 or ANSI encoding format from the drop-down list. Write its name in quotes, like “hosts” and click to safeguard. You will receive a confirmation message to overwrite the existing file. Click on Yes.

If that doesn’t work, create a new Hosts file. We explained this method later in this article.

4]Check for permission issues

The problem may be due to permission issues. The Hosts file must contain both Lily and read and run permissions. To verify this, follow the steps below:

Check Hosts File Permissions

  1. Right-click on the Hosts file and select Properties.
  2. When the Properties window appears, select the Security tongue.
  3. Select Users in the Groups or usernames box.
  4. Both Lily and read and run permissions should be checked under the Allow column. If not, grant both of these permissions to the Hosts file by clicking the Edit button.

5]Reset Hosts File

If the problem persists, reset the default Hosts file. Resetting the default Hosts file may resolve connectivity issues.

6]Disable proxy

proxy settings windows 11

If Proxy is enabled in your computer then it can bypass Hosts file due to which Hosts file is not working. The solution is to disable the Proxy. Open your Windows 11/10 settings and disable both Automatic proxy configuration and Manual proxy configuration settings.

7]Create a new Hosts file

Create a new Hosts file and replace the existing one with this one. Before creating a new Hosts file, we suggest you perform the following steps and see if the issue is resolved.

  1. Navigate to the default location where the Hosts file is located.
  2. Copy the Hosts file and paste it to another location.
  3. Delete the Hosts file from the original location.
  4. Now go to the location where you copied the Hosts file and move it to the original location.

The above steps solved the problem for some users. Maybe these steps also solve your problem. If that doesn’t help, create a new Hosts file. To do this, follow these steps:

Save Hosts file in correct encoding format

  1. Open the default Hosts file location.
  2. Right-click on the Hosts file and select Rename.
  3. Name it like Old.Hosts and knock Walk in. You must log into your computer as an administrator to rename the Hosts file.
  4. Open Notepad.
  5. Go to “File > Save As.”
  6. In the File name field, type hosts under the quotation marks.
  7. Make sure the encoding format is set to UTF-8 or ANSI.
  8. Now click to safeguard.
  9. Move this Hosts file to the default location on drive C (if you saved it to another location).

8]Chrome recessed swimming pools

Chrome flush-mount pools

Connectivity issues in Chrome can also be fixed by flushing socket pools. If clearing the DNS cache on your Windows device doesn’t fix the problem, you can also try flushing socket pools in Chrome. To do this, open Chrome, then open a new tab. Now copy the following address, paste it into Chrome’s address bar and press Walk in.


Click on the Built-in swimming pools button.

9]Disable DoH in Firefox

DoH stands for DNS over HTTPS. It is a protocol that transmits DNS queries through an encrypted HTTPS session. If privacy is your primary concern, you can enable this setting in Firefox. When you type in the address of a particular website, your web browser sends a request to the Internet to find that website’s IP address. If this connection is not encrypted, the web address can easily be seen by third parties. If DoH is enabled, the request is sent to the DoH-compliant DNS server using the encrypted HTTPS connection.

Disable DNS over HTTPS in Firefox

DoH can be slower than traditional DNS queries. If DoH is enabled in Firefox, you may be experiencing the issue because of this. You can verify this by disabling it. The steps for the same are as follows:

  1. Open Firefox.
  2. Click on the three horizontal lines at the top right and select Settings.
  3. Select the General category on the left side.
  4. Scroll down and locate the Network Settings section. Click on the Settings button under this section.
  5. The Connection settings window will appear.
  6. Scroll down and uncheck the Enable DNS over HTTPS check box.
  7. Click OK to save changes.

Lily: SysMate Hosts File Walker allows you to easily manage Windows Hosts file.

How to open Hosts file in Windows 11?

You can open the Hosts file in Windows 11 using text editing software. Notepad has default text editing software in Windows. You can use it or you can install Notepad++ for the same. To open a Hosts file in Notepad, first open Notepad as an administrator, press the CTRL+O keys and select the Hosts file to open it.

I hope this helps you.

Read more: SwitchHosts is a Hosts file switcher to easily change the Windows Hosts file.

Hosts file not working on Windows