There was a problem loading the comments.

Modifying your local hosts file (Windows)

Support Portal  »  Knowledgebase  »  Viewing Article

  Print

In this tutorial you will be shown how to modify your local hosts file, this is a simple Windows tweak that is used to trick your computer into resolving to a specific IP. This is useful after a migration, as you are able to browse and test your website on our servers before changing over your nameservers/DNS.

Windows

Step 1: Open up Notepad to Run as Administrator

You will need to open up notepad as an administrator to be able to edit the hosts file.

Notepad is located in Start > Press Start on the keyboard >Â Type Notepad in the search field.



b22f4ac32e5936e82e2652c1fc0f7cf09057974ffe4bfe34a5c342fb8898437e47aab5866643a443?t=3dcddab67ac9f4001da998122203889c


Right click on notepad, and select "Run as Administrator" - This will then open up notepad.



25e679f0d4535b8a3508874ff863de4fd97058c9c5e775b402efea522cc411251c100bcb6152e5f2?t=e265f9011fee24ebb65eb76126d6169a



Step 2: Locating the hosts file



Click on File > Open in notepad, and paste in this directory under "File Name" : %systemroot%\system32\drivers\etc\hosts and press enter or click "Open" (you may need to change the dropdown below to all files).


29bccf4760074d64e875af2051471c67d42f8c316dfe0a74b7599af6bba5dd2eed709357521381b2?t=cec10934600a507c540eeeb6474a393f



Step 3: Editing the hosts file

The file will now open up for editing.


fac9f2794d7b97c7ade56abd1e85cab245b740e7e61d3e57165531cd492495080b3643a771dec284?t=0c66dd3b32a45811180425d5ebdec2d9


You can place the IP address and the domain name at the bottom of file. We will provide you with the IP address you will need to use.


The IP address will go first, followed by a space, followed by the domain name you are testing.  Example:

217.194.210.113 www.example.com

217.194.210.113 example.com

Once you have entered this in, and your file looks something like the image above, save the file.

Finally save the file. File > Save.



Your domain name will now point to that IP address. You might need to clear your cache- try closing and re-opening your web browser- before the changes take effect.

Once you have finished testing your website be sure to remove the line you added, and re-save the hosts file.



Share via

Related Articles

© Hosting UK