Windows: Configure Static Host Name to IP Address Mappings

Posted September 16, 2003 by Quinn McHenry in Windows

Using the hosts file, ip addresses can be mapped to hostnames. This is useful to access systems that do not have a DNS entry and for test and development purposes.


The hosts file exists in the SYSTEM32\DRIVERS\ETC directory under the Windows root directory (i.e., \WINDOWS or \WINNT). Edit this file and add a line like the following:

192.168.1.15 testserver test.domain.com

This would map two names to the ip address 192.168.1.15, testserver and test.domain.com

For most installations of Windows including XP, Vista, and Windows 7, the location of the hosts file is the following:
C:\windows\system32\drivers\etc\hosts

 

About Quinn McHenry

Quinn was one of the original co-founders of Tech-Recipes. He is currently crafting iOS applications as a senior developer at Small Planet Digital in Brooklyn, New York.
View more articles by Quinn McHenry

The Conversation

Follow the reactions below and share your own thoughts.