Home Blog Archive Windows Edit hosts file in Windows

Edit hosts file in Windows

  • Sep 28, 2025
  • 81
  • 0

Editing the hosts file for web hosting is not that easy. The file can be found quickly, but you need the appropriate rights to make changes.

Web hosting: Editing the hosts file on Windows is quite tricky. imago images / CTK Photo

Change the hosts file with the editor under Windows

If you have opened the editor as an administrator, you can get down to business: editing the hosts file.

  • Within the editor, press and hold the Ctrl key and "O". Alternatively, you can also go to "File" and then "Open...".
  • In the newly opened window, navigate to C:WindowsSystem32driversetc. Make sure that "All files (*.*)" and not "Text files (*.txt)" is selected at the bottom right so that the hosts file is also displayed.
  • You will find the “hosts” file in the “etc” folder. If you have opened the hosts file, you will see some English-language comments 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 now like to add a new entry, it is best to do so below the comments. Each entry should be on a separate line. At the beginning of the line write the IP address and behind it, separated by at least one space, the associated host name.
  • 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. Example: If you enter the line "127.0.0.1 google.com ", access to google.com will be blocked. For example, you can no longer navigate to the page in the browser .
  • Once you have edited the hosts file as desired, press and hold the Ctrl key and "S" on the keyboard in the editor window to save the changed Windows file.

YOU MAY ALSO LIKE

0 COMMENTS

LEAVE A COMMENT

Human?
1 + 3 =