How To Edit hosts file in Windows

Editing hosts file in windows

Host file in windows is used to map ip address into the its name. By using hosts file we can refers any particular IP address by using the name we specified.

the hosts file contains lines of ip address and its name for example localhost

so every time we use ‘localhost’ in any networking activities in our laptop, this will be translated into, which is our loopback ip address, ip address belongs to our own laptop/pc/device.

How to edit hosts file
editing host file in windows is as simple as adding new lines containing ip address, space, and name we want to refer.

for example i want to add ip address which i want it be referred by college.
just add it below the existing line localhost collage office

the steps :

1. the hosts file is located in C:/Windows/System32/Drivers/etc/
it is file with no extension

2. To open this file, you will need administrator privilege, so you need to open it using any word processor that has administrator privilege confirmed.
for example we can use notepad, but when we want to run notepad,
first, do the right click on notepad icon, then choose ‘run as administrator’, choose yes when dialogue appear

3. in menubar choose File > Open, look for C:\Windows\System32\drivers\etc
if you don’t see any file, make sure you choose *All File in file type option

How to edit hosts file in Windows 7
How to edit hosts file in Windows 7

4. You will find the hosts file, choose it, and open. Add the ip address and name you want and save those notepad using Ctrl+S.

Blocking web address using host file

Other simple use of Hosts file in windows and other operating system is to block web address. This can be done by pointing any web address which is inn their domain name, to our local ip address. for example, we want to block and Then just add in our hosts file

it will point to, our own ip address. so it will not reach the real and display nothing in the web browser

Leave a Reply

Your email address will not be published. Required fields are marked *