

There is no option to run it as administrator from the “open with” context menu.Īs for the website URL, the hosts file isn’t very clever (cannot use wildcards). If you open hosts file via open with context menu, you can’t run it as admin. The reason you need to run Notepad as administrator first is because you need to obtain the administrator right this way in order to be able to edit the hosts file.

Websites that were added in the hosts file and mapped to 127.0.01 will no longer be accessible by any program or browser in the PC. Press CTRL + S to save the hosts file, or by clicking File, then Save.To block multiple websites, repeat step 5 and make sure only one mapping per line.In the hosts file, on a new line, enter 127.0.0.1, followed by a space or TAB, and then enter the website URL that you want to block.Select the hosts file and click on “ Open“.At the bottom of the Open window, click on the drop-down to change it from “Text documents” to “ All files” so that the hosts file can be visible. Navigate to C:\Windows\System32\drivers\etc.

Right-click Notepad and select “ Run as administrator“.
