Search Our Database

How To Edit The ‘hosts’ File on Windows

Last updated on |

Introduction

Sometimes when we developing a website, we need to check either all the changes have been done before the website is in production. So, the easier and the fastest way to check if the changes take effect, we do have to edit the hosts file.

Prerequisites

Text editor application such as Notepad, Notepad++, Sublime, etc., with administrator privilege

 

1. Navigate to Start, then search for Notepad. After you have find the Notepad, right click on the application and choose “Run as administrator“. Pop up windows will show up and just select ‘Yes‘.

 

2. After the notepad have open, navigate to upper left and go to File tab, then select Open

 

3. Copy and paste the path below, or you can navigate to Local Disk(C:)  > Windows > System32 > drivers > etc. After you have navigate to the path, on the bottom right choose All Files (*.*)

C:\Windows\System32\drivers\etc

 

 

4. Select the hosts file and open the files with any text editor e.g. Notepad, Sublime, etc.,

 

5. Add the new IP address and your domain name that you want to test, as an example we choose testingcentos.com that pointing to IP 118.107.205.218. After the changes have been done, save it.

 

 

6: Browse the website to test it.