• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Techbout

Technology Simplified.

  • Windows
  • iPhone
  • Mac
  • Web Services

Fix: Access Denied When Editing Hosts File in Windows

By: Sam Patwegar | Updated: November 9, 2025

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 is protected by Admin Password, which protects it from being used by malware programs to redirect users to unsafe websites or block access to certain websites.

Access Denied When Editing Hosts File in Windows 10/11

The simplest way to bypass the “Access Denied” message while editing the “Hosts” File on a Windows computer is to edit the Host File by logging into an Admin Account or a User Account with Admin privilages.

If this does not help, the problem could be due to the Hosts File being saved in “Read Only” mode, which also can be fixed by going to the File Properties screen.

Advertisement

1. Edit Hosts File Using Admin Account

As mentioned above, the easiest way to bypass the error message is by using an Admin Account to open and edit the Hosts File.

1. Login to Admin Account or User Account with Admin Privileges.

2. Open File Explorer > navigate to C:\Windows\system32\drivers\etc and open the Hosts File by double-clicking on it.

Open Hosts File in Notepad

3. Edit the Hosts File as required and make sure you save the File.

Note: You can also Edit Hosts File from a non-admin account, without encountering any error messages by using steps as provided in this guide: How to Edit Hosts File in Windows 11/10.

2. Edit Hosts File on Desktop

Another way is to move the Hosts File to Desktop, make the required changes and move the Edited File back to its original location.

1. Open the File Explorer on your computer.

2. From the File Explorer screen, navigate to C:\Windows\System32\drivers\etc\ > Select the Hosts File and drag it to the Desktop.

3. When the “Access Denied” pop-up appears, click on Continue.

File Access Denied Pop-up

4. On the next screen, enter your Admin Password to authorize changes to the Hosts File and press the Enter key.

5. Open the Hosts File on your desktop using Notepad > make changes as required and drag the Hosts File back to its original location (C:\Windows\System32\drivers\etc\).

Copy Hosts File to etc Folder

6. Click on Continue on “Destination Folder Access Denied” pop-up,

Destination Folder Access Denied Pop-up

7. On the next screen, enter your Admin Password and move the File back to its original destination.

3. Uncheck Read Only Box

If above methods did not help, the problem could be due to the Hosts File being in Read Only mode.

1. Open File Explorer > navigate to C:\Windows\System32\drivers\etc\.

2. On the next screen, right-click on the Hosts File and click on Properties.

3. On Host Properties screen, uncheck the Read-only Box in the “Attributes” section.

Hosts Properties Screen

4. Click on Apply & OK to save the changes.

If you are still unable to the Edit Hosts file, scan the computer for malware and see if this helps in fixing the problem.

Sam Patwegar

10+ years experience in writing fluff-free troubleshooting guides with just the right and required amount of related information. Equally capable of In-depth technical writing.

Related
  • Disable Face And Fingerprint Login in Windows 11/10
  • How to Reset BIOS/UEFI to Default Settings
  • How to Change Username in Windows 11/10

Primary Sidebar

Advertisement

Recent Posts

  • How to Use Google Maps Without Internet: Offline Guide
  • How to Disable WhatsApp Message Previews On iPhone
  • How to Enable Dynamic Lock in Windows 11
  • Location of Driver Files in Windows 11/10
  • How to Disable Camera In Windows 11/10

Advertisement

© 2026 Techbout.com · All Rights Reserved
About | Privacy Policy | Terms | Contact
Twitter(X) | Facebook