How to Edit a Local Hosts File on Windows

How to Edit a Local Hosts File on Windows

This simple guide is designed to help you view a website that’s still under development. We will be teaching you how to edit a local host file, allowing you to view your website, that isn’t yet live from your PC. This can easily be done by simply adding an entry to your local host file using Notepad.

Windows User Guide

How to Edit a Local Host File

Firstly you need to open Notepad by selecting it from the Start Menu. If you are using an older version of windows you can do this by selecting Start > All Programmes > Accessories > Notepad. Ensure you are using ‘Notepad’ and not Notepad+ as only ‘Notepad is compatible for editing host files. You will then need to right click on Notepad and choose the option of ‘Administrator’ from the list. This allows you to access Administrative privileges.

You will then need to right click on Notepad and choose the option of ‘Administrator’ from the list. This allows you to access Administrative privileges.

image1

Next, click ‘File’ and select ‘Open’ from the drop-down menu. A pop-up will appear where you should select the option (C:\Windows\System32\drivers\etc)

image2

image3

On the bottom right drop down menu select the option ‘All Files’ then choose the folder labelled ‘Hosts File’

image4

image5

This will then open in a new window and look something like this:

image6

Finally, to view your site as if it was live, you’ll need to add your IP and Host at the end of the file text. When doing this, follow the same layout as the previous text that’s already there. Don’t forget to save the changes you’ve made.

To view your site as live you will need to clear your browser cache history and then load the site address.

If you have followed this process but the old website is still showing, we recommend that you close Notepad and follow the above steps again.

Returning to the Original DNS View

When you want to return to the public domain name system you should remove the changes you’ve made to the local host file and then save the new changes. You will then have to clear your cache again within your web browser and reload the website.

The Easy Way to View Your Website

We hope you’ve found this guide to help you edit a local host file has been helpful and that you are now able to view your website while it’s being developed. We have mainly focused on using windows within this guide, but if you are a Mac user, we recommend you refer to this guide on Editing Local Host Files on Mac to help you.

Primal Space offers a wide variety of digital services to suit your website requirements. Contact us to find out more about how we can help you design your new e-commerce website today. We also offer additional, individually priced, support packages for Magento and WordPress to suit your needs.