The problem is: the hosts file doesn't do wildcards, so you must track down & enumerate every offensive host at every blocked domain & put each one in a separate line in your hosts file. Not only that, when <blocked_domain>.<tld> adds a new server, you must discover it & add it.
Consider the HOSTS file from www.accs-net.com/hosts
I grepped it for each of the domains that had a host "ad250", piping the result through wc -l
, here the results:
(I know a guy whose hosts file runs over 30,000 entries! Of course, he is doing serious malware as well as ad blocking.)
You're much better off taking the proxy server suggestion or using DNS.
If you want to pursue using DNS, you might consider adding dnsmasq
to your router. Besides being a small combo DHCP & DNS server, you can block whole domains w/ one simple line per entire domain in its config file.
If you already have Bind running, then see http://pgl.yoyo.org/adservers/
for information on how to get it to block domains.
are especially useful.