Blocking IP addresses - how?

Praetor

Diamond Member
Oct 14, 1999
4,498
4
81
I remember seeing this on the forums before, but I can't seem to find the post in the search. So...

Here's what I want to do. I want to block out the ads that show up on the screen. I remember having to create/edit a file in the \winnt folder that stored ips for the named servers, so as to save time looking it up on the DNS.

(I'm beginning to think I'm not making much sense) Here's an example of what I remember it looking like. Someone please tell me which file it is that I edit or what is involved in creating it.

host.stupid-ads.com 127.0.0.1 127.0.0.1 so I don't see it
more.stupid-ads.com 127.0.0.1 127.0.0.1 so I don't see it
forums.anandtech.com 216.151.100.105 I want to go here, so this would be the real IP address

Understand what I'm trying to do?
 

CTR

Senior member
Jun 12, 2000
654
0
0
The file you are looking for is called HOSTS (no extension). Search for it, since its location depends on your OS. I think your idea has some merit, but you should leave out all the entries that you are not trying to block. You should use good ol' DNS for those since they might change.
 

Praetor

Diamond Member
Oct 14, 1999
4,498
4
81
I just put in the forums to give a more exact idea as to what I wanted to do. But this is exactly what I was looking for.

Thanks a million, CTR!
 

syf3r

Senior member
Oct 15, 1999
673
0
0

wait, CTR... can you explain what this file is doing...? does that mean that if you have

host.stupid-ads.com 127.0.0.1 127.0.0.1
more.stupid-ads.com 127.0.0.1 127.0.0.1

in that file, and an ad tries to load in your browser form one of those sites, it just won't load?

-syf3r.

 

CTR

Senior member
Jun 12, 2000
654
0
0
The text in bold is comment only. A sample line from his file would look like:

host.stupid-ads.com 127.0.0.1

Windows checks the hosts file before it tries to resolve the name via DNS. So by making a name-to-address translation to his loopback address, the ads will never load. He will have some page not found errors in their place, but no ads. He will have to maintain his hosts file such that every time he sees an ad actually load, he notes the server it came from and adds a name-to-loopback entry to his hosts file for it. This guy really hates ads I guess.
 

Sunner

Elite Member
Oct 9, 1999
11,641
0
76
It will think ads.whatever.com is located at the address 127.0.0.1 which is localhost, your computer.
Hence the browser will look for a webserver on your computer, and obviously it wont find one(unless you're running one on your comp), so it will time out after a while, saying it got no response.
 

syf3r

Senior member
Oct 15, 1999
673
0
0
ok cool... so if you were to create a webpage with a tiled background, or just a black background, and used that ip instead of the local-loopback, instead of a page not found error you'd just get a nice black field or tiled wallpaper...? yes..? that might look nicer, but i agree, it seems like a pain in the ass to have to manually enter an ip in there each time you get hit with an ad... and does editing that file change the HOSTS lookup automatically, or after the system is rebooted...?
 

Neoplasia

Member
Dec 8, 2000
169
0
0
Use # before any comments, all text after it on that line will be ignored for name resolution.

Ex: ads.annoyme.com 127.0.0.1 #I hate ad banners!
 

CTR

Senior member
Jun 12, 2000
654
0
0
syf3r:
Those ads usually have a long redirect string after the hostname so your plan most likely won't work.
Changes to the HOSTS file take effect once you save the changes to the file. No reboot required, believe it or not. And this is Windows!

 

syf3r

Senior member
Oct 15, 1999
673
0
0
hmm... i don't understand why an alternate site wouldn't work... if you just put the following:

ads.annoyme.com 137.224.172.18

where "ads.annoyme.com" is the site that's feeding you ads you don't want to see, and "137.224.172.18" is a webpage you have author rights on, and is just a page with a pleasant tiled background...

-syf3r.


 

CTR

Senior member
Jun 12, 2000
654
0
0
Run your mouse pointer over that ad at the top of this page. Look at your status bar at the bottom of your browser (I'm using IE). That's what you would have to replicate on your webserver.
 

kt

Diamond Member
Apr 1, 2000
6,031
1,346
136
that's because, the location of the file may not be the same.. for example, say an ad comes in from ads.blah.com and is located in /myclientads/adspicture.gif and you have it redirected to 123.123.123.123 in your host file then it will try to look for that graphic at the above ip address. so, you'll still get a 'display error'.. but you'll annoy the hell of the host at 123.123.123.123 for querying them every time ads.blah.com sends an ad.

-=kt
 

syf3r

Senior member
Oct 15, 1999
673
0
0
yeah, but what if 123.123.123.123 is another machine i have control over? and i have a webserver on that machine... and i place a page with a tiled or black background on that machine... and i put that machine in the host file...

-syf3r.
 

Praetor

Diamond Member
Oct 14, 1999
4,498
4
81
I did it because my install of Explorer 5.5 seems to have an odd java bug. Whenever there's a java add on the screen (ie those stupid monkey ads), things seem to slow down a bit. Not a whole lot, but noticeable. When I scroll the screen it jumps rather than scrolls smoothly.

It's not that I hate ads, just those annoying java ones.

And if anybody is interested, here is my editted hosts file. On my install of Win2k it was found at c:\winnt\system32\drivers\etc\ with a filename of hosts. (no extention)

And without further ado, my list.

# Copyright (c) 1993-1999 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
127.0.0.1 icache.247media.com
127.0.0.1 entercasino.com
127.0.0.1 www.entercasino.com
127.0.0.1 entercasino4.com
127.0.0.1 www.entercasino4.com
127.0.0.1 www.nic.co.il
127.0.0.1 ads.clickagents.com
127.0.0.1 www.descramblers-online.com
127.0.0.1 banners.babylon-x.com
127.0.0.1 clicks.firstname.com
127.0.0.1 www.tridentads.com
127.0.0.1 mediaserv.247media.com
127.0.0.1 a852.g.akamai.net
127.0.0.1 view.avenuea.com
 

CTR

Senior member
Jun 12, 2000
654
0
0
Praetor:

Hey that list is great. You ought to put something in your sig about your "anti-banner HOSTS file" so people can contact you if they want it. Or linkify it as an ftp file. And get rid of those crappy microsoft comments. You are truly a pioneer in the field of ad circumvention.
 

Praetor

Diamond Member
Oct 14, 1999
4,498
4
81
I might, after I've worked out all of the bugs and whatnot. Plus, I know there is another list floating around here somewhere, one that is much, much more extensive than mine is.
 

Jarwa

Golden Member
Jan 7, 2001
1,160
0
0
Hmmm... This is an interesting thread because about 3 months ago I tried to get to www.microsoft.com and I couldn't. The page just kept timing out. I also couldn't get to http://windowsupdate.microsoft.com either. I tried everything, and I mean everything, to try to get to those site, but I never could. I bugged my isp and a bunch of tech savvy people, but they couldn't help me either.
I was just wondering if something that I downloaded and installed could have made entries to that file to maliciously block me from those sites? Is that possible?

Oh, and since then I've formatted and reinstalled windows and I can access those sites again!
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |