Cleaning hosts file

G

GotBonus?

Xp Pro all updates sercive packs.
Where do i find the hosts file, and WHATg should be in it, does anyone have
a clean example of what should be in it.
Is there an optimal way to "use" a hosts file?
thanks
 
R

R. McCarty

Hosts exists at \Windows\System32\Drivers\Etc

It normally contains a group of # Commented lines followed by
a LocalHost definition of 127.0.0.1.

A Hosts file supersedes a DNS translation. Used mainly to do
redirects for Ad Sites and similar. Instead of using your ISP's
Domain Name Server to translate Universal Resource Locators
into their unique IP Address, a Hosts file specifically translates a
URL to a IP Address locally on your PC.
 
G

GotBonus?

Details at http://www.GotBonus.com
R. McCarty said:
Hosts exists at \Windows\System32\Drivers\Etc

It normally contains a group of # Commented lines followed by
a LocalHost definition of 127.0.0.1.

A Hosts file supersedes a DNS translation. Used mainly to do
redirects for Ad Sites and similar. Instead of using your ISP's
Domain Name Server to translate Universal Resource Locators
into their unique IP Address, a Hosts file specifically translates a
URL to a IP Address locally on your PC.

Thanks

What should or shouldn't be in it, and do I really even NEED it.
Can it be deleted?
 
R

R. McCarty

Only the LocalHost definition of 127.0.0.1. Some folks make use
of customized Hosts files to redirect Ad/Spy-Ware sites by setting
their URLs to the LocalHost. ( Which when called does nothing).
There are a number of web sites that provide Host entries to block
Ads and Erotica. Just do a Google for Host Blocking.
 
G

GotBonus?

Details at http://www.GotBonus.com
R. McCarty said:
Only the LocalHost definition of 127.0.0.1. Some folks make use
of customized Hosts files to redirect Ad/Spy-Ware sites by setting
their URLs to the LocalHost. ( Which when called does nothing).
There are a number of web sites that provide Host entries to block
Ads and Erotica. Just do a Google for Host Blocking.


Thanks again, when i do a search for hosts i find the one you pointed to as
well as on in c:\WINDOWS called hosts1 that looks like this...
213.219.251.78 google.com
213.219.251.78 www.google.co.uk
213.219.251.78 google.co.uk
213.219.251.78 www.google.ca
213.219.251.78 google.ca
213.219.251.78 www.google.es
213.219.251.78 google.es
213.219.251.78 www.google.de
213.219.251.78 google.de
213.219.251.78 www.google.fr
213.219.251.78 google.fr
213.219.251.78 www.google.com.au
213.219.251.78 google.com.au
213.219.251.79 www.yahoo.com
213.219.251.79 yahoo.com
66.218.75.184 mail.yahoo.com
213.219.251.80 www.msn.com
213.219.251.80 msn.com
213.219.251.80 search.msn.com
213.219.251.80 www.search.msn.com
213.219.251.80 go.com
213.219.251.80 www.go.com

And one in the windows/system32/drivers/etc called imhosts.sam that wont
open with notepad...
What is that from and could it cause problems?
 
R

R. McCarty

The one from \Windows is definitely a redirect and should be
removed. LMHosts is a different module/function and is only
a "Sample" (.Sam). It likely won't open because the extension
has no association for opening it.
 
V

Vagabond Software

GotBonus? said:
Details at http://www.GotBonus.com



Thanks again, when i do a search for hosts i find the one you pointed to
as well as on in c:\WINDOWS called hosts1 that looks like this...

Delete the hosts1 file. It looks a hijack to me.

http://en.wikipedia.org/wiki/Hosts_file#Hijacking

You should ONLY have the 'localhost' entry in your hosts file in addition to
entries that YOU made. Any entries that YOU did not make with your own
fingers on your own keyboard should be immediately stripped out and no other
hosts files (except lmhosts) should be present in the directory.

carl
 
G

GotBonus?

Delete the hosts1 file. It looks a hijack to me.
Done.

http://en.wikipedia.org/wiki/Hosts_file#Hijacking

You should ONLY have the 'localhost' entry in your hosts file in addition
to entries that YOU made. Any entries that YOU did not make with your own
fingers on your own keyboard should be immediately stripped out and no
other hosts files (except lmhosts) should be present in the directory.

carl

Mine looks like this now...
# 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

Good?

Thanks all for the replies.
 
T

Tom [Pepper] Willett

Looks good.

Tom

GotBonus? said:
Mine looks like this now...
# 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

Good?

Thanks all for the replies.
 
A

Al Dykes

Xp Pro all updates sercive packs.
Where do i find the hosts file, and WHATg should be in it, does anyone have
a clean example of what should be in it.
Is there an optimal way to "use" a hosts file?
thanks

This is a nice discussion of the hosts file and I use the version
of the hosts file they distribute on a bunch of systems and it does
a lot to cut down on the crap.

http://www.mvps.org/winhelp2002/hosts.htm


If you've got factory-stock windows machine and you're not doing some
of your own customization then there shoule only be one entry;
localhost and it should point to 127.0.0.1

Anything pointing to 127.0.0.1 is harmless.


It gets updates once in a while. Check the website once in a while.
 
S

Steve N.

Al said:
This is a nice discussion of the hosts file and I use the version
of the hosts file they distribute on a bunch of systems and it does
a lot to cut down on the crap.

http://www.mvps.org/winhelp2002/hosts.htm


If you've got factory-stock windows machine and you're not doing some
of your own customization then there shoule only be one entry;
localhost and it should point to 127.0.0.1

Anything pointing to 127.0.0.1 is harmless.

Nuh-uh. Add:

www.google.com 127.0.0.1

to your hosts file and see if you can get to www.google.com.

:)

Steve N.
 
M

M8RIX

You can also utilize the hosts file for shortcuts as well.
Adding the line;
66.102.7.99 G
would take you to google.com whenever G was entered into the address bar.
 
J

Jim Byrd

Hi - FYI, here's a little supplimental info regarding the HOSTS file:

First, you should understand that the original purpose of the HOSTS file
(BTW, it should always be named this way - all caps, no extension) was to
provide a local (therefore fast) translation from URLs to IP addresses for
frequently visited sites (typically your Favorites). It can still be used
this way (I do so, for example - there are utilities available such as CIP,
http://dl.winsite.com/bin/downl?500000007704 which will convert your
Favorites to IP's which you can then saveas and then copy into your HOSTS
file), but has also come to be used to block ad/malware servers by
redirecting them to your local machine instead of their servers using this
same mechanism. See here for some good info about this use:
http://www.mvps.org/winhelp2002/hosts.htm

This site also has downloads for some utility programs which you will find
useful if you decide to use a HOSTS file such as RenHosts.bat,
http://www.mvps.org/winhelp2002/RenHosts.bat, and lockhosts.bat and
unlockhosts.bat, http://www.mvps.org/winhelp2002/lockhost.bat, and
http://www.mvps.org/winhelp2002/unlockhost.bat. The lock and unlock files
can be used to protect the HOSTS file in between UPDATES so that it doesn't
get hijacked by malware, while the rename hosts program will allow you to
easily enable or disable the HOSTS file (while keeping the correct naming
convention). An even better approach IMO which I use is HostMan, here:
http://www.abelhadigital.com/ which offers some other useful tools as well.

As to size/performance - with any relatively modern computer the delay added
by the HOSTS lookup overhead should be negligable for even moderately large
HOSTS files (typically 250KB to 500KB) used for ad/malware blocking. If you
use it also for DNS-to-IP caching as I refered to above, the time saved over
going out to the net for DNS lookups will offset this many times. If fact
you may notice some speedup in "normal" address browsing.

--

Regards, Jim Byrd, MS-MVP/DTS/AH-VSOP
My Blog, Defending Your Machine, here:
http://DefendingYourMachine.blogspot.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top