I've been trying to edit my host file for a while now and I keep failing. I tried to open notepad as administrator and then click File --> Open and choosing the host file but I get this error message:
hosts
You don't have permission to open this file.
Contact the file owner or an administrator to obtain permission.
I tried notepad++ as well (as administrator) but I couldn't even get to the file with it (it doesn't show the etc folder in drivers). I also tried to check my "User Account Control Settings" but it was already on the lowest level (never notify). While looking online for a solution I've noticed more people having the same problem but I couldn't find a solution that worked for me.
I'm running Windows 7 Home Premium 64-bit
You have to run notepad++ (or your favorite text editor) as an administrator. Right click notepad++ and it should display an option to run it as admin. Once open, locate the hosts file and open it with notepad++.
Windows hosts file location: c:\windows\system32\drivers\etc
Note: copy and paste the above url in the file-explorer when opening a file within notepad++ instead of locating it manually as some directories are hidden.
If the above doesn't work, Windows 10, 8 sometimes requires you to first turn off your antivirus.
If you require editing the hosts file often, you could look into third-party freeware tools to aid you. [1][2]