1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

How to Edit the Hosts File

By

Business man working on computer
AMV Photo/Digital Vision/Getty Images

The HOSTS file is the virtual equivalent of the phone company's directory assistance. Where directory assistance matches a person's name to a phone number, the HOSTS file maps domain names to IP addresses. Entries in the HOSTS file override DNS entries maintained by the ISP. This makes the HOSTS file a common target of malware. By modifying the HOSTS file, malware can block access to antivirus updates or force you to a malicious website. It's a good idea to check the HOSTS file periodically. Here's how to find - and edit - the HOSTS file on Windows 7, Vista, and XP.

Difficulty: Easy
Time Required: Less than 10 minutes

Here's How:

  1. Open Notepad

  2. Click File | Open in Notepad and browse to:
    C:\Windows\System32\drivers\etc

  3. Make sure the etc folder is highlighted (selected). Now change the file type so it reads "All files". You should now see the HOSTS file appear in the directory list.

  4. Double-click the HOSTS file and it will open in Notepad for editing.

Tips:

  1. In Windows 7, you will not be able to save edits to the HOSTS file unless you open it directly from Notepad (follow the steps described above).

  2. If you have difficulty saving the modified HOSTS file, check the file's attributes to see if it's been marked Read Only.

Related Video
Edit Clips in Windows Movie Maker
  1. About.com
  2. Technology
  3. Antivirus Software
  4. Windows Security Guides
  5. Windows Tutorials
  6. How to Edit the HOSTS File in Windows 7, Vista, and XP

©2014 About.com. All rights reserved.