Simple-adblock: fast, lean and fully uci/luci configurable AdBlocking

Most likely it's because these devices have their own DNS cache and the previous (valid) IP addresses were stored in the cache. Rebooting the device (or manually resetting DNS cache) usually helps.

1 Like

I assumed so, then I pulled out a few of my old phones, used incognito mode, and verified it was using the right dns using a terminal emulator and checking ifconfig. It would still access the blocked sites with easy-adblock and was unable to access them when I set up adblock.

Well, either way I have a working solution for my problem with samsung forcing ads onto my TV and spying on me!

I will play with david's firmware you linked out of curiosity

I've updated the information service stores in ubus, hence I've updated the WebUI to better reflect the status of the service and show any errors (if any occurred) and also made a minor improvement in service start/stop and reload usability in WebUI.

I would appreciate feedback. If you come by anything unusual, post the screenshots of the WebUI + output of logread -e simple-adblock.

1 Like

I verify that clearing the DNS Cache is a necessary step on a Ubuntu PC (and I'm certain on Windows, too):

  • I boot the router with Adblock enable = 0
  • I go to site with ads
  • I enable Adblock = 1 and reload
  • I can still browse to the sites and ads already loaded in cache
  • I disconnect the Ethernet cable from the client until it shows as disconnected
  • I plug in the Ethernet cable
  • When I browse to a site with ads, they no longer appear

On a Windows PC, run:

ipconfig /flushdns

1 Like
root@Archer_C7:~# logread -e simple-adblock
Thu Jul 12 15:13:28 2018 user.notice simple-adblock [2487]: Reloading simple-adblock 1.6.3-0...
Thu Jul 12 15:13:29 2018 user.notice simple-adblock [2487]: [DL] Blocked Domains: localhost [✓]
Thu Jul 12 15:13:30 2018 user.notice simple-adblock [2487]: [DL] Blocked Domains: s3.amazonaws.com [✓]
Thu Jul 12 15:13:30 2018 user.notice simple-adblock [2487]: [DL] Blocked Hosts: raw.githubusercontent.com [✓]
Thu Jul 12 15:13:30 2018 user.notice simple-adblock [2487]: [DL] Blocked Domains: ssl.bblck.me [✓]
Thu Jul 12 15:13:31 2018 user.notice simple-adblock [2487]: [DL] Blocked Hosts: adaway.org [✓]
Thu Jul 12 15:13:31 2018 user.notice simple-adblock [2487]: [DL] Blocked Hosts: pgl.yoyo.org [✓]
Thu Jul 12 15:13:32 2018 user.notice simple-adblock [2487]: [DL] Blocked Domains: dshield.org [✓]
Thu Jul 12 15:13:32 2018 user.notice simple-adblock [2487]: Sorting combined list [✓]
Thu Jul 12 15:13:34 2018 user.notice simple-adblock [2487]: Optimizing combined list [✓]
Thu Jul 12 15:13:34 2018 user.notice simple-adblock [2487]: Whitelisting domains [✓]
Thu Jul 12 15:13:34 2018 user.notice simple-adblock [2487]: Formatting merged file [✓]
Thu Jul 12 15:13:34 2018 user.notice simple-adblock [2487]: Creating dnsmasq config [✓]
Thu Jul 12 15:13:34 2018 user.notice simple-adblock [2487]: Removing temporary files [✓]
Thu Jul 12 15:13:39 2018 user.notice simple-adblock [2487]: Restarting dnsmasq [✓]
Thu Jul 12 15:13:39 2018 user.notice simple-adblock [2487]: service is blocking 5634 domains ✓
Thu Jul 12 15:13:40 2018 daemon.info procd: Not starting instance simple-adblock::instance1, command not set
Thu Jul 12 15:13:40 2018 user.notice simple-adblock [3010]: service is blocking 5634 domains ✓
Thu Jul 12 15:13:40 2018 daemon.info procd: Not starting instance simple-adblock::instance1, command not set
Thu Jul 12 15:13:40 2018 user.notice simple-adblock [3389]: service is blocking 5634 domains ✓
Thu Jul 12 15:13:40 2018 daemon.info procd: Not starting instance simple-adblock::instance1, command not set
Thu Jul 12 15:13:51 2018 user.notice simple-adblock [4137]: service is blocking 5634 domains ✓
Thu Jul 12 15:13:51 2018 daemon.info procd: Not starting instance simple-adblock::instance1, command not set
Thu Jul 12 15:14:05 2018 user.notice simple-adblock [4674]: service is blocking 5634 domains ✓
Thu Jul 12 15:14:05 2018 daemon.info procd: Not starting instance simple-adblock::instance1, command not set

Are the "command not set" notices considered unusual?

I'm aware of that, sadly without starting actual daemon, I don't know how to get rid of it: PROCD service -- how to push status to ubus? - #6 by stangri.

Fixed in simple-adblock 1.6.3-1 thanks to jow!

Nice. I also noticed a minor formatting inconsistency with status symbol lacking square brackets upon reporting number of blocked domains (lines 374 and 377 in init need extra underscores around OK and FAIL?). Otherwise, all is good. :+1:

root@Archer_C7:~# /etc/init.d/simple-adblock restart
Stopping simple-adblock 1.6.3-1...
Restarting dnsmasq [✓]
simple-adblock 1.6.3-1 stopped.
Starting simple-adblock 1.6.3-1...
Found existing data file, reusing it [✓]
Restarting dnsmasq [✓]
simple-adblock 1.6.3-1 is blocking 5634 domains ✓
1 Like

Thank you for noticing. Fixed in simple-adblock 1.6.3-2.

Hi.

Running simple-adblock on a tl-wdr4300 with OpenWrt 18.06.0-rc2.
In Services menu I have to two Simple AdBlock entries.
First points to /cgi-bin/luci/admin/services/simpleadblock (looks outdated).
Second points to /cgi-bin/luci/admin/services/simple-adblock.

Package: simple-adblock
Version: 1.6.3-5

Package: luci-app-simple-adblock
Version: git-18.201.34715-c813598-15

Regards

Same issue occurs with latest OpenWRT trunk.

@n8b, @shamoi -- does rm -rf /var/luci-modulecache/; rm -f /var/luci-indexcache; or router reboot help?

@stangri - tried all - still two entries in Services.

Thanks for your prompt reply. What does ls /usr/lib/lua/luci/controller/simple*.lua say?

root@wdr4300:~# ls /usr/lib/lua/luci/controller/simple*.lua
/usr/lib/lua/luci/controller/simple-adblock.lua /usr/lib/lua/luci/controller/simpleadblock.lua

Well, no idea why the old controller file wasn't removed, but this should help:

rm -f /usr/lib/lua/luci/controller/simpleadblock.lua
rm -rf /var/luci-modulecache/; rm -f /var/luci-indexcache;

That did it :slight_smile: obsolete entry is gone.
And uninstall / install luci-app-simple-adblock brings it back.

Ah, it was a bad PR on my part, I'll send another one momentarily.

When this one gets merged, run: opkg update; opkg upgrade luci-app-simple-adblock;.

Until then, you can do:

rm -f /usr/lib/lua/luci/controller/simpleadblock.lua
rm -rf /var/luci-modulecache/; rm -f /var/luci-indexcache;

to get rid of the extra entry.

But, with the exception of the stale controller file, how are you liking the new Web UI for simple-adblock?

Much better than the old one.
I like the headlines, the tabs and especially the Status and the stop/start button :slightly_smiling_face:

Thanks for your efford on this.