Houzz Logo Print
bengz6westmd

Hosts file tips

11 years ago
last modified: 11 years ago

Something that's pretty easy to implement to speed internet page-loading is the hosts file. I get a custom host file from here:

http://winhelp2002.mvps.org/hosts2.htm

There are other hosts files on the internet too.

If I use the original hosts file in Windows or Linux, most websites show a stream of "ad sites" connecting during page loading -- doubleclick.net, adserver.com, etc, etc. Each takes only an instant, but add up dozens of them on many sites...

For ex, the very first "tracker" on my custom hosts file is:

0.0.0.0 fr.a2dfp.net

The "0.0.0.0" identifies the tracker as a "localhost" address instead of its actual IP address. So whenever a website requests that tracker, your computer first looks in localhost for it, finds it as 0.0.0.0, but it's "nothing" & the computer immediately continues on. Here's an ex from a command prompt in Linux (works in windows too) on an old machine :

ping fr.a2dfp.net
****** output
PING fr.a2dfp.net (0.0.0.0): 56 data bytes
64 bytes from 127.0.0.1: seq=0 ttl=64 time=0.301ms
64 bytes from 127.0.0.1: seq=1 ttl=64 time=0.304ms
64 bytes from 127.0.0.1: seq=2 ttl=64 time=0.259ms

--- fr.a2dfp.net ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 0.258/0.275/0.304 ms
****** end output

Look at the time -- avg round trip .275 ms.

Now, ping a common site not listed in your hosts file:

ping verizon.net
****** output
PING verizon.net (206.46.232.39): 56 data bytes
64 bytes from 206.46.232.39: seq=0 ttl=246 time=67.347 ms
64 bytes from 206.46.232.39: seq=1 ttl=246 time=48.538 ms
64 bytes from 206.46.232.39: seq=2 ttl=246 time=48.808 ms

--- verizon.net ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 48.538/54.897/67.347 ms
****** end output

Note the time now -- avg round trip 54.897 ms. The access time is 200X slower since it found nothing in localhost & had to go out onto the internet to query whatever DNS servers you are using. So, at least for sites w/trackers (most have some or ALOT), the custom hosts file will both speed page loading & prevent their tracking.

Try another common site:

ping yahoo.com
****** output
PING yahoo.com (98.139.183.24): 56 data bytes
64 bytes from 98.139.183.24: seq=0 ttl=53 time=33.165 ms
64 bytes from 98.139.183.24: seq=1 ttl=53 time=34.229 ms
64 bytes from 98.139.183.24: seq=2 ttl=53 time=35.243 ms

--- yahoo.com ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 32.662/33.824/35.243 ms
****** end output

A bit faster than verizon.net, but still 123X slower.

One note -- if you implement this, you need to re-save your original hosts file (ex, as hosts.bak) and then make sure any items in it are added at the top of the custom hosts file. For ex, my Puppy Linux hosts file has the original hosts file stuff copied above the custom file items:

127.0.0.1 localhost puppypc8576
192.168.1.1 pc2
192.168.1.2 pc3
192.168.1.3 pc4

::1 localhost #[IPv6]

# [Start of entries generated by MVPS HOSTS]
#
# [Misc A - Z]
0.0.0.0 fr.a2dfp.net

Some say 127.0.0.1 is best to use instead of 0.0.0.0, but either works & the latter takes a few less bytes. Also, pinging in windows will act different (it won't ping the 0.0.0.0 address), but the speedup works the same.

Comment (1)

Sponsored
High Point Cabinets
Average rating: 5 out of 5 stars21 Reviews
Columbus' Experienced Custom Cabinet Builder | 4x Best of Houzz Winner