@ajay87
Windows Oct 20, 2026

Windows 10 won't let me save changes to the hosts file

Trying to add a line to the hosts file to block a site, and Notepad says access denied when I save. I'm an admin on the PC. What's the right way to edit it?
1

Leave A Reply

Log in to post an answer.

1 Answer

evei Oct 21, 2026
ajay87
Being an admin isn't enough on its own, Notepad has to be running as admin. Search Notepad in Start, right-click > Run as administrator, then File > Open, go to C:\Windows\System32\drivers\etc and change the file type dropdown to All files so hosts shows up. If it saves but the block doesn't work, Defender sometimes quietly undoes hosts edits for certain sites. Check Protection history.