In this article I assume the user is familiar with the idea of a host name / domain name mapping. It is typically referred to as a "hosts" entry because the entry is made to a file usually called "hosts". I won't go into the details of what or why you might actually want to do this as it would require writing a document on how the Internet works, which is way beyond the scope of this simple HOW TO.
To setup a hosts entry do the following:
- Logon to windows with sufficient rights1 . An administrator account is preferable.
- Click "start | run" and type "notepad c:\windows\system32\drivers\etc\hosts" for Windows NT base OSes or "notepad c:\windows\hosts" for Win9x2 3 .
- Add a line to the bottom of the file that starts with the IP address and then follow it with [space] or [tab] (your preference) and the host name. Your entry should look something like this:
- Now save the file and you should be able to access the new name4.
- In Windows 95, 98 & ME there aren't any privileges so not logging in at all or as any old user will work.
- The location of the hosts file can be very confusing in the various flavors of windows. It will always be under the main "windows" directory somewhere. In Win NT & 2000 that was actually "c:\winnt\..." where as in Win 95, 98, ME, XP ... it was "C:\windows\...". To make things more confusing the windows directory isn't always on the C: drive. You may have to do some hunting. In the Win9x line of operating systems the hosts file usually doesn't exist. You can use the find function though to look for "hosts.sam" and copy it to "hosts", in the same directory, and then edit it.
- To further complicate matters if the "hide file extensions for known types" is enabled notepad may not allow you to save a file without an extension. If it keeps trying to read or save to "hosts.txt" you will want to turn that feature off. I dislike that setting because it usually gets in my way.
- If you're trying to use the new name in the web browser you will probably have to restart it after you've made the changes. In some situations a reboot is necessary. If things still don't seem to work check your spelling in the "hosts" file.