[Dnsmasq-discuss] blocking adservers

Simon Kelley simon at thekelleys.org.uk
Mon Aug 22 13:46:18 BST 2005


curby . wrote:
> I have been playing with adserver blocking with dnsmasq (see 
> http://pgl.yoyo.org/adservers/index.php)
> 
> I have tried both a hosts file of the form
> 
> 127.0.0.1 007arcadegames.com
> 127.0.0.1 101order.com
> 127.0.0.1 123banners.com
> 127.0.0.1 123found.com
> [snip]
> 
> with addn-hosts=/etc/hosts.adservers 
> 
> and a configuration file of the form
> 
> address=/007arcadegames.com/127.0.0.1
> address=/101order.com/127.0.0.1
> address=/123banners.com/127.0.0.1
> address=/123found.com/127.0.0.1
> [snip]
> 
> with conf-file=/etc/dnsmasq.adservers.conf
> 
> I have two questions:
> 
> Whereas http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2004q4/000077.html
> tells us that /etc/hosts addresses don't count against the cache size
> as defined by --cache-size, do addresses defined by the address
> configuration directive count against the cache size?

No, they don't.
> 
> Secondly, when ad servers are defined using address directives,
> dnsmasq seems to redirect a lot more ad requests to localhost than
> when using a hosts file.  Is this because hosts files match more
> strictly than address directives? (Perhaps ads.example.com wouldn't
> match an example.com hosts entry or something similar?)
Exactly right. /etc/hosts names need exact matches, names in --address 
directives just need to match the rightmost substring.
> 
> Aside from these questions, I've found that dnsmasq is very easy to
> set up.  Anything to keep me away from having to use BIND is wonderful
> in itself! Thanks for the great program.

Glad you like it.
> 
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
> 




More information about the Dnsmasq-discuss mailing list