Step-1: Windows 8 or 10 makes it annoying to open apps as administrator — but it’s not too difficult. Just search for Notepad, then right-click on Notepad in the search results list, and choose to run it as administrator.
Step-2: If you’re using Windows 10 this will be on the Start Menu.It looks like this
Step-3: Once you’ve done so, open up the following file using the File -> Open feature.
Then you can edit as normal.
To access the hosts file in Windows 7 you can use the following command in the Run Line to open notepad and the file.
Step-4: Once notepad is open you can edit the file. In this example we will add knrconsulting and knrglobal. To do this just enter in the following after the # mark.
and then save it.
Step-5: open cmd and use following command
example ping knrconsulting.co.in
and hit enter
Step 6: You will see the ip which you have wrote on host file with time.
Step 7: Test your website
Step 8: Now please remove it after tesing. as you can see above image and save the file like before.