Modifying Your Hosts File
If you are moving to a new server and want to re-design a website whilst leaving the old site live on a different server, then one of the easiest methods is to simply modify your hosts file on your local machine.
Essentially by modifying the host file on your local machine, you are in effect tricking the pc into looking up your new server rather than referring to the traditional global DNS system by default.
In this guide we will show you how to modify your local hosts file on Windows and Mac:
Modify the Hosts File on Windows 10
Please follow the below steps to modify your hosts file using Windows 10:
- Firstly open the Windows Start Menu – this can be done by clicking the Windows button in the left hand bottom corner or by simply pressing the Window key.
- In the search field type “notepad” and then right click on the program icon.
- Now select “Run as Administrator”
- Next you will need to open the hosts file location which can be found at the following file path:
%WinDir%\System32\drivers\etc\hosts
- Once you have opened the file in the above directory, you will need to add the custom DNS data for CHEAP HOST. This will be as follows:
London, UK Server
31.132.0.114 example.com
31.132.0.114 www.example.com
Coventry, UK Server
185.103.96.26 example.com
185.103.96.26 www.example.com
US Server
199.231.184.209 example.com
199.231.184.209 www.example.com
- Now you need to save the file in it’s existing location via either File à Save or CTRL + S
- That’s it all done! Now you can just clear your browser cache and you will see how the site looks and works your new server for testing purposes.
Modify the Hosts File on macOS
Please follow the below steps to modify your hosts file using macOS:
- Firstly, you need to launch Terminal. This can be done by opening a Finder window
- Using the GNU nano text editor execute the command below:
sudo nano /etc/hosts
- Once you have opened the file in the above directory, you will need to add the custom DNS data for CHEAP HOST. This will be as follows:
London, UK Server
31.132.0.114 example.com
31.132.0.114 www.example.com
Coventry, UK Server
185.103.96.26 example.com
185.103.96.26 www.example.com
US Server
199.231.184.209 example.com
199.231.184.209 www.example.com
- To save your changes in the Nano text editor simply press Command + O together.
- To exit now press Command + X
- That’s it all done. Now clear you browser cache and you can see the website on the CHEAP HOST server for testing.