Edited by LostInSpace2012, 17 January 2014 - 07:49 AM.
Login to Account Create an Account
Current list of advertisement Image URL's to Block
Posted 17 January 2014 - 05:48 AM
Posted 17 January 2014 - 05:53 AM
Here's a good article, best I've read about using Host file to block images for ads:
The hosts file
Probably the most common way people block ads like this is with something called the "hosts file". The hosts file is a simple list of hostnames and their corresponding IP addresses, which your computer looks at every time you try and contact a previously unknown hostname. If it finds an entry for the computer you're trying to reach, it sets the IP address for that computer to be whatever's in the hosts file.
127.0.0.1 is a special IP address which, to a computer, always means that computer. Any time a machine sends a network request to 127.0.0.1, it is talking to itself. This is very useful when it comes to blocking ads, because all we have to do is specify the IP address of any ad server to be 127.0.0.1. And to do that, all we have to do is edit the hosts file. What will happen then is something like this:
1. you visit a web page
2. the web page contains a banner ad stored on the server "ads.example.com"
3. your computer says "ads.example.com? never heard of it. wait a second, let's see if I've got the number on me..."
4. your computer finds its hosts file and checks to see if ads.example.com is listed
5. it finds the hostname, which points to 127.0.0.1
6. "great", says the computer, and sends off a request to 127.0.0.1 for the banner ad that's supposed to be on the page
7. "oh", says the computer, and fails to show anything because it just sent a request to itself for a banner ad
Where's my hosts file?
* Windows 95 / 98 / ME: C:\Windows (I think)
* Windows NT: C:\WinNT\hosts
* Windows 2000: C:\WinNT\system32\drivers\etc
* Windows XP: C:\Windows\System32\drivers\etc
* Windows Vista: C:\Windows\System32\drivers\etc
* Windows 7: C:\Windows\System32\drivers\etc
* FreeBSD / Linux / Mac OS X / Unixish operating systems: /etc/hosts
* Classic Mac OS: please read this helpful information submitted by David "iNerd" B
* Mac OS 9: Marcia Skidmore sent in details that hopefully explain what you need to know
* Mac OS 10+: Tina Kent sent in details for later versions of Mac OS
The format of the hosts file is very simple - IP address, whitespace, then a list of hostnames (except for older Macs; please see above). However, you don't need to know anything about the format if you don't want to as you can just view the list hosts file.
Of course, that's not the only way to use the list, but it's probably the most simple for most people.
A much more efficient way of using the list is with a nameserver. See below for details.
other ways to use this list
# As a Windows hosts file
I use this list with a local nameserver, but you can also use this list with windows to block ads. to do this, download the list hosts format and put it in your C:\Windows folder (C:\WinNT\system32\drivers\etc under Windows 2000; C:\WinNT under Windows NT; C:\Windows\system32\drivers\etc under Windows XP) as a file called "hosts" (just "hosts", no .txt or anything). if you already have a file called "hosts" there, just add this list on to the end. (See above for a more detailed explanation of how this works.) NB: after updating your hosts file, it is recommended to run the command "nbtstat -R" to ensure changes are recognized by your computer (see this news update for more details).
Edited by LostInSpace2012, 17 January 2014 - 07:40 AM.
Posted 17 January 2014 - 06:35 AM
All you have to do is copy that huge list from above, the one with all the 127.0.0.1 numbers, into a file in your Windows directory and call it "Hosts" with no extension. So far, it seems to be working. Because I notice a slight 1 or 2 second lag when first clicking on websites (it's probably checking the list). In order to test it out, I visited some of the websites listed in the hosts file, and apparently the ad blocking appears to be working!
I guess it works afterall. So far so good.
In summary, here's what you need:
(1) This List:
(2) Copy all the ^above numbers into a file called "hosts" (no extension) in your C:\WINDOWS directory.
Lastly, another tutorial
Edited by LostInSpace2012, 17 January 2014 - 07:55 AM.
Posted 17 January 2014 - 07:58 AM
This discussion about the HOSTS file is somewhat universal across various versions of Windows, so I'm not sure it belongs in this win-98 forum. That said, here's what I can tell you about how use the hosts file. First, the correct file is not "hosts.sam". That is a sample hosts file. Windows only recognizes and uses "hosts".
A good starting point for a third-party hosts file for the past 10 or so years has been the MVPS hosts file, located here: http://winhelp2002.mvps.org/hosts.htm
My current hosts file is an old(er) version of the MVPS, to which I add my own entries as I encounter them. For example, I have many ad-serving google entries, as well as facebook and twitter (because most websites force your browser to contact those sites for one reason or another).
Here are the google entries in my hosts file:
There is at least one entry I have that appears on MSFN.org:
Win-9x/me seems to have an advantage over the NT line in terms of the size of HOSTS file that you can have. For some reason, having a large hosts file has a performance impact on NT whereas 9x/me network tcp/ip or DNS operations don't seem to take a performance hit regardless how many entries you have in your hosts file.
A good way to know what domains or sites your computer is accessing as you browse is to log into your modem or router and look at the outgoing access log. Just scan through the list and pick out domains / hosts that you've never typed in or book marked in your browser's address bar and add them to your hosts file.
Posted 17 January 2014 - 08:11 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users