How to open the hosts file and edit it as an admin
If you are facing issues while editing your hosts file in Windows, or getting an error like shown in screenshot below, here’s your solution.
The trick is to open the Notepad first as an administrator, and then navigate to the hosts file to open and edit it.
Just follow these steps:
- Hit your Windows key and search for Notepad.
- Right click on Notepad and click on ‘Run as administrator’.
- Now navigate to the hosts file path (c:\Windows\System32\drivers\etc) and open the hosts file.
- Make your edits, and it will save without any errors now.
Hope this helps!