Home How to how to edit hosts file windows 7? - get complete details

how to edit hosts file windows 7? – get complete details

The hosts file is a part of the operating system on your computer that maps hostnames into IP addresses. This file is like a telephone book for your computer. It converts human-friendly hostnames to IP addresses your machine can understand. It may be necessary to edit this file for testing, troubleshooting or blocking websites. Here’s the guide to editing the hosts file on Windows 7.

What exactly is the host file?


The hosts file is a text file in ASCII format that matches IP addresses with hostnames. Your computer will default to refer to the hosts before contacting the DNS servers on the internet. You can override DNS on your local computer by using the hosts file.

Find the hosts file in Windows 7

Path To Hosts File

In Windows 7, the hosts file is located at C:\Windows\System32\drivers\etc\hosts. The file is hidden, and you need administrative rights to view and edit it.

Editing the hosts file

Be sure to create a copy of your hosts file before you make any changes.

Open Notepad as Administrator

You will need to use a text editor that has administrative rights in order to edit the hosts file. Search for Notepad, click on it and choose ‘Run As Administrator’.

Open the hosts file in

In the Notepad, go to File > Open, and navigate to the location of the hosts file (C:\Windows\System32\drivers\etc\). Type hosts in the filename and click Open.

Edit the hosts file

You will find a host file that contains comments (lines beginning with ‘#’), followed by IP addresses and hosts). You can block a particular website by adding a line to the end of your hosts file. Enter followed by the URL.

Save your changes

To save your changes, click File > Save. If you have trouble saving, ensure that you are running Notepad with administrator rights.

Validating changes and troubleshooting

Clear the DNS Cache

You should flush the DNS cache after editing your hosts file to ensure that your changes are immediately applied. Enter ipconfig and press Enter.

Check your changes

You can use the Command Prompt to ping the hostname that you added in the hosts file. You should see the IP address of the hostname if you mapped it to


You should check your administrative rights and make sure you typed in the filename and path correctly if you run into problems. Check your antivirus and firewall settings as certain software may block system file changes.


The hosts file allows you to control the way your system interacts on the Internet. It should, however, be used with caution. Create a copy of your document before you edit it. If you are unsure, you may want to seek professional advice. 


Please enter your comment!
Please enter your name here

Must Read

Who Is Rebecca Ludlam, Charles Hanson Wife? Read All Facts Here

In the world of antiques and auctions, Charles Hanson stands tall with his remarkable expertise and endearing charm. Alongside his professional accolades,...

Rabiya Mateo New Boyfriend Jeric Relationship Read All Facts Here

Hailing from the Philippines, Rabiya Mateo is an icon in the world of beauty pageants, recognized for her unmatched grace, intelligence, and...

Gillian Keegan Brother Marx Gibson Sister Sarah All Things You Need To Know

Gillian Keegan is not just another name in British politics; she’s a force to be reckoned with. Elected as the Member of...

Has Nick Eardley Been Promoted At BBC? Get Complete Details

Nick Eardley is no ordinary journalist based out of London; instead, he stands as one of the key forces in journalism today....

Correspondent Henry Zeffman Discover The All Facts Here

Henry Zeffman is a distinguished journalist from the UK who has amassed recognition in the field of political reporting. From his remarkable...