Home · Compatibility Lists · Support Forums · FAQ · News Archive · Articles · Submit News/Upcoming News
NT Compatible
advertisement


Forum overview » Security » BIND as a replacement for Windows Hosts file for the purpose of Ad Blocking (1/1)

Reply New Poll

BIND as a replacement for Windows Hosts file for the purpose of Ad Blocking
Author Message
dosfreak
Moderator


Icon 2004-09-06 21:12:09

Was re-reading APK's Host file + dialup problems and started tinkering again. Would have done this

sooner but I haven't used internet at home since 1998! Only at work or when I visit my paren'ts. Well I

decided to hook up my cell phone to the 'net and surf, and what do I find but tons of ads! This

immediately made me think of APK and the hosts file. I've never like the Hosts file and I've always

wanted to use DNS instead.....the problem was making it easy for a home user to install/configure and

understand. So I surfed around for easy ways for Windows users to use BIND and I found it!

It is:


TreeWalk DNS Server
http://ntcanuck.com/

This is basically BIND but makes it easier to configure for Windows users. It sets you up locally as a

caching DNS server and then forwards DNS requests to DNS servers on the internet. You modify your

dial-up or NIC settings to point to 127.0.0.1, since you are the DNS server for your zone.

All you have to do next to get it to work is go into the TreeWalk DNS Control Panel and Start the

service.....and your done!

For me using TreeWalk was faster than using my ISP's DNS, most likely due to BIND than anything else.



Now if you want to block banner ads:

Stop your DNS service via TreeWalk DNS Control Panel
Go to \windows\system32\dns\etc

Edit named.conf with notepad and add the following line to the bottom of the file

zone "sped.atdmt.com" { type master; file "blockads"; };

Where sped.atdmt.com = what site you want to block
Where blockads = a file in your \etc directory where you will add the zone info for that site.

Ok, so once you have that line added, save the file and now create the blockads file.

Now within the blockads file, add these lines:

$TTL 24h

@ IN SOA localhost. root.localhost. (
2003052800 86400 300 604800 3600 )

@ IN NS localhost.
@ IN A 127.0.0.1
* IN A 127.0.0.1



So now whenever you wish to block sites. Simply add another
zone "sped.atdmt.com" { type master; file "blockads"; };
line to the end of your named.conf file (changing the site name of course) and you'll be good to go!


Go here to convert your Hosts file into BIND config: http://pgl.yoyo.org/adservers/hosts2bind.php


Some benefits of using this method over Hosts, is that you no longer have to worry about huge hosts

lists that seem to make dial-up flaky, (probably due to Hosts file not being designed for such long

lists!) and you can easily carry the file over to any Linux system.

Post #145202
Edit Quote Print Solution Plonk Delete
Alec§taar
Account Disabled


Posts: 207
From: A discrete point in the Space-Time Continuum...
Joined: 2001-04-17
Member No.: 5614
Icon 2004-09-07 11:02:42

Originally posted by dosfreak:
"Was re-reading APK's Host file + dialup problems"


I fixed that my man, it was simple once I got the fix too!

All it was, was leaving the DHCP service set to 'automatic' & setting DNS service to 'manual'... & the problems I had with the HOSTS file on Windows 2000 went away!

(Never had a problem w/ it on Windows XP though, ever!)

* Must be one of the 'subtle differences' between 2000 & XP, as there are some in the way of networking (such as 2000 having all networking/IP functions turn on during bootup, which makes its bootup slower for instance whereas XP's IP services start only ON DEMAND (much like Apple Mac OS/X-Panther do it)).

Originally posted by dosfreak:
"
Now if you want to block banner ads:

Stop your DNS service via TreeWalk DNS Control Panel
"


That's EXACTLY what fixed it for me on Windows 2000: Again, stopping the DNS client service!

(Never had to on XP though, HOSTS never gave me a hassle there on Dialup from any ISP OR on Cablemodems from any BSP)

Originally posted by dosfreak:
"Some benefits of using this method over Hosts, is that you no longer have to worry about huge hosts lists that seem to make dial-up flaky, (probably due to Hosts file not being designed for such long lists!) and you can easily carry the file over to any Linux system."


Well, usings HOSTS here on 56k dialup works now, & bear in mind the solution:

FIX STEPS FOR HOSTS FILE AND Windows 2000 dialup users:
------------------------------------------------------------------------


1.) Stop DNS client service (set to manual startup type)

2.) Startup DHCP as automatic startup type

3.) Reboot

Works! 56k dialup fix for HOSTS file users on Windows 2000 (once more, this never is a problem on Windows XP though, dialup or cable) & on Win2k on cablemodem this was never a problem I can recall either... just on dialup on Win2k.

* BUT, the fix above? Works!



APK

Post #145219
Edit Quote Print Solution Plonk Delete
clutch
Moderator


Posts: 3854
Joined: 2000-03-28
Member No.: 2798
Icon 2004-09-07 12:51:58

Alright, I almost have a way for the Windows DNS users out here to do a bulk load, but I need a way to limit the domains used to just the domains, and not have any host/sub domains in the file (you don't want to have a zone for each subdomain, as that's wasted space). I have a list of domains, but I would like to trim it. I figure common denominator would be to trim two periods from the end (such as test.fastclick.net and ad1.fastclick.net would be left with fastclick.net when trimmed from the right end). So, any ideas?

Post #145222
Edit Quote Print Solution Plonk Delete
dosfreak
Moderator


Icon 2004-09-07 15:03:08

I believe if you remove the last line in your null zone file (blockads file in my post above), that will fix your problems.

* IN A 127.0.0.1

The wildcard blocks hostnames and subdomains of that domain....so removing this line hould allow the @ IN A 127.0.0.1 line to block that single domain.


Post #145229
Edit Quote Print Solution Plonk Delete
Alec§taar
Account Disabled


Posts: 207
From: A discrete point in the Space-Time Continuum...
Joined: 2001-04-17
Member No.: 5614
Icon 2004-09-07 15:24:19

Well, sounds like you two are 'getting into it' w/ this caching DNS master lookup table & service creation tool!

(Which is neat enough, nothing wrong w/ controlling what your system allows access to, such as adbanners etc. &/or sites you wish to speedup OR block-out, in this manner via a software + service rather than using a customized HOSTS file. Why I like using CUSTOM HOSTS FILES for is the fact you can move them to pretty much ANY Operating System type that uses IP based communications really: No limits, it is SAME on Win32, Linux, Unix, Apple, etc. since they're all based off of UNIX models of it!)

Anyhow - for the fix for CUSTOM HOSTS FILE use on Windows 2000 for dialup users? I listed that above, & it works (Again - just simply by stopping the DNS client service from autoloading @ system boot & making DHCP client service active/automatic startup type using services.msc).

URL WHERE I FIGURED OUT THE FIX FOR REFERENCE & PROBLEMS I WAS SEEING AS WELL BEFORE FINDING THIS FIX FOR WINDOWS 2000 CUSTOM HOSTS FILE USE ON DIALUP CONNECTIONS:

http://www.ntcompatible.com/thread28358-1.html



* ADDITIONALLY - This tool you found Dosfreak, it has an "analog" (pun intended) in this tool by "AnalogX" imo:

http://www.analogx.com/contents/download/network/fc.htm

(Sounds an AWFULLY lot like it: A local caching DNS server basically...)

Just in case anyone's looking for another tool that does this & is a freebie too!

APK

Post #145233
Edit Quote Print Solution Plonk Delete

Reply New Poll

Forum overview » Security » BIND as a replacement for Windows Hosts file for the purpose of Ad Blocking

Legend
View   View profile
Solved   Mark this post as solution (topic starter only)
Quote   Reply with quote to post
Edit   Edit post
Delete   Delete post (admin only)

Moderator: Open / Close / Bump / Delete / Move / Merge

All products mentioned are registered trademarks or trademarks of their respective owners.
© 1998-2009 Esselbach Internet Solutions - All Rights Reserved. Terms and privacy policy
Website powered by Esselbach Storyteller CMS System