Hosts File Changes

29 October 2019 by

John Speed

What are Hosts Files?

Often when previewing a website before it goes live you may be required to trick your computer into thinking that a website is on a different server to where the live site is.  To do this you will need to edit the host file.

Modifying Hosts Files

For Windows 10 and 8

  1. Press the Windows key.
  2. Type Notepad in the search field.
  3. In the search results, right-click Notepad and select Run as administrator.
  4. From Notepad, open the following file: c:WindowsSystem32Driversetchosts
  5. Make the necessary changes to the file.
  6. Click File > Save, to save your changes.

See below for an example of a hosts file.

You can add an entry by providing the the following

[your hosting account's IP address] [your domain name]
For example: 
12.0.0.1 sampledomain.com
[top_tip]Once you are done testing the website. Remove it again on the hosts file or include a hash symbol (#)  before the IP address to comment the line out.[/top_tip]

Never change the below lines:

127.0.0.1      localhost
::1            localhost

I didn’t know it could do that!

Discover more about the tech you use with the latest news and tips delivered straight to your inbox.

TELL US WHAT YOU NEED

Arrange a 15 minute call to discover how IT could work harder for your organisation.

Don’t let your business
fall behind.

Get the latest tips, alerts and best practice advice, delivered straight to your inbox.