.
The HOSTS file on your Windows PC is used by Windows as a place to lookup hostnames for IP addresses before checking DNS. Let's explain:
When you need to go to www.somedomain.com, your computer needs to actually "resolve" that name to an IP address... i.e., what is the IP address of the server that is hosting www.somedomain.com. To resolve that IP address, your system will FIRST look in your HOSTS file, which is simply a text file with a list of hostnames mapped to IP addresses. Typically, it's empty, as it's just there for specific purposes. When www.somedomain.com isn't found there, then your computer will check with your ISP's DNS servers (ISP = Internet Service Provider).
As you can see, because your computer checks in this order, hosts file first, then DNS servers, if you put an entry in your hosts file, you can effectively override what is in DNS. A neat trick that's helpful sometimes in troubleshooting, or publishing a site with FrontPage before DNS is actually pointing to the right IP address.
To edit your hosts file, follow these steps:
- Open Windows Explorer on your system
- Navigate to c:\windows\system32\drivers\etc
- Find the file named "hosts" (it has no file extension), and double click it.
- Windows will ask you if you want to open it and what to open it with, choose to open it with Notepad (notepad.exe).
- Once the file is open, you can add the necessary lines. If our support team is asking you to modify your hosts file, they will provide you the exact line to enter. The line will be in the format of:
- 1.1.1.1 somedomain.com
- 1.1.1.1 somedomain.com ftp.somedomain.com www.somedomain.com
- where "1.1.1.1" equals the ip address you need to point to and "somedomain.com" is the hostname you need to map/resolve the IP to.
- Important notes when editing a hosts file:
.