Windows HOSTS file in \System32 folder

ajetrumpet

Banned
Local time
Today, 10:05
Joined
Jun 22, 2007
Messages
5,638
all,

I am using my hosts file in the system 32 folder to block internet advertisements from company domains. i read an article on it and decided to try it. It actually works great! Here is what mine looks like:
PHP:
# Copyright (c) 1993-2006 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
::1             localhost
127.0.0.1	googleads.g.doubleclick.net
127.0.0.1	pagead2.googlesyndication.com
ect, etc, etc...
as you can see, I am typing my local host address along with the address the ad comes from in order to block it. I know absolutely nothing about a local host, but what I am wondering is if there is a way I can manipulate this text file using VBA. I am aware of text file streaming, but I have no idea what a local host is, or how to get it through the VBA coding. Is this number the same on all computers? What does it represent?

This number does not show up in DOS under the IPCONFIG command, so I'm not sure if I'm on the right track or not. thanks!
 
i HAE FIXED THE PROBLEM. THANKS TO ANYONE WHO LOOked at this
 
Just saw it. For those who might find this in the future, localhost is the computer you are sitting in front of. It's IP address is ALWAYS 127.0.0.1.

The way Adam's cheat works is by re-routing traffic from any of the sites that he has in his list (in the hosts file) to the local computer (the computer you are on at the moment, the one with the "hosts" file). The local computer doesn't know what to do with the request so it just ignores it.
 
Tangent.

My HOSTS file redirects all traffic to spammy servers to 0.0.0.0 instead of 127.0.0.1. Few places reports 0.0.0.0 as faster than 127.0.0.1. As indicated by George, 127.0.0.1 is the loopback address and thus basically valid address. 0.0.0.0, OTOH, is supposed to be a network broadcast address and thus a reply is never expected at that address so thus packets sent to 0.0.0.0 do not incur the overhead of waiting for the "return" whereas 127.0.0.1 would be frustrated due to lack of httpd, IIS service, whatever or nonexistent files, etc. etc. but there's a bit overhead here.

FWIW.
 
FYI - there is an easy way to manage add blocking, if you have Firefox there is a plug in called adblock plus - after you have installed it you can subscribe to a list generated by adblock which is updated regularly so you'll rarely come across any ad's on any website.

The good thing about using this is if you do come across an ad that got through or any image you don't want you simply right click on it and add it to your list.

You'll also find web pages will load faster as well ;-)
 
FYI - there is an easy way to manage add blocking, if you have Firefox there is a plug in called adblock plus - after you have installed it you can subscribe to a list generated by adblock which is updated regularly so you'll rarely come across any ad's on any website.

The good thing about using this is if you do come across an ad that got through or any image you don't want you simply right click on it and add it to your list.

You'll also find web pages will load faster as well ;-)

Minkey,

Is there suck an add on for chrome? I use that as the default. I have pretty much discarded any others.
 
by the way minkey, thanks for the add on information! I download it and subscribed to a preloaded list, and BOOM, no more ads on this forum! :D
 

Users who are viewing this thread

Back
Top Bottom