Kicken Hardware Computer Help Forum  

Go Back   Kicken Hardware Computer Help Forum > Computer Help Desk > Windows XP

Notices

Windows XP Problems and questions relating to Microsoft's widely used operating system

Reply
 
Thread Tools Display Modes
  #1  
Old 07-20-2006, 10:53 AM
rVidia rVidia is offline
Senior Member
 
Join Date: Jun 2006
Posts: 557
How-To: Edit your HOSTS file in XP

Please note this post only pertains to machines with Windows XP installed.

Access is prevented to the websites listed in your HOSTS file, so if you're irritated by a particular pop-up, for example, you could simply add the website it’s coming from to your HOSTS file.

The first step in editing your HOSTS file is to find it.

My Computer > C: (or whatever drive Windows is on) > WINDOWS > system32 > drivers > etc > hosts

Note: If you aren't sure where My Computer is or you just want to use a keyboard shortcut to open it, you can hold down the Windows key (which looks like this) on your keyboard while you press the “E” key.

Right-click on the HOSTS file, and click Open. A window will appear asking what to open it with; find Notepad, select it, and click OK.

If you've never edited your HOSTS file before, this is what it should look like:

# Copyright (c) 1993-1999 Microsoft Corp.
#
# 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
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# 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

You'll notice all entries begin with “127.0.0.1”; all entries MUST begin with this. If a website is preceded by “127.0.0.1”, this means the website cannot load and is blocked. The first entry in the HOSTS file is “127.0.0.1 localhost”. Your HOSTS file MUST begin with that entry.

To add websites to your HOSTS file (to block them), use this as a guideline:
Code:
127.0.0.1 www.blockthiswebsite.com
After you've edited your HOSTS file, save the changes made (File > Save).

You’re done!

Optional but recommended:

If you would like to use a pre-made HOSTS file, I recommend you use the MVPS HOSTS file. This HOSTS file blocks websites with ads/banners, parasites, hijackers, and unwanted search engines.

Quote:
Originally Posted by MVPS.org
In many cases using a well designed HOSTS file can speed the loading of web pages by not having to wait for these ads, annoying banners, hit counters, etc. to load. This also helps to protect your Privacy and Security by blocking sites that may track your viewing habits, also known as "click-thru tracking" or Data Miners. Simply using a HOSTS file is not a cure-all against all the dangers on the Internet, but it does provide another effective "Layer of Protection".
If you would like to use the MVPS HOSTS file, open your HOSTS file and delete everything in it. Copy everything in the MVPS HOSTS file (a quick way to select everything is Ctrl+A, then right-click > Copy). Once everything is copied, paste it into your HOSTS file (right-click > Paste). Then, you can save.

Optional but recommended:

I would also suggest you make your HOSTS file read-only. This is not necessary, but by doing so, it makes it harder for malicious software to modify your HOSTS file. To make your HOSTS file read-only:

1) Right-click on the HOSTS file
2) Click Properties
3) You will see a window open. Look at the bottom of the window. To the right of Attributes, check the box that says Read-only.
4) Click Apply/OK.

Note: When your HOSTS file is read-only, you cannot make any changes to it (setting it to read-only helps in preventing modifications to the file), so if you want to add a new entry to your HOSTS file later on, you'll have to uncheck the Read-only box before you edit; you can then set it back to read-only when you're finished.

Last edited by rVidia; 08-01-2006 at 11:08 AM.
Reply With Quote
  #2  
Old 07-20-2006, 11:45 AM
Tortanick's Avatar
Tortanick Tortanick is offline
Distinguished Member
 
Join Date: Jul 2006
Location: London, UK
Posts: 1,600
Re: How-To: Edit your HOSTS file in XP

Shoudln't this be in Tips and Tricks?

Also I think the readers would benifit from some precompiled hosts files that block access to sites with known drive by downloads.

Finally there is a service called DNS client, if your hosts file gets too big this supposedly causes lag. according to mvps.org. Wikipedia disagrees saying that the hosts file will be ignored if the DNS client is run

Last edited by Tortanick; 07-20-2006 at 11:49 AM.
Reply With Quote
  #3  
Old 07-20-2006, 12:16 PM
rVidia rVidia is offline
Senior Member
 
Join Date: Jun 2006
Posts: 557
Re: How-To: Edit your HOSTS file in XP

Tortanick:

I believe the MVPS HOSTS file blocks access to known websites with drive-by downloads. How to use this HOSTS file is explained in my first post.

As far as the DNS client...

Quote:
Originally Posted by MVPS.org
Editors Note: in most cases a large HOSTS file (over 135 kb) tends to slow down the machine. This only occurs in W2000 and XP. Windows 98 and ME are not affected.

To resolve this issue (manually) open the "Services Editor"
Start | Run (type) "services.msc" (no quotes)
Scroll down to "DNS Client", Right-click and select: Properties
Click the drop-down arrow for "Startup type"
Select: Manual, click Apply/Ok and restart.

You can see that the above "Service" is not needed (after a little browsing) by opening the Services Editor again, scroll down to DNS Client and check the "Status" column. It should be blank, if it was needed it would show "Started" in that column.
This makes perfect sense. For instance, I have the Application Layer Gateway Service set to Manual. If I open the Services Editor, it is "Started" under the Status column. When DNS Client is set to Manual, it is blank; it is not necessary - if it was, it would also be "Started"

I personally have the DNS Client set to disabled and have no problems. Thanks for pointing that out.
Reply With Quote
  #4  
Old 07-21-2006, 01:55 PM
Rob (kern)'s Avatar
Rob (kern) Rob (kern) is offline
Global Moderator
 
Join Date: Jan 2005
Location: NJ
Posts: 3,280
Re: How-To: Edit your HOSTS file in XP

Quote:
Originally Posted by Tortanick
Shoudln't this be in Tips and Tricks?
yep. done,

btw, excellent post Ray!
__________________
~Have we helped you? Like it here? Why not Contribute... 'Donate'~

Main Rig: Antec P180 w/Earthwatts Ea430; MSI 785GM-E65 w/onboard ATI 4200; AMD Phenom IIX3 720; Crucial Ballistix DDR3 1333 2x1G; Western Digital VelociRaptor 150 & Caviar Black 640; Memorex DVD-DLRW16; IBM M 86 Key; Logitech Trackman; Altec Lansing FX2020; Philips 3000 19"; Microsoft Windows 7 Ultimate x64
"String and tape...the forgotten technology"
Reply With Quote
  #5  
Old 07-23-2006, 01:01 AM
rVidia rVidia is offline
Senior Member
 
Join Date: Jun 2006
Posts: 557
Re: How-To: Edit your HOSTS file in XP

Thanks for the kind words, kern.

I've decided to attach my original document (zipped) if anyone is interested in reading it. It is primarily my first post and various posts after that but only slightly more complex. There's also some additional information I wrote up, including how to make a very simple HOSTS file editor (basically a desktop shortcut to open up the HOSTS file in Notepad). It's a four page document, although it's probably more like 2 - 2 1/2 if you take out spacing.

Again, I appreciate all the input

Ray
Attached Files
File Type: zip How-To.zip (4.8 KB, 36 views)

Last edited by rVidia; 10-20-2006 at 07:45 PM.
Reply With Quote
  #6  
Old 07-23-2006, 08:31 PM
dale@fcg dale@fcg is offline
Senior Member
 
Join Date: Feb 2005
Location: NE Phillly -cheese steak capital of US
Posts: 684
Re: How-To: Edit your HOSTS file in XP

I have a host and a host.tmp file. Which one do I want to append?

Also, what sites can I visit to test that ads and popups are blocked?

Lastly, how do I determine the address of an add within a window, such as the lousy Circuit City add I was fighting last
Wed in Paltalk?
__________________
Dale W
Reply With Quote
  #7  
Old 03-20-2010, 09:04 PM
jaydeee's Avatar
jaydeee jaydeee is offline
Rising Star
 
Join Date: Feb 2010
Posts: 20
Re: How-To: Edit your HOSTS file in XP

this is old and effective guide

I like the idea of controlling things on my side rather than expensive other setup.
thanks
Reply With Quote
  #8  
Old 07-20-2006, 01:52 PM
Tortanick's Avatar
Tortanick Tortanick is offline
Distinguished Member
 
Join Date: Jul 2006
Location: London, UK
Posts: 1,600
Re: How-To: Edit your HOSTS file in XP

I know what the MVPS hosts file dose, I'm one satisfied user

I just think that while your guide is usefull a breif metion of one or more premade hosts files wouldn't go amis
Reply With Quote
  #9  
Old 07-20-2006, 02:09 PM
rVidia rVidia is offline
Senior Member
 
Join Date: Jun 2006
Posts: 557
Re: How-To: Edit your HOSTS file in XP

Thanks for the input! I added a brief description of the MVPS HOSTS file and instructions on how to use it.

I also deleted one of my posts and incorporated it into my first post (the "Note" at the end).

Last edited by rVidia; 07-20-2006 at 04:59 PM.
Reply With Quote
  #10  
Old 07-20-2006, 04:07 PM
Tortanick's Avatar
Tortanick Tortanick is offline
Distinguished Member
 
Join Date: Jul 2006
Location: London, UK
Posts: 1,600
Re: How-To: Edit your HOSTS file in XP

Your welcome
Reply With Quote
Reply

Go Back   Kicken Hardware Computer Help Forum > Computer Help Desk > Windows XP

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 08:10 PM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright © 2005-2010 KickenHardware.net / Olympus Technology Group, LLC