What is the HOSTS file?

J

Jan Il

Hi BoB,

BoB said:
Update notifications and discussions on the HOSTS file are most
common in alt.privacy.spyware.


To prevent ads from consuming download time on some internet sites
but more importantly to block parasites, hijackers, etc.


Many users find the HOSTS file quite invaluable. It does not
create files but needs updating to maintain its effectiveness.

I tried three different HOSTS files ranging from 150k to >500k.
Coolwebsearch has over 10,000 sites\servers but it's unnecessary
to block 'each' of them in a HOSTS file. This is also true of
many other multi-site ad servers. Some HOSTS files appear to take
a more conservative approach than others. Since each of the three
HOSTS files were equally effective and none caused a noticeable
system slowdown, I have been using the smallest for the past year.
http://www.mvps.org/winhelp2002/hosts.htm

I also found some tiny batch files that are handy for working with
the HOSTS file. If you think your HOSTS file 'might' be interfering
with access to a web site, you can use Renhosts to toggle the HOSTS
file on and off. Also, since the HOSTS file should be read-only,
http://www.mvps.org/winhelp2002/RenHosts.bat

Unlockhost.bat and Lockhost.bat can be used to toggle the HOSTS file
attributes on and off for easy updating. There are 'programs' and
more complicated methods to do this, which is true of most functions.
The choice is yours.
(for Win98\ME)
http://www.mvps.org/winhelp2002/LockHostsME.bat
http://www.mvps.org/winhelp2002/UnlockHostME.bat
full instructions, here:
http://www.mvps.org/winhelp2002/hosts.htm

Many users also believe there is merit in using a reasonably small
restricted sites list for IE security. The restricted sites list
I chose to use is developed from data within the HOSTS file above.
http://mvps.org/winhelp2002/restricted.htm

Although OT for your question, I also recommend Spyware Blaster.
It is for spyware prevention, not a clean-up program like Adaware
and SpybotSD. It protects without consuming 'any' resources and has
an auto update function.
http://www.wilderssecurity.com

And if you haven't been there yet, don't forget the most important
site of all.
http://www.claymania.com/safe-hex.html

Thank you very much for your time to provide such detailed information and
informative array of links. I truly appreciate it. I am getting a much
better understanding of this feature, and it's advantages.

Jan :)
 
J

Jan Il

Hi Duane!

Duane Arnold said:
The list is short more like on the minus side. But today, I have actually
learned something from this NG. <g>

Ah...learning...it does a mind good. I always learn something from this
newsgroup. :)
Thanks Jan for making this inquiry! <g>

You're welcome. ;-)

Jan :)
 
J

Jan Il

Hi YoKenny :)

YoKenny said:
This HOSTS file has a bit over 21,000 validated entries. The only major
performance hit is if you run Win2K/XP with its DNS service enabled. The
DNS Service needs to cache the HOSTS entries and will stall for a while
doing this. The DNS Service is not needed and can be set to Manual by the
Services Manager.

I am not a power user of the Internet, but a very basic user, meaning that I
only go there for specific information, and do not just surf or browse.
Could I use those sites in my Favorites? These are the sites I use all the
time, as they cover most all the information and search/research sites I
need to access. The only exception may be when I am troubleshooting or
looking for a one time source of information. I have read the information
and related links generously provided here in this thread, yet, I am afraid
that this is still an area that I don't fully understand. Also, I am not
that familiar with the Internet setups and connections/communications, etc.
How would I know if I did or didn't need the DNS? Is there some
instructions/information on how to determine such things in the settings or
configurations a user would need when setting up their HOSTS files?

Jan :)
 
R

Richard Steven Hack

I am not a power user of the Internet, but a very basic user, meaning that I
only go there for specific information, and do not just surf or browse.
Could I use those sites in my Favorites? These are the sites I use all the
time, as they cover most all the information and search/research sites I
need to access. The only exception may be when I am troubleshooting or
looking for a one time source of information. I have read the information
and related links generously provided here in this thread, yet, I am afraid
that this is still an area that I don't fully understand. Also, I am not
that familiar with the Internet setups and connections/communications, etc.
How would I know if I did or didn't need the DNS? Is there some
instructions/information on how to determine such things in the settings or
configurations a user would need when setting up their HOSTS files?

Use of the Hosts file in Windows will have no effect on DNS. Windows
goes to the Hosts file first to look up an IP address for a domain
name. Setting that IP address to the machine loopback address of
127.0.0.1 simply means that the Windows will not go out to a DNS
server or the gateway to the Net for that domain name - which is how
you prevent ad servers from being accessed. All other domain names
which are in the Hosts file which have valid IP addresses other than
127.0.0.1 will continue to be accessed and any domain name not in the
Hosts file will be searched for using DNS on the local LAN or through
your gateway to your ISP.

You only assign the 127.0.0.1 IP address in the Hosts file to domains
you do NOT want to access.

So you can use the Hosts file ad-blocking technigue without any
worries about accessing information on the Web or affecting DNS.

These Hosts files are intended solely to block ad servers, not entire
domains which might use ad-servers. So you can still access the main
Web sites, but their ads won't load when your browser requests one.
 
D

Duane Arnold

Hi YoKenny :)



I am not a power user of the Internet, but a very basic user, meaning
that I only go there for specific information, and do not just surf or
browse. Could I use those sites in my Favorites? These are the sites
I use all the time, as they cover most all the information and
search/research sites I need to access. The only exception may be when
I am troubleshooting or looking for a one time source of information.
I have read the information and related links generously provided here
in this thread, yet, I am afraid that this is still an area that I
don't fully understand. Also, I am not that familiar with the Internet
setups and connections/communications, etc. How would I know if I did
or didn't need the DNS? Is there some instructions/information on how
to determine such things in the settings or configurations a user
would need when setting up their HOSTS files?

Jan :)

What it means is that if you edited that host file with NotePad and made
a entry like 127.0.0.1 www.microsoft.com and used a browser like IE and
tried to goto www.microsoft.com, the browser would not be able to go
there. You can try it. This also means that a lot of Internet programs
don't use an IP address they use a Domain Name like www.micorsoft.com
www.yahoo.com and then if those domain names are in the Host file, they
will equate to the IP www.micorsoft.com is pointing to so that the
program can use it. If the Domain name is not in the HOST file, then the
machine is going to find a Domain DSN server on the LAN or it going to go
to the ISP DNS server to get the IP for the Domain Name. On a NT based
O/S, when the IP is 127.0.0.1 the LoopBack IP, the Login sceeen appears
for one to login on the computer, if using a browser, basically sending
you nowhere. On a Win 9'x or ME O/S using the browser, you may just get
page not found.

Duane :)
 
Y

YoKenny

Jan said:
Hi all - WinME

I'm not sure this is something that might fit into the scope of this
group, and if it should not be posted here please let me know and
I'll be happy to do so elsewhere.

I just have a question for clarification if I may. I apologize for
being so dense, but it has been suggested to me that I should perhaps
have a HOSTS file. I have read up on this, and while some of it is
clear, I am still somewhat confused as to exactly what it does, and
what is it for. It's purpose, and under what circumstances would one
really need such a file.

I have found that, while their intentions are well meant, some
suggestions are not a good thing for my system, something that I
really need, or ultimately creates problems. I hesitate to take any
action until I am sure it is right for me. Thus, I would appreciate
any information or input on HOSTS files.

Best regards,
Jan :)

As you may have noticed discussing the HOSTS file is like discussing
religion. Everyone has their own and it is the best.
 
D

David W. Hodgins

As you may have noticed discussing the HOSTS file is like discussing
religion. Everyone has their own and it is the best.

One of the things I really missed, after recently making the move from
win98 to linux, was the ad blocking, I was getting from the agnitum
outpost firewall. In the Windows version of opera, you'd get an error
message, if it failed to connect, due to a hosts file entry. Outpost
blocked the access, and returned blank images, to the browser.

I now have about 4800 entries in my slackware hosts file, and really
notice the diffrence browsing. I'm not sure if opera is not giving
an error message, because it's the linux version, or if it's because
I'm beta testing a new version, but I'm very happy with it now<G>.

Thanks for the links.

Regards, Dave Hodgins
 
J

Jan Il

Hi YoKenny!

As you may have noticed discussing the HOSTS file is like discussing
religion. Everyone has their own and it is the best.

Ah yes...like so many other fun topics...which I WON'T mention..;-)) But,
I for one, truly do appreciate the variety of experiences, opinions and
suggestions which are ernestly and generously offered. Otherwise, it can be
like the sound of one hand clapping. Where then, is the learning? <g>

Jan :)
 
J

Jan Il

Hi Duane!

What it means is that if you edited that host file with NotePad and made
a entry like 127.0.0.1 www.microsoft.com and used a browser like IE and
tried to goto www.microsoft.com, the browser would not be able to go
there. You can try it. This also means that a lot of Internet programs
don't use an IP address they use a Domain Name like www.micorsoft.com
www.yahoo.com and then if those domain names are in the Host file, they
will equate to the IP www.micorsoft.com is pointing to so that the
program can use it. If the Domain name is not in the HOST file, then the
machine is going to find a Domain DSN server on the LAN or it going to go
to the ISP DNS server to get the IP for the Domain Name. On a NT based
O/S, when the IP is 127.0.0.1 the LoopBack IP, the Login sceeen appears
for one to login on the computer, if using a browser, basically sending
you nowhere. On a Win 9'x or ME O/S using the browser, you may just get
page not found.

Duane :)
 
J

Jan Il

Hi Richard,

Richard Steven Hack said:
Use of the Hosts file in Windows will have no effect on DNS. Windows
goes to the Hosts file first to look up an IP address for a domain
name. Setting that IP address to the machine loopback address of
127.0.0.1 simply means that the Windows will not go out to a DNS
server or the gateway to the Net for that domain name - which is how
you prevent ad servers from being accessed. All other domain names
which are in the Hosts file which have valid IP addresses other than
127.0.0.1 will continue to be accessed and any domain name not in the
Hosts file will be searched for using DNS on the local LAN or through
your gateway to your ISP.

You only assign the 127.0.0.1 IP address in the Hosts file to domains
you do NOT want to access.

I'm sorry, but, this confuses me. You say that I only put addresses for
domains I DO NOT want to access in the HOSTS file. Correct? Then, I don't
understand the benefit for me to have a HOSTS file, as I know what domains I
want to go to, but, I have no idea what domains I would not want to visit to
put their address into the HOSTS file. Plus, since I would not go there in
the first place, what point would there be to putting them in the HOSTS
file. ??

Perhaps my understanding is all wrong. I had the impression that the purpose
of the HOSTS file was to protect you from the ad servers on the areas of the
Internet that you normally access.
So you can use the Hosts file ad-blocking technigue without any
worries about accessing information on the Web or affecting DNS.

These Hosts files are intended solely to block ad servers, not entire
domains which might use ad-servers. So you can still access the main
Web sites, but their ads won't load when your browser requests one.

This is how I thought it was supposed to work, but, obviously my
understanding of how it is to be set up is all backwards. There must be a
piece of gray-matter still napping somewhere. I'm sorry to be so dense.

Thank you very much for your time and helpful explanation, I truly
appreciate it. I'll try to get my head around this when the other cell is
operational again. <g>

Jan :)
 
D

David W. Hodgins

I'm sorry, but, this confuses me. You say that I only put addresses for
domains I DO NOT want to access in the HOSTS file. Correct? Then, I don't
understand the benefit for me to have a HOSTS file, as I know what domains I

Perhaps an example will help.

If you go to http://www.lycos.com, you'll get a page full of ads.
By viewing the source, you can that many of the larger ads are
actually being loaded from ln.doubleclick.net

By putting ln.doubleclick.net in your hosts file, assigned to 127.0.0.1,
when your browser loads the lycos page, it'll try to get the ad from
doubleclick, but wont be able to find it.

You'll still get the lycos page, but instead of an annoying ad, you'll
have a blank spot. Plus, since your browser doesn't have to load the
image from doubleclick, the screen will get drawn faster.

By downloading a list of common ad sites, you'll get rid of most of
the ads, without having to figure out for yourself, which sites the
ads are being loaded from.

Regards, Dave Hodgins
 
J

Jan Il

Ohhh Phooh! Sorry...my mouse got too antsy. :)
Hi Duane!

I sort of get the idea of how it works now...but, I'm going to have to think
more on this..I think. I'm still somewhat confused. Well..ok ok..a lot
confused. All this is very easy for those who understand all the tech terms
and how it all works, and I know you are all so patiently trying to get it
into my head. It is most likely very simple, but, it is sort of like Algebra
when I first stated the class. I just could not get the signs right, the +'s
and -'s. But, once I finally got it into my head how they worked, I got
straight A's. I'll get it yet. :)

Thank you so much for all your time and help. I really do appreciate it.

Jan :)
 
J

James Egan

identification. A name resolution mechanism must be available on a TCP/IP
network to resolve names to IP address.

It still is. Closing down the dns client service stops a local cache
being used. It doesn't stop the names being resolved by the
nameservers.


Jim.
 
Y

YoKenny

Duane said:
I am using the DNS service and the Host file and I don't see this
performance hit on the Win 2K and XP pro machines.

TCP/IP based services use IP addresses to identify each other, but
users and applications frequently require computer names for host
identification. A name resolution mechanism must be available on a
TCP/IP network to resolve names to IP address.

DNS is needed under the following circumstances:

1) The client is a member of an Active Directory domain, Active
Directory uses DNS as its locator service and is tightly integrated
with it. A locator service assists clients in finding other host and
services, using only the domain names.

2) The client accesses the Internet

3) The client is on a network that uses DNS to resolve host names.

Yes, you can use IP Host and NetBIOS name resolution, accomplished
through Host files and Lmhost files respectively. These provide host
and NetBIOS name-to-IP name resolution through manually maintained
local files.

I don't think it's a good practice to disable the DNS service on the
NT based O/S for the purposes that this thread is discussing.

Duane :)

I have tried with and without the DNS Client Service active on my WinXP Home
system. I have set it to Manual and rebooted after reading about this
somewhere but I can't find the reference now. With Manual selected I have
not had a problem Internet related so far.

With it active I do notice a delay going to the first Web site after
activation but no difference thereafter.

Home users (not to be confused with ALL WinXP Home users) do not need the
DNS Client Service active. It's one of the many un-needed WinXP Services
that start automatically.

http://www.blackviper.com/WinXP/service411.htm#DNS_Client
 
Y

YoKenny

Duane said:
What it means is that if you edited that host file with NotePad and
made a entry like 127.0.0.1 www.microsoft.com and used a browser like
IE and tried to goto www.microsoft.com, the browser would not be able
to go there. You can try it. This also means that a lot of Internet
programs don't use an IP address they use a Domain Name like
www.micorsoft.com www.yahoo.com and then if those domain names are in
the Host file, they will equate to the IP www.micorsoft.com is
pointing to so that the program can use it. If the Domain name is not
in the HOST file, then the machine is going to find a Domain DSN
server on the LAN or it going to go to the ISP DNS server to get the
IP for the Domain Name. On a NT based O/S, when the IP is 127.0.0.1
the LoopBack IP, the Login sceeen appears for one to login on the
computer, if using a browser, basically sending you nowhere. On a Win
9'x or ME O/S using the browser, you may just get page not found.

Duane :)

www.micorsoft.com is definitly a site you want in your HOSTS file. Notice
the spelling.
 
J

Jan Il

Hi Dave!

David W. Hodgins said:
domains I

Perhaps an example will help.

If you go to http://www.lycos.com, you'll get a page full of ads.
By viewing the source, you can that many of the larger ads are
actually being loaded from ln.doubleclick.net

By putting ln.doubleclick.net in your hosts file, assigned to 127.0.0.1,
when your browser loads the lycos page, it'll try to get the ad from
doubleclick, but wont be able to find it.

You'll still get the lycos page, but instead of an annoying ad, you'll
have a blank spot. Plus, since your browser doesn't have to load the
image from doubleclick, the screen will get drawn faster.

By downloading a list of common ad sites, you'll get rid of most of
the ads, without having to figure out for yourself, which sites the
ads are being loaded from.

Alllrightyyyy Now!! I've *finally* got it! Whew!! Funny what a 'lil sleep
does for the 'ol battery. While it's a Die Hard, it does have a few miles on
it. <g>

Thank you very much, Dave...your example made the process much easier to
understand. Heh! Even I can do that! ;-))

Jan :)
 
D

Duane Arnold

www.micorsoft.com is definitly a site you want in your HOSTS file.
Notice the spelling.
The only thing I don't like about using Xnews is that it doesn't have a
spell checker. I have to use APSC and I hate it. I don't know why the
developer of Xnews just couldn't have used Object Oriented Programming
and used the dll that contains the spell checker logic for MS Word or
Wordperfect etc, etc. The developer came up short on that one.

I never could spell and it's pure luck when it doesn't have a misspelling
by me.

Duane :)
 
Y

YoKenny

Duane said:
:
The only thing I don't like about using Xnews is that it doesn't have
a spell checker. I have to use APSC and I hate it. I don't know why
the developer of Xnews just couldn't have used Object Oriented
Programming and used the dll that contains the spell checker logic
for MS Word or Wordperfect etc, etc. The developer came up short on
that one.

I never could spell and it's pure luck when it doesn't have a
misspelling by me.

Duane :)

Unfortunatly there are many sites that rely on common misspellings of
popular sites for their nefarious tricks.
 

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