Many users have reported about not being able to Edit the Hosts File due to “Access Denied” error message, whenever the tried to open the Hosts File on their Windows 10/11 computer.
In most cases, the reason for “Access Denied” message while trying to edit the Hosts File on a Windows computer is due to the User not being logged-in to the Admin Account.
The Hosts File on a Windows computer is protected by Admin Password, as it can be used by malware programs to block access to certain websites or to redirect users to unsafe websites.
Access Denied When Editing Hosts File in Windows 10/11
It is possible to Edit the Hosts File on a Windows 11/10 computer from a non-admin account, without getting “Access Denied” message by using any of the following methods.
1. Run Notepad as Admin
In most cases, you should be able to Edit Hosts File by using Notepad with Admin Privileges.
1. Click on the Start button > type Note in the Search box > right-click on Notepad and select Run as Administrator option.
2. On the next screen, type your Admin Password and press the Enter key.
3. Once Notepad opens, select the File tab and click on Open.
4. In Open File dialogue box, navigate to C:\Windows\system32\drivers\etc and switch to All Files view.
Note: You won’t be able to view Hosts File without switching to All Files view.
5. Select the Hosts File and click on the Open button to open Hosts File in Notepad.
6. Make changes as required to the hosts file and Save the file.
2. Edit Hosts File on Desktop
Another way is to move the Hosts File to Desktop, make changes and move the Edited File back to its original location.
1. Using File Explorer, navigate to C:\Windows\System32\drivers\etc\ .
2. Select the Hosts File and drag it to the Desktop.
3. Click on Continue on “File Access Denied” pop-up,
4. On the next screen, enter your Admin Password and press the Enter key.
5. Open Hosts File on your desktop using Notepad and make changes as required.
4. After making changes, drag Hosts File back to C:\Windows\System32\drivers\etc\
5. Click on Continue on “Destination Folder Access Denied” pop-up,
6. On the next screen, enter your Admin Password to move the File back to its original destination.
3. Uncheck Read Only Box
It is possible that Hosts File has been saved in Read Only mode.
1. Using File Explorer, navigate to C:\Windows\System32\drivers\etc\.
2. Right-click on the Hosts File and click on Properties.
3. On Host Properties screen, uncheck Read-only Box in Attributes section.
4. Click on Apply & OK to save the changes.
If you are still unable to Edit Hosts files, you need to scan your computer for malware and see if this helps.
If you are unable to Edit Hosts File in Windows 10 and seeing “Access Denied” message, the problem is usually due to lack of User Permissions.