24 hr Australian Support

How to Preview Your Website with a Hosts File Edit

Editing your Hosts file is the best way to preview a website you're building while the website is hosted somewhere else. When a site is loaded using a browser, your computer will check in its Hosts file before doing a DNS lookup to find the correct server. This means that while other people will not see anything different, you can force your computer to load any domain from any server.

Your hosts entry will consist of the IP address of the server, and the domain name(s) you wish to load from that IP.

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

You can find your server IP in the email sent to you when you signed up with us, which contains your Hosting account login details.

How to Edit the Hosts File in Windows

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


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, i.e. 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, or by removing the text.

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 repeating steps 1 and 2, and adding a # to the start of the line you added. You could also delete the line from the hosts file and save your changes.