Advertisement
Tech

Correcting Windows Vista Hosts Files

This article explains the purpose of the Windows Host file, including editing or correcting Host file entries. This article applies to Windows 2000, XP and Vista. Users of Windows Vista need to know, and will be shown how to make modifications to the host file using Notepad in administrator mode.

By Mark Muller
Desk Tech
Reading time 3 min read
Word count 509
Windows platform Computing Windows hosting
Correcting Windows Vista Hosts Files
Advertisement
Quick Take

This article explains the purpose of the Windows Host file, including editing or correcting Host file entries. This article applies to Windows 2000, XP and Vista. Users of Windows Vista need to know, and will be shown how to make modifications to the host file using Notepad in administrator mode.

On this page

What is the Hosts File?

When you enter a Web site address in your browser, your computer starts the process of resolving the domain name (e.g. www.BrightHub.com ) to its IP address (e.g. 66.165.142.74). If for a given domain name your computer finds an entry is the Hosts file the name, resolution does not involve a DNS Server but returns the IP address found in the Hosts file.

In the dynamic World Wide Web it is usually better to leave the name resolution process to the DNS servers which are constantly updated. However, in a number of cases it makes sense correcting Windows Hosts files.

Advertisement

Example Windows Hosts File

The Hosts file is located in the %WinDir% directory, usually C:\Windows\System32\drivers\etc. It can be opened with a text editor such as notepad. Please find below the content of a Windows Vista default Hosts file:

# Copyright (c) 1993-2006 Microsoft Corp.

Advertisement

# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.

# This file contains the mappings of IP addresses to host names. Each

Advertisement

# entry should be kept on an individual line. The IP address should

# be placed in the first column followed by the corresponding host name.

Advertisement

# The IP address and the host name should be separated by at least one

# space.

Advertisement

# Additionally, comments (such as these) may be inserted on individual

# lines or following the machine name denoted by a ‘#’ symbol.

Advertisement

# For example:

102.54.94.97 rhino.acme.com # source server

38.25.63.10 x.acme.com # x client host

127.0.0.1 localhost

Advertisement

::1 localhost

Adding an Entry to Hosts File

127.0.0.1 is the loop-back IP address of your local computer. So if we inserted the fictive domain UglyAdServer.com

Advertisement

127.0.0.1 www.UglyAdServer.com

127.0.0.1 UglyAdServer.com

Advertisement

we could prevent nasty ads from showing up while browsing the Web, or stop malicious software from phoning home for example. That way you can in fact block access to all websites using Hosts files. Just make sure you really want to block a domain or send your Web requests to a hard-coded IP-address (e.g. 102.54.94.97 for rhino.acme.com ).

Correcting Hosts Files

Assume rhino.acme.com, the example domain Microsoft has put in the Hosts file, was a bogus entry and not commented out. Each time you entered rhino.acme.com in your browser you could be taken to a phishing site! Therefore, you would correct suspicious entries in Hosts files by adding a # or deleting the line.

Advertisement

By the way: Top Anti-Spyware/Antivirus programs such as Webroot 6.1 featured in Bright Hub’s review Webroot AntiVirus with AntiSpyware 6.1 prevent unauthorized modification of your Hosts file.

Correcting the Windows Vista Hosts Files

To make any corrections to Windows Vista Hosts files, one has to open Notepad in Administrator mode: Right-click %SystemRoot%\system32\notepad.exe and select Run as administrator; the %SystemRoot% folder usually is C:\Windows. Then go to %WinDir% \System32\drivers\etc and make any modifications you want to Hosts files. Don’t forget to save your modifications using File –> Save!

Advertisement

For more on Windows Host File tweaking, read Modifying the Hosts File in Windows Vista .

References

  • Author’s own experience
Keep Exploring

More from Tech

Filed under
Windows platform Computing
More topics
Windows hosting
Advertisement