You are here: Home / kb / Modifying Your Hosts File

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:

  1. 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.
  2. In the search field type “notepad” and then right click on the program icon.
  3. Now select “Run as Administrator”
  4. Next you will need to open the hosts file location which can be found at the following file path:

%WinDir%\System32\drivers\etc\hosts

  1. 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:

 

UK Server

31.132.0.114 example.com

31.132.0.114 www.example.com

US Server

199.231.184.209 example.com

199.231.184.209 www.example.com

  1. Now you need to save the file in it’s existing location via either File à Save or CTRL + S
  2. 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:

  1. Firstly, you need to launch Terminal. This can be done by opening a Finder window
  2. Using the GNU nano text editor execute the command below:

sudo nano /etc/hosts

  1. 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:

 

UK Server

31.132.0.114 example.com

31.132.0.114 www.example.com

US Server

199.231.184.209 example.com

199.231.184.209 www.example.com

  1. To save your changes in the Nano text editor simply press Command + O together.
  2. To exit now press Command + X
  3. That’s it all done. Now clear you browser cache and you can see the website on the CHEAP HOST server for testing.

 

Call Now Button