TreeWalkDNSTreeWalk DNS

Ad Server Blocking

From: Can TreeWalk block Ad Servers? Yes. Some sites link to ads from "Ad Servers" specifically designed to display ads to you which can be quickly and easily blocked with TreeWalk. Sometimes these Ad Servers may attempt to gather information from you, they may cause slower loading for the site you're visiting or both. Within minutes you can make some simple file changes that will enable TreeWalk to block these types of ads and even some popups from other content servers.

ConFetch Plug-ins

Additional filtering plug-ins for TreeWalk can be found at confetch.com, which is also brought to you by the TWDNS Crew. "ConFetch" is a plug-in for use with TreeWalk DNS and provides the ability to filter unwanted domains by "fetching" popular, publicly available HOSTS files and other lists. ConFetch aggregates and converts the files that you choose, then creates and automatically implements compatible filters for TreeWalk to use for blocking many types of domains that are known to practice nefarious, outright dangerous or other unpopular behavior. ConFetch has a built-in program updater and contains utilities to further customize your blocking capabilities with whitelisting, blacklisting and unblocking tools provided in case you ever need them.

Create Your Own!

For this working example, TreeWalk will block ad servers with the help of a well-maintained list available from Peter's site at "yoyo.org". (Another link below will take you directly to his list.) You can see an example of ads in action at the ConFetch site (if you don't already have the ad server blocked). These ads are typical of free-hosting sites like the web host ConFetch uses. If you are comfortable with making a batch file and you've already made the changes described here, you might want to go straight to the Ad Blocker Updater page to automate the updating process described below. We've also included a few helpful hints for making your own "filter.conf" at the bottom of this page but recommend that you fully review this page first.

Back it up in case you break it! The first thing we want to do is backup Treewalk's configuration so we can restore it if something goes wrong. Access TreeWalk's icon group in All Programs (or Program Files) and select "Backup configuration" from the "config" folder, which is the same folder where you would "Restore configuration" from. A window will appear and perform the task, asking you to "Press any key to continue" when it's done (do this). Next, navigate to this folder:
%SystemRoot%\system32\dns\etc
(the folder that TreeWalk installed on your system). If you do not know where the "etc" folder is, do a search for etc on your system to locate it in the dns directory (not the one in the "drivers" folder).

Create the first file. Open Notepad (or your favorite text editor) and paste the following into it to make the first file that you'll need:

; TreeWalk DNS NULL Zone File for host filtering
;
$TTL 36000
@ in  soa  localhost. postmaster.localhost. (
           0   ;serial
           0   ;refresh
           0   ;retry
           0   ;expiration
           0 ) ;minimum
;
; Zone NS records
;
@          NS localhost.
           A 127.0.0.1
*          IN A 0.0.0.0

Save it in the "etc" folder as "null.zone.file" (without any quotation marks). Make sure you have Windows set to show file extensions so you don't inadvertently name it as "null.zone.file.txt". It will not work if this happens.

Create the second file. Open "filter.conf" (provided in the same "etc" directory for this purpose) with your text editor and delete all commented text in the file. Then open your browser to where Peter maintains the list, and copy all the lines to paste the entire contents of the page into the empty "filter.conf". It should look similar to this snippet (do not copy this example):

// this list from http://pgl.yoyo.org/adservers/
// last updated: 2005-05-11 12:54:28
 
zone "007arcadegames.com" { type master; notify no; file "null.zone.file"; };
zone "101order.com" { type master; notify no; file "null.zone.file"; };
zone "123banners.com" { type master; notify no; file "null.zone.file"; };
zone "123found.com" { type master; notify no; file "null.zone.file"; };
zone "180searchassistant.com" { type master; notify no; file "null.zone.file"; };
zone "180solutions.com" { type master; notify no; file "null.zone.file"; };
...and so on

It will be a long list, so you might want to use the Ctrl+A keyboard shortcut to highlight the contents of the web page, use Ctrl+C to copy it all to your Clipboard and then use the Ctrl+V keys to paste it into your text editor's empty window. Save this file with it's original name "filter.conf" (without quotation).

Okay. Now what? All you need to do now is select "Stop DNS service" from the "service" folder in TW's program group and then re-start TreeWalk again with the "Stop DNS service" icon. The Null Zone File cannot remove any locally served ads or popups, and you only need to stop the TreeWalk service with the "Stop DNS service" icon and refresh the page to see the ads you're missing. Don't forget to use the "Start DNS service" icon to start TreeWalk afterwards, and periodically update your "filter.conf" file to keep the list current. (You can also use the TreeWalk control panel in the program's icon group to "Stop" and "Start" the service or the typical "net stop twdns' and "net start twdns" commands from a command prompt.)

Automate the updating process. Go to the Ad Blocker Updater page to make a simple updater if you are confident with creating a batch file and you've already made the changes described on this page.

If you wish to make your own list, here are a few helpful hints:

  • always use the correct format for every entry and place each statement on a new line (where "hostname.tld" is used for example only and would be replaced by the actual site name you want to filter), like shown in the following statement:
    zone "hostname.tld" { type master; notify no; file "null.zone.file"; };
  • hostnames should only contain lowercase letters a-z, numerals, dots and dashes
  • underscores create "bad owner name" errors so subdomains like "sub_domain.hostname.tld" may be reduced to "hostname.tld" at your discretion (recommended)
  • subdomains that contain a dash followed immediately by a dot ("sub_domain-.hostname.tld" for example will be equally problematic and should be shortened (recommended)
  • duplicate entries will place the "twdns" Service into a non-start state so use only unique, lowercase names for the "hostname.tld" example label
  • use TreeWalk's own Control Panel to determine if the Service starts properly and review the (Application) Event Viewer for clues in "twdns" messages if the service does not start (Windows' Control Panel, Administrative Tools)

If you have additional questions regarding this topic, please post them in our "config.discuss" forum.

TOP
Copyright © 2000-2008 treewalkdns.com All rights reserved