Professional Documents
Culture Documents
How To View A New Website Using Your Hosts File
How To View A New Website Using Your Hosts File
How To View A New Website Using Your Hosts File
Getting started
Windows users
Mac users
Reversing the change
GETTING STARTED
T he best method is to use your computer’s hosts file to bypass the usual DNS lookup. T his forces your machine to view
the domain on the IP address that you specify. It will only work for your computer, so all other users will see the live version
of the site. Similarly, if you make this change on your phone, other machines and devices on your network remain
unaffected so you’ll still be able to view your live site on your smartphone.
WINDOWS USERS
In Windows 10 the hosts file is located at c:\Windows\System32\Drivers\etc\hosts.
Right click on Notepad in your start menu and select “Run as Administrator”. T his is crucial to ensure you can make the
required changes to the file.
Now click File > Open and browse to : c:\Windows\System32\Drivers\etc\hosts. If you can’t view any of the listed
directories you will need to configure Windows to show your hidden program or System Files as per the guide here.
Add a line to the bottom of the file the following lines, replacing IP_ADDRESS with the IP Address you took from the
Hosting Control Panel and DOMAIN_NAME with your domain:
For example:
You’ll now need to save the file and you’re done. You should be able to visit your site and view it as it appears on the new IP
address. You may need to refresh your browser cache to ensure you’re seeing the new version of the site.
You can always test that you’re seeing the site on the IP you wanted by pinging your domain or by browsing to
https://your-domain-name.com:8443. T his will open up the Plesk control panel for your site and will show Nublue
branding if you’re seeing a version of the site hosted with us. You can also see the hostname of the server in the name of
the tab you’ve opened. T his can be very useful in confirming that you’re looking at the correct version of the site,
especially if both the old and new version of the site are hosted with Nublue.
MAC USERS
If you’re on a Mac, the changes you’ll need to make to your hosts file are identical but the process for editing the file is
different.
You can use the Terminal application to edit your hosts file. To do this, open up Finder then Applications > Utilities >
Terminal.
From here you can use the following command to edit your hosts file:
You will have to supply your admin password for the Mac but you should be able to make any necessary amendments to
the hosts file. When you’re done, use Ctrl + O (followed by Enter) to save the file and then Ctrl + X to exit.
T his allows you to add and remove the line easily in future, but bear in mind you may be seeing a cached version of the site
in your browser when you make the switch. If in doubt you can make sure you’re not viewing a cached copy of the site by
using a different browser, or switching to incognito/private mode. If this fails, you can refresh your browser cache or even
flush your machine’s DNS cache.
LET'S TALK
DIS C US S YOUR NE E DS W I T H A N E X PE RT
© Nublue Ltd 2022 | Part of the CT I Group | Company Registration: 05523340 | VAT: 865693080