Host file

Edit for testing

If you are working on a temporary site that is located at a different location, you may need to change how your computer uses DNS on that page. You do this by editing the Host file. Here are the steps:

11.22.33.44 mywebsite.com 

Clearing dns

Testing

A good way to check if you have made the correct changes is to use traceroute. It helps to do this before so you know the current IP and can see the difference:

C:\Users\myuser>tracert mywebsite.com 
C:\Users\myuser>tracert mywebsite.com

Tracing route to mywebsite.com [44.44.44.44]
C:\Users\myuser>tracert mywebsite.com

Tracing route to mywebsite.com [11.22.33.44]

Commenting out and reverting

When you are done with the host file, you should either delete the line in the host file, or comment it out. Commenting it out leaves the line in to be activated later. To comment out just add a hash mark # before the line. SO the host file would look like:

#11.22.33.44 mywebsite.com 

Multiple lines

You can add multiple lines of code and various ones commented out. your host file can look like this:

11.22.33.44 mywebsite.com 
#4.3.2.1 google.com
55.66.77.88 testsitenumber2.com

In this example it would only change the first and third dns entry. The google entry would not affect how your computer reaches google.