How to preview your website using hosts files

This article will show you how to preview your website files on your hosting account.

If you want to see how your website appears before assigning a domain to your hosting account, simply follow the instructions outlined below.

Please note: before getting started, you will need to obtain your IP address. If you’re not sure where to find this, please read the following article: How can I find the IP address/temporary URL for my hosting account?

Step 1 of 5

Start by finding your hosts file. Check the table below to see where to find them within your operating system:

OSHosts File Location
Windowsc:\windows\system32\drivers\etc\hosts
Mac/private/etc/hosts
Linux/etc/hosts

 

Step 2 of 5

Open your hosts file with a text editor like Notepad++. Do not use Microsoft Word as this could lead to incompatibility and technical issues.

Step 3 of 5

Add the following entry to your hosts file:

[your hosting account's IP address] [your domain name] [your domain name with www.]

Be sure to change this to feature your details (i.e. 12.34.56.7  your-domain.co.uk  www.your-domain.co.uk)

Step 4 of 5

Save these changes and then access your domain name within your web browser.

Step 5 of 5

You will now be able to preview your website. Once you’re finished, be sure to remove the entry you previously added to your hosts file.