How to view sites before changing DNS hosts file

When you are migrating your site between servers, you can edit your computer's "hosts" file so you can view your site when the DNS may not be working correctly.

This is an example of a typical hosts file:

The first item is the IP address that you would like the domain name to resolve to. The second is the domain. For example, if I wanted to point to IP address I could type:

This will redirect and to You can use this tool to test whether your sites are working after the migration, while still leaving your original site online. Simply, point the desired IP to the domain name and your computer will connect to the new IP whenever you type in the domain name.

The hosts file is located is different places, depending on the operating system. However, it is always called "hosts".

Mac OS X

On Mac OS X, the hosts file is located here:


Administrative privileges are required to edit this file.


On Windows Vista and 7 the hosts file is located:


(Typically: C:\Windows\System32\drivers\etc)

Administrative privileges are required to edit this file.


On Linux, the hosts file can be found:


You may need administrative privileges.

Please remember that after the migration is complete, to revert the hosts file to it"s original state.

If you require further assistance please contact our support team.

Is article helpful?