Edit hosts file in Windows
Related Videos: How To Edit Hosts File in Windows 10 (May 2024).
Editing the hosts file on Windows can prove tricky. The file can be found quickly in the Windows system folder, but changes can only be made with the appropriate rights. Learn how to successfully edit the hosts file here.
This will give you the rights to edit the hosts file
If you navigate to C: \ Windows \ System32 \ drivers \ etc and try to open or change the "hosts" file there, it is likely that Windows is getting the error that you do not have enough rights for the action. If you don't want to turn off User Account Control, do the following to edit the hosts file:
- Open the start menu. You can do this by pressing the Windows key on the keyboard.
- Enter "Editor" in the search field (see screenshot).
- Right-click on the "Editor" entry (notepad icon).
- Select "Run as administrator". The editor window opens.
Change the hosts file with the editor under Windows
If you have opened the editor as administrator, you can do the trick: edit the hosts file.
- Press and hold the Ctrl key and "O" within the editor.
- In the newly opened window, navigate to C: \ Windows \ System32 \ drivers \ etc. Make sure that "All files (*. *)" And not "Text files (* .txt)" is selected at the bottom right so that the hosts file is also displayed.
- Once you have opened the hosts file, you will see some comments in English, preceded by the # symbol at the beginning of the line. With the double cross you can also write comments and notes that only serve as information for you.
- If you would like to add a new entry, it is best to do so below the comments. Each entry should be on a separate line. Write the IP address at the beginning of the line and, behind it, separated by at least one space, the associated host name (see screenshot).
- If you want to block all network traffic to a specific domain using the hosts file, use "127.0.0.1" as the IP address. For example, in the screenshot you see the line "127.0.0.1 google.com" - This blocks access to google.com. For example, you can no longer access the page in the browser.
- Once you have edited the hosts file as required, press and hold the Ctrl key and "S" on the keyboard in the editor window to save the changed Windows file.
The tips refer to a system with Windows 7 Ultimate 64 bit. In Windows 8, open the editor via "All Apps" (right-click on the start screen) and then on the far right under "Windows Accessories". The rest of the solution is the same.