How big can HOSTS be?

N

Nil

Will there be a performance hit if the HOSTS file passes a certain size
or number of entries? I use Spybot Search & Destroy's Immunize feature,
which maps bad-guy sites and domains to localhost in HOSTS, and I see
that it's up to well over 8000 lines in addition to the entries I've
put there myself.

I don't notice any slowdown... yet.
 
R

R. McCarty

Yes, but at what number is hard to say. Having a Hosts file parsed before
using the DNS service adds some time to resolve a URL But how that
time varies from using the DNS service is a value I'm not aware of. I use
a few entries in my Hosts but mainly just to speed up email and a few sites
I visit very often. Some people use an alternate DNS resolver service from
OpenDNS which internally has many ad sites blocked.
 
N

Nil

It /could/ have an affect on performance, yes. See
http://www.mvps.org/winhelp2002/hosts.htm#Note

OK. It says that it can slow things down if it grows over 135kb. Mine
is now 228 kb. I have notices a few times lately where I wouldn't
connect to a site with my browser, and then after a refresh I would get
it. Maybe it's a time-out due to a too-large file. Next time I see that
happening I'll put in a clean HOSTS and see if it helps.

Thank you.
 
N

Nil

Some people use an alternate DNS resolver service from OpenDNS
which internally has many ad sites blocked.

I'll check into that - it sounds like it might be good alternative
to an ever-expanding HOSTS.
 
N

Nil

mine is 1KB... and I don't have any problems.

Is that what you really mean? That's barely over the size of the
default HOSTS, which shouldn't create any problems at all.

If you really mean MB, I'll feel much better about mine!
 
P

PD43

Nil said:
Is that what you really mean? That's barely over the size of the
default HOSTS, which shouldn't create any problems at all.

If you really mean MB, I'll feel much better about mine!

SORRY... it's 1kb
 
K

Ken Blake, MVP

OK. It says that it can slow things down if it grows over 135kb.


Did you read past that sentence? Yes, it says that. But it also tells
you how to resolve that issue.
 
N

Nil

Did you read past that sentence? Yes, it says that. But it also
tells you how to resolve that issue.

No, I didn't. I'll play around with it and see what difference it
makes.
 
V

Vic

R. McCarty said:
Yes, but at what number is hard to say. Having a Hosts file parsed
before
using the DNS service adds some time to resolve a URL But how that
time varies from using the DNS service is a value I'm not aware of. I
use
a few entries in my Hosts but mainly just to speed up email and a few
sites
I visit very often.

I didn't know the HOSTS file could be used to speed things up, I've only
used it to block addresses. Could you please explain how an entry can be
used to speed things up?

TIA
 
R

R. McCarty

Maybe speed things up isn't the correct term. Anyway for sites that you
frequently access using a Hosts entry lessens the time for the URL to get
translated. The only issue is if a site changes it's IP Address you'll need
to make the appropriate changes to your Hosts file. My hosts file includes
about 9 entries - mostly email related. I didn't intend to promote using a
Hosts file as a "Performance Tweak", just something that helps expedite
opening/accessing email servers.
 
K

Ken Blake, MVP

I didn't know the HOSTS file could be used to speed things up, I've only
used it to block addresses. Could you please explain how an entry can be
used to speed things up?




Although people think of the URL as the address of a web site, the
real address is an IP address, a number in the form 123.456.789.

The URL is just an easily-remembered shortcut to get you to the IP
address. To translate from the URL that you type in your browser to
the actual IP address, your browser goes out to a special web site
caused a DNS server. The URL is looked up there and the DNS server
returns the IP address that the browser then loads.

That's a two-step process that takes time. The primary purpose of the
Host file is not to block addresses, but to speed up that DNS lookup.
The Hosts file essentially asks like a local DNS server for web sites
you frequently visit. If the browser can find the IP address it needs
there, it's much faster than going to a DNS server to get it.

Secondarily, the Hosts file can be used to block addresses, but that's
not it's primary purpose.
 
K

Ken Blake, MVP

Secondarily, the Hosts file can be used to block addresses, but that's
not it's primary purpose.


UGH!! I *hate* it when I do that. That should be "its," not "it's."
 
P

PD43

Ken Blake said:
UGH!! I *hate* it when I do that. That should be "its," not "it's."

How 'bout when you do this:

"The Hosts file essentially asks like a local DNS server for web sites
you frequently visit." ^^^
 
K

Ken Blake, MVP

How 'bout when you do this:

"The Hosts file essentially asks like a local DNS server for web sites
you frequently visit."



UGH again! Got me! As often happens, my fingers and my brain lost
contact with each other.
 
B

Bob I

PD43 said:
How 'bout when you do this:

"The Hosts file essentially asks like a local DNS server for web sites
you frequently visit." ^^^

That would be "acts" I presume. ;-)
 
Z

Zilbandy

UGH again! Got me! As often happens, my fingers and my brain lost
contact with each other.

I'm finding that happening more and more to me, too. I think it's
called... getting old. LOL
 

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

Top