Sometimes, some people may encounter the hosts file not working problem. If you are also bothered by this problem, this post is what you need. MiniTool Partition Wizard will offer several feasible ways for this issue.

Hosts files are files that contain specific IP addresses and domain names. It is used for testing purposes to override DNS (Domain Name System) so that web browsers can be redirected to specific IP addresses. Usually, it is located at C:WindowsSystem32driversetc. However, some users found that the Hosts file not working on Windows 11/10.

There could be a number of reasons why the hosts file not working on your Windows PC. You might be using the wrong format in your hosts file. In addition, the permission problem of the Hosts file is also one of the reasons.

If something like this happens to you, you can try the solutions presented in this article to fix the problem. Before you try the solutions below, make sure you are using the correct format in your Hosts file to redirect sites in your web browser. If you add your site in the wrong format, the Hosts file will not work. The correct format is as follows: IP Address www.abcd.com.

# 1. Flush the DNS Cache

Some people report that they have solved the hosts file not working issue by flushing the DNS cache. The steps are as follows:

Step 1: Search for cmd using Windows Search. Then right-click on the result and select Run as administrator. Click Yes if you see the User Account Control.

Step 2: In the Command Prompt window, type ipconfig /flushdns and press Enter.

Once done, restart your PC and check if the problem is solved.

# 2. Reset NetBios Cache

If flushing the DNS cache does not resolve your issue, resetting the NetBios cache may help. Open Command Prompt as an administrator, type the following command, and press Enter.

nbtstat -R

Now, check if the problem still exists.

# 3. Check for Permission Issues

The problem may occur due to permission issues. The Hosts file should have both read and read and execute permissions. To check this, follow the steps listed below:

Step 1: Find the location of the hosts file in the File Explorer. Then right-click on the hosts file and select Properties.

Step 2: When the Properties window appears, select the Security tab.

Step 3: Select Users in the Group or user name box.

Step 4: Both the Read and Read & execute permissions should have checkmarks under the Allow column. If not, allow both permissions to the hosts file by clicking the Edit button.

check for permission issues

# 4. Check the Encoding Format of the Hosts File

Hosts files should have any of the following encoding formats: ANSI; UTF-8. Therefore, if you encounter the hosts file not working problem, you should check the encoding format of the Hosts file.

Step 1: Right-click the hosts file and choose Open With > Notepad. If the Notepad option is not there, open Notepad and press the Ctrl + O keys. Select the Hosts file to open it.

Step 2: Go to File > Save As. Notepad will show you the same encoding format as the hosts file.

Check the encoding format of the Hosts file

# 5. Create a New Hosts File

Create a new hosts file and replace the existing one with it. Before you create a new Hosts file, we recommend that you follow the steps below and see if the issue is resolved.

  • Go to the default location where the Hosts file is located.
  • Copy the Hosts file and paste it into another location.
  • Delete the hosts file from its original location.
  • Now, go to where you copied the hosts file and move it to the original location.

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

  1. Open the default location for the Hosts file.
  2. Right-click on the hosts file and select Rename.
  3. Name it old and press Enter. You should log in to your computer as an administrator to rename the Hosts file.
  4. Now, open Notepad. Go to File > Save As.
  5. In the File name field, type host under the quotation marks.
  6. Make sure Encoding is set to UTF-8 or ANSI.
  7. Click Save.
  8. Move this Hosts file to the default location on the C drive (if you saved it elsewhere).

If you accidentally delete the file on your computer, don’t worry. You can use the Data Recovery feature of MiniTool Partition Wizard to recover lost data. Besides, this software enables you to do more operations about disks and partitions, such as create/delete/wipe/format/extend/resize partitions, disk benchmark, etc.

MiniTool Partition Wizard DemoClick to Download100%Clean & Safe

  • linkedin
  • reddit