Modifying your computers hosts file to test your website Print

  • 0

Modifying your computers hosts file allows you to "trick" your computer in to loading your domain name directly from our servers rather than where your domain may currently be pointed. 

This is especially handy when you are creating a brand new site on a new server while you have another live. 

You can also make use of our temporary URL feature, however we recommend modifying your hosts file for the best testing results. 

You will need to follow the steps below on how you can access and modify your hosts file on your local device and enter your server IP address followed by your domain name at the bottom of the file. 

Your entry will look like this with your domain and IP address replacing the information:

12.123.12.123 yourdomain.com www.yourdomain.com

You will need to ensure that you have both your domain and the www. subdomain are included. 

Your hosts file will look like this once completed with some differences between operating systems: 

# 127.0.0.1 localhost
# ::1 localhost


12.123.12.123 help.com.au www.help.com.au

 

Windows 8-10

  1. Press the Windows key.
  2. Type Notepad in the search field.
  3. In the search results, right-click Notepad and select Run as administrator.
  4. From Notepad, open the following file:
    c:\Windows\System32\Drivers\etc\hosts
  5. Make the changes to the file.
  6. Select File > Save to save your changes

 

Mac OSX

  1. On your computer, select Applications > Utilities > Terminal to open a Terminal window.
  2. Enter the following command in the Terminal window to open the hosts file
    sudo nano /private/etc/hosts
  3. Enter your password and press Enter on your keyboard
  4. A text editor will open within the Terminal window, 
    The file contains comments (lines that begin with the # symbol) and some default host name entries (for example, 127.0.0.1 – local host)
    Under these comments are where you will need to input the hosts file entry listed above.
    You will need to use the arrow keys in order to navigate this screen.
  5. Once you have updated the file press CTRL + O on your keyboard and Enter to confirm and save the file.
  6. Press CTRL + X to close the file

 

Linux

  1. Open a Terminal window.
  2. Enter the following command to open the hosts file in a text editor:
    sudo nano /etc/hosts
  3. Enter your password and press Enter on your keyboard.
  4. Make the necessary changes to the file.
  5. Press Control-X.
  6. When you are asked if you want to save your changes, enter y.

 

If you are having trouble with your hosts file, feel free to get in touch with us via a ticket or over LiveChat and we will be happy to Help!


Was this answer helpful?

« Back