Support Centre

Modifying the hosts file in Windows

Not enough ratingsNot enough ratingsNot enough ratingsNot enough ratingsNot enough ratings

Article

Windows contains a file named "hosts" that allows you to override where your browser looks for a website. This is useful when you want to test a website on a new server before pointing a domain to that new location to make it live.

This file is normally located here on Windows XP and newer (Vista, 7, etc):
- C:\Windows\System32\drivers\etc\hosts

Or here on NT4 and Windows 2000:
- C:\WinNT\System32\drivers\etc\hosts

Normally, if you have not edited this file before, you will see a couple of existing entries that refer to localhost. This is normal and these should be left alone.

To preview your website, you need to enter the IP address of your new server followed by a space and then the address of the website, like so:

123.123.123.123 example.org
123.123.123.123 www.example.org

Replacing 123.123.123.123 with the real IP address of your new server and example.org with your domain name. Any additional domains you wish to use should be added individually on new lines at the bottom of this file.

Rate This Article

How useful was this article?

Not useful A little useful Useful Very useful Everything I needed