Knowledge Base

How do I setup my website before I point it to your servers? (Hosts File)

This article explains how to edit the hosts file on both Windows and Mac.

  • This allows you to customise where your domain points without relying on DNS.
  • Editing your hosts file allows your computer to load your domain from our server before propagation has finished. This allows you to view your website from our servers before the website goes live.

Here are the steps to change the hosts file on both Windows and Mac.

Windows XP, Windows Vista and Windows 7

1. Navigate to C:WindowsSystem32driversetc
hostfile1
2. Find the file called ‘hosts’ and open it. If prompted, specify that you would like to choose a program to open the file with from a list of programs. Choose ‘Notepad” from the list of available programs.
hostfile2
3. Add the following line to the end of the hosts file –
serverip domain.com www.domain.com
e.g 125.125.125.125 test.com.au www.test.com.au
hostfile3
4. Restart your web browser for the changes to take affect.

Mac OS X

1. Open the Terminal.app. This can be done by either typing Terminal in the Spotlight, or by going into Applications -> Utilities -> Terminal.
hostfile4 hostfile5 hostfile6
2. Open the hosts file by typing the following command in the Terminal –
sudo nano /private/etc/hosts
hostfile7
3. Add the following line to the end of the hosts file –

serverip domain.com www.domain.com
e.g 125.125.125.125 test.com.au www.test.com.au

hostfile8
4. When you have added the required line to the hosts file, press control-o to save the file. Press enter on the filename prompt and control-x to exit the editor.
5. Flush the DNS cache with the following command –
dscacheutil -flushcache
hostfile9

Complete: You will now be able to view your domain on the specific IP address.

Post a Comment