Adblock - not working for two lan interfaces

Hi All,

I have installed a adblock-3.8 package along with luci-app-adblock, Integration went well with latest openwrt .
My problem starts here I want to blacklist few sites in my access point where I have two interfaces lan and lan-1, I want to apply adblock on one interface lan-1 and one without adblock blacklisting.
I am stuck with the question how ?I need urgent help..
I did get sm solution which states that create two instances of dnsmasq and reload it should work
but hard luck.
Please, if smone could help me out will be thankful.

kind regards

1 Like

Thanks a lot , multiple instance of DNSmasq worked for me :slight_smile:

Few observations and concerns:
1- what /usr/bin/adblock.sh file does ?
2- MACbookPro , adblock is not able to blacklist the site any idea why ?
3- With multiple instance of dnsmasq and adblock applied on one out of multiple instances, current adbock report takes time to get reflected , why ?
4- is it not possible to get adblock applied on all the dnsmasq instances ?
kind regards,

Downloads and compiles the blacklists for Dnsmasq.

Make sure it uses OpenWrt as the only DNS server.
Also disable browser proxy, VPN, DoH, etc. if any.

Probably you should ask here.

Clone the serversfile option to each Dnsmasq instance.

Hi..

  • Above solution works for mac book pro but isn't it a hack where blacklisting will be overruled coming from my access point ?
  • is there a way we can force the user not use the external DNS resolver ?
  • Clone the serversfile option to each Dnsmasq instance but i want that each interface can blacklist the sites which they want to blacklist , cloning will block same sites on all the interface , hope it sounds correct ?

You can intercept plain DNS queries, however there's not much you can do with VPN and DoH.

It sounds like you want to run multiple Adblock instances with different settings.
I'm not sure about it, but you can ask the author @dibdot.

thanks for your support middle of testing this feature will surely need your support to get more knowledge on it.

kind regards

1 Like

Hi,

  • why adblock only gets triggered when i manually execute this command
    /etc/init.d/adblock retsart/start
    but not though web interface by enable = 1

  • why status is not working for me
    /etc/init.d/adblock status
    ::: adblock runtime information
    /etc/rc.common: line 143: json_load_file: not found
    WARNING: Variable 'data' does not exist or is not an array/object

  • why I see so many tcpdump processes running in my PS , I think everytime I trigger adblock i see new process of adblock in my process status, why is it so ?

plz help

kind regards

  • Did you add a cron job, per the instructions?
  • Please explain if you are rebooting after you change this setting.

Why do you keep triggering Adblock anyways?

Also, because of that error, you may wish try a clean install to ensure that there are not other issues.

1 Like

Possible bug? For me adblock is working fine. It starts as it should and then it also gets reloaded when I make changes through LuCI. If you are using SNAPSHOT version then maybe there can be unexplained bugs. My adblock current version is 3.5.5-2.

Again works fine for me. See the output below. There can be a bug in your installed version.

root@HomeHub5A:~# service adblock status
::: adblock runtime information
  + adblock_status  : enabled
  + adblock_version : 3.5.5-2
  + overall_domains : 71999 (normal mode)
  + fetch_utility   : /usr/bin/wget (built-in)
  + dns_backend     : dnsmasq (/tmp)
  + last_rundate    : 27.09.2019 19:08:11
  + system_release  : BT Home Hub 5A, OpenWrt 18.06.4 r7808-ef686b7292

I think this is correct behavior in case you are killing a process and then recreating it.

1 Like

I am testing this feature so enabling/disabling from GUI also rebooting to understand the behaviour of each parameter.

  • I understand that everytime I trigger adblock new process gets recreated but old entry in the PS should go , which is not happening in my case , was concerned if so many tcpdump old processes running may affect the system.

kind regards

HI,

When I reboot my AP , adblock doesn't get triggered by itself.
Is there a script or mechanism through which I can automatically restart adblock after rebooting of the AP.
I didn't add cron job ...

Please provide the output of ubus call service list '{"name":"adblock","verbose": true}' and post the global section of your adblock config.

Hi Drik,

Sure, plz find

uci show adblock

adblock.global=adblock
adblock.global.adb_basever='3.8'
adblock.global.adb_dns='dnsmasq'
adblock.global.adb_dnsvariant='null (IPv4/IPv6)'
adblock.global.adb_fetchutil='wget'
adblock.global.adb_trigger='none'
adblock.global.adb_dnsinstance='1'
adblock.global.adb_enabled='1'
adblock.extra=adblock
adblock.extra.adb_debug='0'
adblock.extra.adb_forcedns='0'
adblock.extra.adb_report='1'
adblock.extra.adb_maxqueue='4'
adblock.extra.adb_blacklist='/etc/adblock/adblock.blacklist'
################################################################################
{
	"adblock": {
		
	},
       "cron": {
		"instances": {
			"instance1": {
				"running": true,
				"pid": 1454,
				"command": [
					"\/usr\/sbin\/crond",
					"-f",
					"-c",
					"\/etc\/crontabs",
					"-l",
					"5"
				]
			}
		}
	},
"dnsmasq": {
		"instances": {
			"cfgdnsmasq": {
				"running": true,
				"pid": 4019,
				"command": [
					"\/usr\/sbin\/dnsmasq",
					"-C",
					"\/var\/etc\/dnsmasq.conf.cfgdnsmasq",
					"-k",
					"-x",
					"\/var\/run\/dnsmasq\/dnsmasq.cfgdnsmasq.pid"
				],
				"respawn": {
					"threshold": 3600,
					"timeout": 5,
					"retry": 5
				}
			},
			"grpStd": {
				"running": true,
				"pid": 4020,
				"command": [
					"\/usr\/sbin\/dnsmasq",
					"-C",
					"\/var\/etc\/dnsmasq.conf.grpStd",
					"-k",
					"-x",
					"\/var\/run\/dnsmasq\/dnsmasq.grpStd.pid"
				],
				"respawn": {
					"threshold": 3600,
					"timeout": 5,
					"retry": 5
				}
			}
		}
	},

################################################################################

Kind regards

You've disabled your trigger interface, therefore adblock won't come up on boot. Set it to your used wan/lan interface or to "timed" which starts adblock after 30 seconds (by default).

2 Likes

thanks Drik... it worked for me.. basically it is timing issue of the scripts eg network script.

-there is another issue which keeps popping up
the domain eg facebook.com which is there in my blacklist after 3/10 times reboot opens the facebook page. logically , it shdn't happen. I tried dnsflush option but issuestill exists , am I missing something ?
thanks in advance..
kind regards...

just to add to my previous question.
adblock service is working but facebook is in blacklist ..when I check /etc/init.d/adblock report
instead of NX it shows OK

In which blacklist exactly?
By default, Adblock downloads blacklists on startup and it may fail if the download fails.

It's also possible that client uses some fallback DNS which bypasses the router.
Make sure you intercept DNS queries on the router.

/etc/Adblock/Adblock.blacklist

1 Like

This is the list in /etc/Adblock/Adblock.list