Adblock not working

I have trouble getting Adblock to work. Yesterday I installed the package incl. luci app on a freshly reset installation of OpenWRT.
It's supposed to work without further configuration I understand.
But it's not really blocking anything.
Although it shows
Status / Version
enabled / 4.1.4
Blocked Domains
96,902
In DNSmasq I have configured external downstream DNS servers.

Strange thing is it first seemed to work and then stopped working.

This part is a little ambiguous. If you hand out external DNS servers as part of your DHCP lease, those will circumvent adblock running on your router's IP(s).

1 Like

But when I don't enter DNS servers in dnsmasq I get no connection to no website it seems..
So this is not correct to set DNS forwardings in DNSMASQ?

resolv.conf:
Generated by NetworkManager
search lan
nameserver 192.168.210.1

I post some info about adblock config:

root@OpenWrt:~#  uci show adblock
adblock.global=adblock
adblock.global.adb_debug='0'
adblock.global.adb_safesearch='0'
adblock.global.adb_dnsfilereset='0'
adblock.global.adb_mail='0'
adblock.global.adb_backup='1'
adblock.global.adb_dns='dnsmasq'
adblock.global.adb_fetchutil='wget'
adblock.global.adb_sources='android_tracking' 'energized' 'firetv_tracking' 'smarttv_tracking' 'stevenblack'
adblock.global.adb_report='0'
adblock.global.adb_forcedns='0'
adblock.global.adb_enabled='1'
adblock.global.adb_stb_sources='hosts'
root@OpenWrt:~# 

config dnsmasq
	option domainneeded '1'
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option local '/lan/'
	option domain 'lan'
	option expandhosts '1'
	option authoritative '1'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases'
	option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
	option localservice '1'
	option ednspacket_max '1232'
	option confdir '/tmp/dnsmasq.d'
	list server '192.168.100.1'

config dhcp 'lan'
	option interface 'lan'
	option start '100'
	option limit '150'
	option leasetime '12h'
	option dhcpv4 'server'
	option dhcpv6 'server'
	option ra 'server'
	list ra_flags 'managed-config'
	list ra_flags 'other-config'

config dhcp 'wan'
	option interface 'wan'
	option ignore '1'
	option start '100'
	option limit '150'
	option leasetime '12h'

config odhcpd 'odhcpd'
	option maindhcp '0'
	option leasefile '/tmp/hosts/odhcpd'
	option leasetrigger '/usr/sbin/odhcpd-update'
	option loglevel '4'



you should probably set dnsmasq to forward the dns requests to your local adblock ?

1 Like

In case I forward to local I get the same result as not forwarding:

Thu Sep 29 14:34:31 2022 user.info adblock-4.1.4[6758]: download of 'android_tracking' failed, url: https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/android-tracking.txt, rule: /^([[:alnum:]_-]{1,63}\.)+[[:alpha:]]+([[:space:]]|$)/{print tolower($1)}, categories: -, rc: 4, log: --2022-09-29 14:34:26--  https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/android-tracking.txt Resolving raw.githubusercontent.com... failed: Try again. wget: unable to resolve host address 'raw.githubusercontent.com'

there's a diff between setting the DNS for the clients, and the router....

1 Like

I don't know how to proceed. Any thoughts?

set your router to use your ISPs DNS servers.

set your clients to use the router's LAN IP as DNS, and hope the adblock works as intended, via dnsmasq.

I see in the report that some DNS queries indeed going through the Adblock and few are getting blocked. But not all that are in the blocklist. What can be the reason?

have you disabled DoH in your browsers, DoT on your Android devices,
and blocked all hardcoded DNSes in the apps ?

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.