Adblock support thread

Hello everyone!
sorry to disturb you but i have a small problem using this great script.
I'm using adblock release 2.6.2 on LEDE Reboot 17.01.1.

I think that whitelist is not working as expected.
My experience:

From my pc:
C:\Users\rust>ping rarbg.to

Pinging rarbg.to [127.0.0.1] with 32 bytes of data:
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128

from the router:
root@ArcherC7:~# ping rarbg.to
PING rarbg.to (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: seq=0 ttl=64 time=0.222 ms
64 bytes from 127.0.0.1: seq=1 ttl=64 time=0.225 ms

root@ArcherC7:~# /etc/init.d/adblock query rarbg.to
::: distinct results for domain 'rarbg.to'
no match
root@ArcherC7:~# cat /etc/adblock/adblock.whitelist
adf.ly
analytics.google.com
bit.ly
rarbg.to

thank you for your support !
kind regards

Check that you've defined an appropriate interface trigger (this is 'wan' in the default config), also check this post Adblock support thread - #111 by dibdot

Whitelist function is OK, probably you've mixed up different adblock solutions ... adblock 2.x didn't redirect to 127.0.0.1, it sends only "NXDOMAIN". Please doublecheck your /etc/hosts file or other blocklist locations you've defined.

I'd suggest you use opendns familyshield dns to block most adult sites. It works perfect on mine and I get to only block around 30,000 domains for that matter since the dns handles blocking unwanted sites.

Hi All,

I have installed Adblock-2.6.3 version in my board which has OpenWRT support. Even I enabled all blocklist sources, No domains are added from the blocklist source. Please see below logs for reference,

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

Tue May 9 11:13:27 2017 user.notice adblock-[2.6.3] debug: name: winhelp, mode: remove, count: 0, in_rc: 1, out_rc: 0
Tue May 9 11:13:27 2017 user.notice adblock-[2.6.3] debug: name: yoyo, enabled: 1, url: https://pgl.yoyo.org/adservers/serverlist.php?hostfor}
Tue May 9 11:13:27 2017 user.notice adblock-[2.6.3] debug: name: yoyo, mode: restore, count: 0, in_rc: 1, out_rc: 1
Tue May 9 11:13:27 2017 user.notice adblock-[2.6.3] debug: name: yoyo, mode: remove, count: 0, in_rc: 1, out_rc: 0
Tue May 9 11:13:27 2017 user.notice adblock-[2.6.3] debug: name: zeus, enabled: 1, url: https://zeustracker.abuse.ch/blocklist.php?download=d}
Tue May 9 11:13:27 2017 user.notice adblock-[2.6.3] debug: name: zeus, mode: restore, count: 0, in_rc: 1, out_rc: 1
Tue May 9 11:13:27 2017 user.notice adblock-[2.6.3] debug: name: zeus, mode: remove, count: 0, in_rc: 1, out_rc: 0

Tue May 9 11:13:30 2017 user.notice adblock-[2.6.3] info : block lists with overall 0 domains loaded successfully (OpenWrt Barrier Breaker r4)

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

I suspect the issue could be in download utility, so I have installed multiple combinations wget with SSL support, wget without ssl support, uclient-fetch with ustream-ssl support. But it doesn't help. Still I face above issue.

Could anyone tell me what could be the cause for this issue and what are the the pre-requisites packages to be installed for making this great script to work.

Kindly help! Thanks in advance...

@Vigneshwaran Barrier Breaker is quite old and fairly unsupported, anyway please install full wget package and post the output of the following command:

/usr/bin/wget --no-config --quiet --no-cache --no-cookies --max-redirect=0 --timeout=10 --no-check-certificate -O https://adaway.org/hosts.txt

also post the output of ...
command -v wget

Hi Dibdot,

Thanks for the quick response. Below are the outputs,

$$$$$$$$$$$$$$$$$$$$$$$$

/usr/bin/wget --no-config --quiet --no-cache --no-cookies --max
-redirect=0 --timeout=10 --no-check-certificate -O https://adaway.org/hosts.txt
/usr/bin/wget: unrecognized option '--no-config'
Usage: wget [OPTION]... [URL]...

Try `wget --help' for more options.

But below command works for me,

/usr/bin/wget --no-cache --no-cookies --max-redirect=0 --timeou
t=10 --no-check-certificate -O URL https://adaway.org/hosts.txt

Resolving adaway.org... 2400:cb00:2048:1::6818:6859, 104.24.104.89, 104.24.105.89
Connecting to adaway.org|2400:cb00:2048:1::6818:6859|:443... failed: Permission denied.
Connecting to adaway.org|104.24.104.89|:443... connected.
WARNING: cannot verify adaway.org's certificate, issued by '/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=COMODO ECC Domain Val:
Unable to locally verify the issuer's authority.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/plain]
Saving to: 'URL'

[ <=>                                   ] 13,722      73.9KB/s   in 0.2s   

2017-05-09 13:43:33 (73.9 KB/s) - 'URL' saved [13722]

$$$$$$$$$$$$$$$$$$$$$$$$

command -v wget
/usr/bin/wget

$$$$$$$$$$$$$$$$$$$$$$$$
This is my current adblock status,

/etc/init.d/adblock status

::: adblock runtime information
status : no domains blocked
adblock_version : 2.6.3
blocked_domains : 0
fetch_info : wget (built-in)
dns_backend : dnsmasq
last_rundate : 09.05.2017 13:35:55
system : OpenWrt Barrier Breaker r43761

$$$$$$$$$$$$$$$$$$$$$$$$

Please do the needful, Thanks

To fix this issue in Barrier Breaker please add the following two options to your /etc/config/adblock (global section):

option adb_fetch '/usr/bin/wget'
option adb_fetchparm '--quiet --no-cache --no-cookies --max-redirect=0 --timeout=10 --no-check-certificate -O'

After that restart adblock ... fingers crossed! :wink:

edit: fix adb_fetchparm

:disappointed: No luck.. Same result..

cat /etc/config/adblock | head -15

config adblock 'global'
option adb_enabled '1'
option adb_fetch '/usr/bin/wget'
option adb_fetchparm '--no-cache --no-cookies --max -redirect=0 --timeout=10 --no-check-certificate -O'
option adb_debug '0'
option adb_forcesrt '0'
option adb_iface 'wan'
option adb_triggerdelay '2'
option adb_whitelist '/etc/adblock/adblock.whitelist'
option adb_whitelist_rset '$1 ~/^([A-Za-z0-9_-]+.){1,}[A-Za-z]+/{print tolower("^"$1"\|[.]"$1)}'
option adb_backup '0'
option adb_backupdir '/mnt'
option adb_rtfile '/tmp/adb_runtime.json'
option adb_forcedns '1'

output of logread,

Tue May 9 14:01:22 2017 user.notice adblock-[2.6.3] info : block lists with overall 0 domains loaded successfully (OpenWrt Barrier Breaker r4)

Please remove the blank in "max -redirect" and try again.

:grinning: Thanks alot Dibdot.. It worked now :slight_smile:

/etc/init.d/adblock status
::: adblock runtime information
status : active
adblock_version : 2.6.3
blocked_domains : 3305
fetch_info : wget (built-in)
dns_backend : dnsmasq
last_rundate : 09.05.2017 14:22:24
system : OpenWrt Barrier Breaker r43761

Once again, thanks for the great support ....

Hi @dibdot. Thanks for pointing me to the interface trigger. After updating package from 2.6.0-2 to 2.6.2 my config file was still the old one, so the adblock.global.adb_iface variable was not defined yet: No result in uci -q get adblock.global.adb_iface. I added the latest options from the repository's default config file and now adblock is started at boot again. Thanks for your great work!

I tried to reset my LEDE router, and it was the same. I investigated the problem and it was my providers DNS that was resolving rarbg.to as 127.0.0.1.
Sorry that I have wasted your time!
thank you for your support!

Now.... let's rock!

I don't mean to ask a stupid question.
Anyway, somewhere in the thread it was mentioned, I think, that unbound is compatible with adblock. How do you switch 'the dns backend'? Are you only allowed to have one installed at a time [dnsmasq or unbound]?
I hope this makes sense. I am just tinkering and am not very knowledgeable.

It's all detected and integrated automatically by adblock. For various unbound installation options, see excellent unbound readme.

Adblock supports either dnsmasq or unbound at the same time. The default dns backend priority is dnsmasq than unbound (you can override this).

1 Like

@dibdot

Is there any way to block websites using some keywords? Say for example when I enter keyword as "facebook" it should block all websites with a keyword "facebook" (www.facebook.com, www.facebook.co.in) etc?

Please let me know!

Thanks

No, use your personal blacklist for that, e.g. to block facebook use these domains:

facebook.com
facebook.net
fbcdn.com
fbcdn.net
fbsbx.com
fb.me
fb.com

Okay Thanks @dibdot.

I have some more queries,

  1. Even when adblock enabled is set to 1, after reboot it is not enabled by default. Again I need to restart to make it enable. Is this normal?

  2. If I need to disable forcedns option, does restarting the adblock is the only way to make the change effective? If so it is again start downloading websites which takes some time. Is there any way we can do without restarting the adblock?

  3. Will this adblock feature blocks only the ads from website? I enabled this features and ads in the websites are blocked, but when I use some app in my mobile still I get ads ?

Awaiting for your response..!

Thanks.

No, adblock will be started automatically by procd interface trigger ... I doubt that BB support this. Add an adblock entry to your rc.local file as a workaround, e.g. something like that:

[...]
sleep 10
/etc/init.d/adblock start 

it's a standard firewall rule in LEDE. Look for "config redirect 'adblock_dns'" in your /etc/config/firewall file, remove that block and restart your firewall ... or use adblock to maintain this entry ...:smirk:

No, adblock works on DNS level - this works effectively on all kinds of wlan gadgets. Maybe you need additional block lists or your app comes with pre-loaded ads.

@dibdot

Thanks for your response,

Actually I'm getting this error log when I execute init script of adblock. Does this can be any reason for not starting by default after reboot?

/etc/init.d/adblock status
::: adblock runtime information
status : active
adblock_version : 2.6.3
blocked_domains : 116407
fetch_info : wget (built-in)
dns_backend : dnsmasq
last_rundate : 11.05.2017 13:59:30
system : OpenWrt Barrier Breaker r43761
/etc/rc.common: line 1: procd_add_interface_trigger: not found