24 hr Australian Support

How to Preview Your Website with the Hosts File Edit

Editing your Hosts file is the best way to preview a website you're building while the domain is hosted somewhere esle. It works by overriding the domain's A record from the view of your computer so your computer thinks the domain is live on our servers.

Your hosts entry will consist of the IP address of the server, and the domain name you wish to point it to.

For example: yourdomain.net.au www.yourdomain.net.au

You can find your server IP in the email we sent you which contains your cPanel or WHM login details.

How to Edit the Hosts File in Windows

Step 1 - Click Start, Type in Notepad then right click and hit Run as Administrator. Click Continue on the 'Windows needs your permission' window.


Step 2 - In Notepad, click File > Open, go to the C:\Windows\System32\Drivers\etc\ folder, click the box above Cancel and select All Files then click the hosts file and click Open


Step 3 - Start a new line at the bottom of the file and enter the new entry, ie yourdomain.net.au www.yourdomain.net.au


Step 4
- Save the file by going to File > Save in Notepad.

Note: You can disable this by adding a # to the start of the line you added.

How to Edit the Hosts File in Mac

Step 1 - Open the Terminal program (under Applications > Utilities)

Step 2 - Type in the following code: sudo nano /private/etc/hosts

Then type your password in if asked

Step 3 - Start a new line at the bottom of the file, and add the hosts entry, for example: yourdomain.net.au www.yourdomain.net.au

Step 4 - When finished, hit Control+O followed by ENTER/RETURN to save changes, then hit Control+X to exit out of editing the hosts file.

Step 5 - Type in this command and hit ENTER/RETURN: dscacheutil -flushcache

Step 6 - Close the terminal

Note: You can disable this by going back into nano and adding a # to the start of the line you added.