Click to See Complete Forum and Search --> : block a domain
ph34r
08-03-2004, 01:15 PM
Is there anything I can do on my local machine to block an entire domain? There is this one really annoying ad service that responds slower than heck, and I'd like to redirect any request for anything in that domain to a local webserver (to get a quick 404 error). I can't run a proxy, but I could either run my own DNS locally or use /etc/hosts - I already use /etc/hosts to block some ad servers - but this one service has hundreds of hosts.
Thanks!
sharth
08-03-2004, 01:28 PM
if you wanted to block both ad.doubleclick.net and spam.doubleclick.net, try adding to the /etc/hosts file...
.doubleclick.net 127.0.0.1
or try using a wildcard(*). I've don't have a system to try this on though.
Alex Cavnar, aka alc6379
08-07-2004, 01:18 AM
You could write some kind of IPTABLES rule to do it.
I'm not really up on IPTABLES (I usually use ipfw or pf on a *BSD), but you could just write one that says
deny all TCP from < domain > to me
deny all TCP from me to < domain > to me.
however you'd go about doing that in IPTABLES.
Sorry I can't be of more help to you-- I'm a BSD guy when it comes to firewall rules!