How to Preview your Website using Host Files on Development Machine

Sometimes you need to preview your website files on your computer or development machine prior to uploading files to your live hosting account. You can do this by adding entries to the hosts file on your local computer. Keep in mind that we do not support modifying your system files, you are doing so at your own risk.


  1. Start by finding the location of your host file:
OSHost File Location
Windows (10, 8, 7, XP, etc.)c:\windows\system32\drivers\etc\hosts
Macintosh OS X/private/etc/hosts
Linux/etc/hosts

2. Now, add an entry to your host file for your domain and hosting account using the following format:

[Loopback Address] [your domain name]


For example:

127.0.0.1     coolexample.com     www.coolexample.com


3. Save the changes to your host file and navigate to your domain name using your preferred browser. The website files on your hosting account will load, allowing you to preview your website.

Warning: After you are done previewing your website, and point your domain name to your hosting account, be sure to remove the entry from your hosts file. If you do not remove the entry and change plans or servers in the future, you will not be able to view your site.

What is a Loopback Address?

A loopback address is a special IP address, 127.0.0.1, reserved by InterNIC for use in testing network cards. This IP address corresponds to the software loopback interface of the network card, which does not have hardware associated with it, and does not require a physical connection to a network.

The loopback address allows for a reliable method of testing the functionality of hardware, software & websites without a live hosting account. It also allows information technology professionals to test IP software without worrying about broken or corrupted drivers or hardware.

Thanks for visiting. For queries and suggestions, emails are welcome at learnweb@hostingcolumn.com.

Subscribe to Hosting Column for latest updates and posts.