Contact Hosting Australia

(07) 4914 2433

Using hosts file to test sites pre-migration Print

  • wordpress, temporary url, development, hosts file, windows host file
  • 1478

If you wish to test your website on the Hosting Australia servers, pre-migration (aka before you update the DNS), you can do so by updating the Windows host file.

Editing the "Host" file on your PC, will allow you to manually force the DNS to a set IP...mimicking a full DNS update.  Setting a manual entry for your domain in the hosts file, will ask your PC/MAC only to look directly at the IP address itself, regardless of what the domain is pointed to.

IMPORTANT - remember to remove these entries, once you have updated your domain name, to prevent issues down the track.

The change is quite simple to make. It just involves adding two lines to the host file. For example, if you domain name was www.acmeproducts.com, and you are hosted on the IP of 101.0.93.98, the two lines required would be:

101.0.93.98 www.acmeproducts.com
101.0.93.98 acmeproducts.com

If you don't use WWW on your site, you would only add the second entry. 

Please ensure you open the text edit as administrator, to work around Windows User Account Control (UAC).

For Windows 8 and above...

  1. Press the Windows key on your keyboard.
  2. Enter Notepad in the search field.
  3. From the search results, right-click Notepad and select Run as administrator.
  4. Once notepad has opened, click FILE and choose OPEN.
  5. Then navigate to c:\Windows\System32\Drivers\etc
  6. Make sure you choose "All files (*.*)" from the drop down box towards the bottom right hand corner of the "open file" dialogue box.(It will likely default to Text Documents, when you initially open it)
  7. Then open the file called "hosts".
  8. Add the two line entries, as mentioned above.
  9. Click File and then click on Save to finish your changes.

For Windows 7 and Vista:

  1. Click Start,  then All Programs and then choose Accessories.
  2. Right-click Notepad and choose Run as administrator.
  3. Click Continue on the UAC confirmation window.
  4. Once Notepad opens, click File then click on Open.
  5. Then navigate to c:\Windows\System32\Drivers\etc
  6. Make sure you choose "All files (*.*)" from the drop down box towards the bottom right hand corner of the "open file" dialogue box.(It will likely default to Text Documents, when you initially open it)
  7. Then open the file called "hosts".
  8. Add the two line entries, as mentioned above.
  9. Click File and then click on Save to finish your changes.
For non windows environment, please consult your local IT Support provider.

Was this answer helpful?

« Back