Windows 7: Edit hosts file
To assign a DNS entry to an IP address, simply edit the hosts file with a text editor. You can find out how this works under Windows 7 in this practical tip.
Find and edit hosts file
The following procedure works under Windows 7 and newer versions of Windows; important: You need admin rights on your PC. If this is not the case and you receive an error message when opening the hosts file, proceed as described in this tip.
- In Windows Explorer, copy the following file path into the input line above: C: \ Windows \ System32 \ drivers \ etc
- Now "hosts" should appear as the top entry in the right half of the window.
- Now right click or double click on it and select the editor in the "Open with" window.
- Now you can edit the text file. Simply enter an IP / hostname combination according to the pattern "123.23.123.12 www.abcdef.de" (without quotation marks) in a new line and then save the file.
- You can also simply comment out individual entries with a diamond (#). (see screenshot)