Lock, manage, edit the Hosts file under Windows 10/8/7

Updated June 2024: Stop getting error messages and slow down your system with our optimization tool. Get it now at this link
  1. Download and install the repair tool here.
  2. Let it scan your computer.
  3. The tool will then repair your computer.

Hosts file in Windows

In this message we see its location and also how to manage, lock or edit Hosts file.

Host file location

June 2024 Update:

You can now prevent PC problems by using this tool, such as protecting you against file loss and malware. Additionally, it is a great way to optimize your computer for maximum performance. The program fixes common errors that might occur on Windows systems with ease - no need for hours of troubleshooting when you have the perfect solution at your fingertips:

  • Step 1 : Download PC Repair & Optimizer Tool (Windows 10, 8, 7, XP, Vista – Microsoft Gold Certified).
  • Step 2 : Click “Start Scan” to find Windows registry issues that could be causing PC problems.
  • Step 3 : Click “Repair All” to fix all issues.

Download Now

The Hosts file under Windows is located at the following location :


Lock the Hosts file to prevent hijacking

Imagine by clicking www.windowsbulletin.com and seeing a completely different website in your browser. Malware can redirect web addresses on your computer by modifying your Hosts file. This is called Host File Hijack.

To avoid host file hijackings, navigate to it, right-click it, select properties, and make it a read-only file . This will lock your Hosts file and prevent someone or any malware from writing to it.

Block website with Hosts file

To block a website with Hosts file, simply add the following entry :

Although I don’t, many users like to manually add entries to block the opening of one or more specific websites. Others who download and use the list of known sources such as mvps.org to add entries that prevent the opening of malicious sites.

Edit Hosts file

If you need to edit Hosts file, navigate to the following folder :


Here you see the Hosts file. Right-click and select Notepad. Make the changes and save them.

the following error message:

Access to C:WindowsSystem32driversetc hosts has been denied


The C:WindowsSystem32driversetchosts file cannot be created. Make sure the path and file name are correct

In this case, type Notepad in the start search and right-click the Notepad result. Select Run as administrator. Open the Hosts file, make the necessary changes, and click Save.


Although you can still manage or edit the Hosts file manually, I suggest you use a third-party freeware tool such as HostsMan.

HostsMan is a feature-rich tool that allows you to add, delete and edit entries in the Hosts file. You can also easily add third-party host lists to block malicious sites, and you can easily enable or disable the Hosts file. It includes an integrated Hosts file update device and a Hosts editor. You can scan the Hosts file for errors, duplicates and possible diversions and create an exclusion list. Another useful feature is the host file backup manager. Save your Hosts file to a safe location and restore it if necessary.

Hostman also allows you to clear the DNS cache, open hosts with a text editor, count hosts, find duplicates, replace IP, scan hosts for malicious entries, reorganize hosts, manage DNS client services, and more. In short, it is the only host manager you will need. You can download it from its homepage. SysMate Hosts File Manager is another tool you can use to do this.

How to manually reset the Hosts file to the default value in Windows may also interest you.

If your browser has been hacked, you can find this useful entry in Browser Hijacking and Free Browser Hijacker Removal Tools.

Expert Tip: This repair tool scans the repositories and replaces corrupt or missing files if none of these methods have worked. It works well in most cases where the problem is due to system corruption. This tool will also optimize your system to maximize performance. It can be downloaded by Clicking Here

Related Video

Scroll to Top