Most Popular
Recently Added
Recently Updated

How do I view my website on the new server using my computer's host file?

You've moved your site to the new server but it's not yet live (since the DNS hasn't been transferred). You can view your website on the new server by editing a file on your computer.

To do this, you need to tell your PC to temporarily look at your new server rather than the old one when browsing your site:

  • Windows: Edit the file
    C:WINDOWSsystem32driversetchosts
    You can do this by clicking Start, then Run, then typing notepad C:WINDOWS\system32\drivers\etc\hosts into the Run box, and clicking OK.

  • Mac OS X or Linux: Edit the file /etc/hosts using a text editor like BBEdit.
    You'll need root privileges to do this. In Mac OS X, open the Terminal app then type:
    sudo pico /etc/hosts

Once you've opened your hosts file, add the following line to the end of the file:

ip_address    domain name

where ip_address is the IP address of your new server and domain name is your website's domain name.

For example, if you were moving your site www.example.com to a web server with an IP address of 5.6.7.8, you'd add the line:

5.6.7.8    www.example.com

Now save the file and quit the editor.

You may verify you are seeing the new server IP by opening a terminal window (Start > All Programs > Accessories > Command Prompt on Windows) and typing:

ping www.example.com

If you see your new server's IP address in the output you are set.

Now open a browser and enter your website's URL in the address bar. This will display the site on your new server.

Once you've verified all is working contact support to work through finalizing the move process.


Properties ID: 000138   Views: 2121   Updated: 13 years ago
Filed under: