What's new

adblocker with host file

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Give these two dns servers a try. 87.118.111.215 and 80.79.54.55. You can look them up on Google. They block ads and trackers.

Sent from my GT-I9505 using Tapatalk 4
 
One thing I noticed is that whatever method the Asus firmware has built in to block a URL, that method moves too slow to be of much use. I've tried it and it causes pages to hang when it comes to an ad of a URL that I'm blocking. Using OpenDNS worked very fast, but they aren't IPV6 yet and my ISP is both pretty fast and also IPV6.

I've heard of people wanting to do this via hosts files, and also via iptables, but I just don't know that side of the router well enough to do much than copy and paste.

In my dream world I want to be able to do this, have it snappy like OpenDNS, be able to modify (add or potentially delete from the list very easily), and ideally maybe block countries by IP range also. I'd love to be able to literally subscribe the service to ones that you can point AdBlock's browser extension to (they are very open with them).

So far all I've seen is ideas of scripts, but never a script or other such functionality that was working for anyone that they themself used that did all those things. . .I had relegated this project, for my own network at least, off for the future when maybe I'll throw Smoothwall or Untangle or Sophos UTM on a machine and try it out (in between by WAN and LAN), hoping that one of those UIs could compensate for the facts that I'm not good w/ scripts and also accomplish the other things I'm looking to have it do.

And in a dream world I'd love to jam my chrome google search blocked domains down the throat of every google result on my network. Just saying... ;)

Curious to hear what you find or what others report, besides just other suggested scripts they have heard of. I want to find someone that is using it and can say "it works, it's fast, it's easy to modify."
 
Last edited:
Thanks for your reply

I agree with you, DNS servers are the easiest way to block ads.
Unfortunately most of these servers provides ads them self or if an address is not found they route you to a search engine.
A further problem is (as i know), that it's not possible to block ad-subdirectories per DNS.

A host file has much more possibilities, so i would prefer to implement that one.
 
Been using those dns servers for a couple of days now and no problems with slowness or ads from the dns service provider. Does exactly what i need. Block ads and video ads in many site like YouTube.

Sent from my GT-I9505 using Tapatalk 4
 
I tried to copy a hosts file to /jffs/configs/hosts
after a reboot, the hosts file appears at /tmp/etc/hosts
a traceroute from the router to some ad pages is now redirected to localhost

but this does not have any effect to the connected devices, the communications to this addresses are still working :(

I also deleted the dns cache (ipconfig /flushdns) on my notebook.

I do not have any special network/router functionality knowledge, so why does the host file has no effect?

Thanks for our help
 
I tried to copy a hosts file to /jffs/configs/hosts
after a reboot, the hosts file appears at /tmp/etc/hosts
a traceroute from the router to some ad pages is now redirected to localhost

but this does not have any effect to the connected devices, the communications to this addresses are still working :(

I also deleted the dns cache (ipconfig /flushdns) on my notebook.

I do not have any special network/router functionality knowledge, so why does the host file has no effect?

Thanks for our help


I think you and I are at a similar level with the special router functionality knowledge, and because of that, I cannot answer your question. ;) However, I did some googling and found a couple things that may be of interest.

First are one and two ideas that other WRTs run to block ads. Maybe worth kicking around if either of these scripts are decent, and will run on our routers.

Secondly, a very light googling makes me think hosts files only run directly on computers, not on routers. All the info I found on editing and modifying them spoke of doing so directly on computers. This might be helpful, on at least some kinds of ad blocking, but it'd be nice to also address the portable, non desktop OS devices on my network.

That said, this site appeared to have good instructions on how to edit the hosts in a Win enviornment, and this article on Lifehacker/Makeuseof had a good explanation of how to do it in terminal on OSX, and this had a cool way to do it as a prefpane on OSX via MacUpdate, and this project on Github seems similar doing it the prefpane way on the Mac.

If nothing else, maybe these links or this info will be helpful to the next person.
 
Ads on network
I ended up ordering a dedicated arm device to deal with ads/blocking domains from
Bluepoint security on ks/indiegogo that's shipping now. Supposed to arrive this week. Tell you how it works out

Sent from my BNTV600 using Tapatalk 4
 
No I didn't end up going that route as I was concerned about writing to the jffs partition too often as I remembered reading the warning on the wiki that too many writes is going to wear out the flash.

I started investigating to see if there is a way to do it so it would read it from the SD/USB card instead but then read the custom config entry on the wiki noticed that the hosts has to be in the /jffs/configs/ folder to overridden so decided to just stick with ABP Chrome extensions on the computers and put up with the limited number of ads that show up on the tablets.

Thank you very much for sharing that. I saw you participated in that earlier thread, are you currently running this?
 

Very cool, but less than ideal (for my particular goals) due to the overhead that running a proxy consumes hence the "only do this for mobile devices" recommendation.

Would love to have just one thing to update/modify/tweak, etc. for the entire network. Hmm. . .not sure, might still do the dedicated appliance way.
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top