Resolve "Access Denied" error when modifying HOSTS or LMHOSTS files on Windows 10/11
Modifying hosts files is a relatively advanced operation. You may encounter errors such as "Access Denied" during modification of HOSTS or LMHOSTS files. If you also experience this issue, please continue reading this article and we will provide you with a solution.
"Access Denied" Error: Modify HOSTS or LMHOSTS file
Sometimes, you need to change the hosts file to resolve certain issues or block specific websites on your computer. The hosts file is stored in the computer's installation directory and cannot be edited without authorization. Don't worry, follow the steps below and you can easily resolve the error of "Access denied when modifying HOSTS or LMHOSTS files".
Fix "Access Denied" error when modifying HOSTS or LMHOSTS files on Windows 10/11
Method 1: Run Notebook as an administrator
Before editing the hosts file, you need to run Notepad as an administrator. The operation steps are as follows:
- Type Notepad in the search bar, right-click Notepad and select Run as administrator.
- Click File > Open > Navigate to C:\Windows\System32\drivers\etc > Change Text Files (*.txt) to All Files > Select hosts Files > Click Open.
- Make the required changes and save.
Method 2: Cancel the read-only attribute of the hosts file
If the hosts file is set to read-only, it cannot be changed or edited. To resolve the error "Access denied when modifying HOSTS or LMHOSTS files", you may need to delete this property manually.
- Press Win E to open File Explorer.
- Navigate to "C:\Windows\System32\drivers\etc".
- Right-click on the hosts file and select Properties from the context menu.
- Under the General tab, uncheck the Read-Only property.
- Click Apply and OK to save the changes.
Method 3: Change the security settings of hosts file
To access these files, you need special permissions. If you lack permissions, you may encounter the error "Access denied when editing hosts file". Here is how to grant permissions:
- In File Explorer, navigate to "C:\Windows\System32\drivers\etc".
- Right-click on the "hosts file" to select "Properties".
- Under the Security tab, click Edit.
- Now you can see a list of users and groups. Make sure your username has full access and control permissions.
Select your user account and select "Full Control".
- Click Apply and OK to apply the changes.
Method 4: Change the location of the hosts file
It is reported that changing the file location also helps to resolve the error of "Access denied when modifying HOSTS or LMHOSTS files".
- In File Explorer, navigate to "C:\Windows\System32\drivers\etc".
- Find the "hosts file", right-click it and select "Cut" > Paste the copied file on your desktop.
- Open the "hosts file" on the desktop > Make the necessary changes to it > Press Ctrl S to save the changes you made.
- Copy and paste the changed hosts file to its original location.
Summarize
In this guide, we introduce four ways to fix the “Access denied when modifying a HOSTS or LMHOSTS file” error. Also, don't forget to use reliable backup software such as MiniTool ShadowMaker to protect your data security.
The above is the detailed content of Fixed! Access Denied When Modifying HOSTS or LMHOSTS File. For more information, please follow other related articles on the PHP Chinese website!

LifeCam is a well-known line of webcams made by Microsoft. However, some users reported that LifeCam Studio was either not detected or not working on Windows 11. If you are one of them, you can refer to this post from php.cn to find solutions.

Microsoft Word is the most common word processing app that lets you create and edit word documents. It is available as a standalone app or as a component of the Microsoft Office suite. You need to buy Microsoft Word or Microsoft Office/365 to get the

If the iPhone/iPad App Store won’t let you download apps, you may try the 8 tips in this post to see if they can help you fix the App Store won’t download or update apps issue. For more computer tips and tricks, you may visit php.cn Software official

In your daily time, the Walmart app can play as an online market where you are allowed to browse through a variety of commodities and get groceries delivered to your door. Sometimes you may struggle with the “Walmart app not working” issue and as for
![[7 Easy Ways] How to Fix File System Error Chromebook Camera? - MiniTool](https://img.php.cn/upload/article/001/242/473/174654817119626.png?x-oss-process=image/resize,p_40)
This article discoursed by php.cn mainly teaches you the methods to deal with Chromebook Camera not working files system error. All solutions have managed to help users with similar issues. Move on to find your solution!

Knowing Apple warranty check may be what you need before you purchase Apple devices including iPhone, iPad, Mac, Apple Watch, and other products. How to check Apple warranty? Follow the guide from php.cn and you can find 3 ways for this task.

Although Dota 2 is considered a solid performing game, you can receive some issues like Dota 2 disk write error when trying to update the game. If you receive the same error, the solutions below on php.cn Website might help you out.

Does Windows 10 have Camera software? How do I download Microsoft Camera? If you are curious about Windows 10 Camera app download, you come to the right place. This post from php.cn focuses on Windows Camera download for Windows 10/11 and installatio


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Dreamweaver Mac version
Visual web development tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

Notepad++7.3.1
Easy-to-use and free code editor

Atom editor mac version download
The most popular open source editor

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment
