Creating a Hosts File Entry

If you wish to access your website before your DNS has been updated you can update your local hosts file, which will allow your computer to view your new website. Follow the appropriate instructions below replacing <your-website-name> with the domain name you have for your new website (e.g. my-new-website.com)

OSX:

    1. Open Terminal
    2. Type ‘sudo nano /private/etc/hosts’
    3. Press Ctrl+Shift+V to take you to the end of the file
    4. Enter the text ‘xxx.xxx.xxx.xxx <your-website-name>’ replacing the xxx’s with the correct IP address for the server which hosts your website, and replace <your-website-name> with the domain name for your website, eg. my-new-website.com
    5. Press Ctrl+x to exit
    6. Press y to save

Example host file entries:

# Text from a "#" character until the end of the line is a comment, and is ignored
127.0.0.1       localhost

# example format
# xxx.xxx.xxx.xxx    <your-website-name>

# access my website before the DNS is working
192.0.2.175     my-new-website.com

Alternatively, you can download the macOS Hosts preference pane helper from here:
https://github.com/specialunderwear/Hosts.prefpane/

Windows:

    1. Click “Start” button
    2. Click “All Programs”
    3. Click “Accessories”
    4. Right-click on Notepad and then click Run as administrator.
    5. If you are prompted for an administrator password or for a confirmation, type your password, or click Allow/Yes.
    6. Open the Hosts file. Discover the location for your version of windows here (https://en.wikipedia.org/wiki/Hosts_(file)#Location_in_the_file_system
    7. Enter the text ‘xxx.xxx.xxx.xxx <your-website-name>’ replacing the xxx’s with the correct IP address for the server which hosts your website, and replace <your-website-name> with the domain name for your website, eg. my-new-website.com
    8. Click Save on the Edit menu. (If using Windows 7, you will need to click Save on the File menu.)

How to locate your hosting server IP address

Please read this article on How to locate your hosting server IP address