Adblock 4 pre-releases

Please post your current adblock config.

Edit: and your dhcp config as well!

root@LPM:~# cat /etc/config/dhcp 

config dnsmasq
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option expandhosts '1'
	option readethers '1'
	option resolvfile '/tmp/resolv.conf.auto'
	option nonwildcard '0'
	option leasefile '/root/dhcp.leases'
	list rebind_domain 'gk2.net'
	option localservice '0'
	option quietdhcp '1'
	option boguspriv '0'
	list server '212.27.40.240'
	list server '212.27.40.241'
	list server '2a01:e00::2'
	list server '2a01:e00::1'
	list server '8.8.8.8'
	list server '9.9.9.9'
	option authoritative '1'
	option confdir '/root/adblock'
root@LPM:~# cat /etc/config/adblock

config adblock 'global'
	option adb_mail '0'
	option adb_backup '1'
	option adb_dns 'dnsmasq'
	option adb_safesearchmoderate '1'
	option adb_report '1'
	option adb_repiface 'br-lan'
	option adb_debug '1'
	option adb_dnsfilereset '1'
	option adb_backupdir '/root/adblock'
	option adb_tmpbase '/root/adblock'
	option adb_dnsdir '/root/adblock'
	option adb_safesearch '0'
	option adb_maxqueue '4'
	list adb_sources 'energized_porn'
	list adb_sources 'utcapitole_porn'
	option adb_forcedns '1'
	option adb_fetchutil 'uclient-fetch'
	option adb_enabled '0'

If I activate flushdns option, I get the error...

First of all archive handling is broken in current pre3, therefore you can't use utcaptilole and shalla ATM (will be fixed in pre4).
Second, you've misconfigured adblock in certain ways: backup, temp and dns directory is the same in your config - that can't work, e.g. dnsmasq tries to read the dnsdir and find backups from adblock as well ...
Please don't use flash space (wear leveling!) and please use different directories for temp, dns and backups.

this is my adblock configuration with dnsmasq in an espressobin v7 2gb

config adblock 'global'
	option adb_enabled '1'
	option adb_forcedns '0'
	option adb_safesearch '0'
	option adb_mail '0'
	option adb_report '1'
	option adb_repiface 'br-lan'
	option adb_debug '1'
	option adb_trigger 'wan'
	option adb_dnsfilereset '0'
	option adb_maxqueue '8'
	option adb_backup '1'
	option adb_backupdir '/mnt/sdb1/Adblock'
	option adb_fetchutil 'curl'
	option adb_dns 'dnsmasq'
	list adb_sources 'adaway'
	list adb_sources 'adguard'
	list adb_sources 'andryou'
	list adb_sources 'bitcoin'
	list adb_sources 'disconnect'
	list adb_sources 'dshield'
	list adb_sources 'hphosts'
	list adb_sources 'malwaredomains'
	list adb_sources 'malwarelist'
	list adb_sources 'notracking'
	list adb_sources 'openphish'
	list adb_sources 'phishing_army'
	list adb_sources 'smarttv'
	list adb_sources 'spam404'
	list adb_sources 'sysctl'
	list adb_sources 'whocares'
	list adb_sources 'winhelp'
	list adb_sources 'yoyo'

Adblock debug

Tue Mar 24 11:53:44 2020 user.info adblock-3.99pre3[8993]: adblock instance started ::: action: reload, priority: 0, pid: 8993
Tue Mar 24 11:53:44 2020 user.debug adblock-3.99pre3[8993]: f_jsnup  ::: status: running, cnt: 231473, mail: 0, mail_service: /etc/adblock/adblock.mail, mail_cnt: 0, mail_pid: -
Tue Mar 24 11:53:44 2020 user.debug adblock-3.99pre3[8993]: f_uci    ::: config: dhcp, change:
Tue Mar 24 11:53:45 2020 user.debug adblock-3.99pre3[8993]: f_uci    ::: config: firewall, change:
Tue Mar 24 11:53:45 2020 user.debug adblock-3.99pre3[8993]: f_temp   ::: tmp_base: /tmp, tmp_dir: /tmp/tmp.dBLIHo, cores: 2, sort_options: --temporary-directory=/tmp/tmp.dBLIHo --compress-program=gzip --batch-size=32 --parallel=2, pid_file: /var/run/adblock.pid
Tue Mar 24 11:53:45 2020 user.debug adblock-3.99pre3[8993]: f_main   ::: mem_total: 2045, mem_free: 26, max_queue: 8, safe_search: 0, force_dns: 0, awk: /usr/bin/awk
Tue Mar 24 11:53:45 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: blacklist, mode: blacklist, cnt: 0, in_rc: 0, out_rc: 0
Tue Mar 24 11:53:45 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: whitelist, mode: whitelist, cnt: 0, in_rc: 0, out_rc: 0
Tue Mar 24 11:53:46 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: disconnect, mode: download, cnt: 2735, in_rc: 0, out_rc: 0
Tue Mar 24 11:53:46 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: disconnect, mode: backup, cnt: 2735, in_rc: 0, out_rc: 0
Tue Mar 24 11:53:47 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: bitcoin, mode: download, cnt: 688, in_rc: 0, out_rc: 0
Tue Mar 24 11:53:47 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: bitcoin, mode: backup, cnt: 688, in_rc: 0, out_rc: 0
Tue Mar 24 11:53:49 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: adaway, mode: download, cnt: 12174, in_rc: 0, out_rc: 0
Tue Mar 24 11:53:49 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: adaway, mode: backup, cnt: 12174, in_rc: 0, out_rc: 0
Tue Mar 24 11:53:54 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: andryou, mode: download, cnt: 32239, in_rc: 0, out_rc: 0
Tue Mar 24 11:53:54 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: andryou, mode: backup, cnt: 32239, in_rc: 0, out_rc: 0
Tue Mar 24 11:53:55 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: malwaredomains, mode: download, cnt: 26849, in_rc: 0, out_rc: 0
Tue Mar 24 11:53:55 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: malwaredomains, mode: backup, cnt: 26849, in_rc: 0, out_rc: 0
Tue Mar 24 11:53:55 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: adguard, mode: download, cnt: 30071, in_rc: 0, out_rc: 0
Tue Mar 24 11:53:55 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: adguard, mode: backup, cnt: 30071, in_rc: 0, out_rc: 0
Tue Mar 24 11:54:00 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: hphosts, mode: download, cnt: 45732, in_rc: 0, out_rc: 0
Tue Mar 24 11:54:00 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: hphosts, mode: backup, cnt: 45732, in_rc: 0, out_rc: 0
Tue Mar 24 11:54:01 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: dshield, mode: download, cnt: 98410, in_rc: 0, out_rc: 0
Tue Mar 24 11:54:01 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: dshield, mode: backup, cnt: 98410, in_rc: 0, out_rc: 0
Tue Mar 24 11:54:02 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: malwarelist, mode: download, cnt: 1104, in_rc: 0, out_rc: 0
Tue Mar 24 11:54:03 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: malwarelist, mode: backup, cnt: 1104, in_rc: 0, out_rc: 0
Tue Mar 24 11:54:03 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: smarttv, mode: download, cnt: 196, in_rc: 0, out_rc: 0
Tue Mar 24 11:54:03 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: smarttv, mode: backup, cnt: 196, in_rc: 0, out_rc: 0
Tue Mar 24 11:54:04 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: spam404, mode: download, cnt: 7064, in_rc: 0, out_rc: 0
Tue Mar 24 11:54:04 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: spam404, mode: backup, cnt: 7064, in_rc: 0, out_rc: 0
Tue Mar 24 11:54:04 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: openphish, mode: download, cnt: 2248, in_rc: 0, out_rc: 0
Tue Mar 24 11:54:04 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: openphish, mode: backup, cnt: 2248, in_rc: 0, out_rc: 0
Tue Mar 24 11:54:05 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: phishing_army, mode: download, cnt: 13485, in_rc: 0, out_rc: 0
Tue Mar 24 11:54:05 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: phishing_army, mode: backup, cnt: 13485, in_rc: 0, out_rc: 0
Tue Mar 24 11:54:08 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: sysctl, mode: download, cnt: 20567, in_rc: 0, out_rc: 0
Tue Mar 24 11:54:08 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: sysctl, mode: backup, cnt: 20567, in_rc: 0, out_rc: 0
Tue Mar 24 11:54:08 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: whocares, mode: download, cnt: 14402, in_rc: 0, out_rc: 0
Tue Mar 24 11:54:08 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: whocares, mode: backup, cnt: 14402, in_rc: 0, out_rc: 0
Tue Mar 24 11:54:13 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: notracking, mode: download, cnt: 117637, in_rc: 0, out_rc: 0
Tue Mar 24 11:54:13 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: notracking, mode: backup, cnt: 117637, in_rc: 0, out_rc: 0
Tue Mar 24 11:54:15 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: yoyo, mode: download, cnt: 3275, in_rc: 0, out_rc: 0
Tue Mar 24 11:54:15 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: yoyo, mode: backup, cnt: 3275, in_rc: 0, out_rc: 0
Tue Mar 24 11:54:16 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: winhelp, mode: download, cnt: 10475, in_rc: 0, out_rc: 0
Tue Mar 24 11:54:16 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: winhelp, mode: backup, cnt: 10475, in_rc: 0, out_rc: 0
Tue Mar 24 11:54:18 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: -, mode: merge, cnt: 294671, in_rc: 4, out_rc: 0
Tue Mar 24 11:54:28 2020 user.debug adblock-3.99pre3[8993]: f_tld    ::: source: /tmp/tmp.dBLIHo/adb_list.overall, cnt: 294671, cnt_tld: 231532
Tue Mar 24 11:54:35 2020 user.debug adblock-3.99pre3[8993]: f_list   ::: name: -, mode: final, cnt: 231532, in_rc: 4, out_rc: 0
Tue Mar 24 11:54:42 2020 user.debug adblock-3.99pre3[8993]: f_dnsup  ::: lookup_util: /usr/bin/nslookup, lookup_domain: example.com, restart_rc: 0, dns_timeout: 5, dns_cnt: 2, in_rc: 0, out_rc: 0
Tue Mar 24 11:54:42 2020 user.debug adblock-3.99pre3[8993]: f_jsnup  ::: status: enabled, cnt: 231532, mail: 0, mail_service: /etc/adblock/adblock.mail, mail_cnt: 0, mail_pid: -
Tue Mar 24 11:54:42 2020 user.info adblock-3.99pre3[8993]: blocklist with overall 231532 blocked domains loaded successfully (Globalscale Marvell ESPRESSOBin Board V7, OpenWrt SNAPSHOT r12697-835d1c68a0)
Tue Mar 24 11:54:42 2020 user.debug adblock-3.99pre3[8993]: f_rmtemp ::: tmp_dir: /tmp/tmp.dBLIHo, src_file: /tmp/adb_sources.json, pid_file: /var/run/adblock.pid

/etc/config/dhcp

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 localservice '1'
	option noresolv '1'
	option localuse '1'
	...
	option confdir '/tmp/dnsmasq.d'
	option cachesize '1000'

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

config dhcp 'wan'
	option interface 'wan'
	option ignore '1'

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

option confdir '/tmp/dnsmasq.d'

Thanks, is this just for reference or did you run in any problems (I can't see any)? :wink:
Said that, I've done some smoke tests with my raspi 4 ... selected all lists and hit "Go" ...

This small device is really a beast ... :wink:

My fault, is a reference by the comment of the previous user, I forgot to include the reply

@erdoukki
try switching between

option confdir '/root/adblock'

to

option confdir '/tmp/dnsmasq.d'
1 Like

BTW, this option will be set by adblock automatically and 'tmp/dnsmasq.d' is the used default.

Great work @dibot! If was giving it a test here as well and it seems to work fine. The only issue I found was that the logview tab is getting blocked by Firefox' uBlock Origin addon. For whatever reason, /logview.js is on the EasyPrivacy blocklist. Maybe rename the view to adblocklog.js or similar to avoid it getting blocked by uBlock.

2 Likes

I would just like to echo what Jow said. Grate work. Bin rocking this for a few days now and all seems to be fine. I am still on pre1 tho What's the url to install pre4?

1 Like

I've uploaded pre4 to my github repo with the following changes:

  • fix archive download handling (shalla, utcaptiole)
  • rename 'logview.js' to 'logread.js' to fix erroneous
    XHR/JS blocking by ublock origin (browser-plugin)
  • make the frontpage much more responsive,
    reduce the poll intervall to 1 second and dynamically
    disable/re-enable the polling after that
  • Print memory statistics after backend loading
    (within the 'last run' information) - Total/Free/Available
  • fine tune the list preparation/selection, i.e. add a new 'focus'
    field in the JSON structure to characterize the list
  • raise the default dns backend timeout to handle
    better reload situations with big lists
  • more error handling, e.g. to catch misconfigurations better
  • re-introduce the additional 'Jail' list creation under 'Advanced DNS Settings'
  • hopefully the last pre-release ...:wink:

Thanks for all your testing efforts and feedback, much appreciated!

@jow many thanks, I've renamed the javascript file to 'logread.js' and ublock origin was happy again! :wink:
@tapper I've updated the download links in the first post!

2 Likes

still no success...

Thu Mar 26 09:50:22 2020 user.info adblock-3.99pre4[7952]: ubus/adblock monitor started
Thu Mar 26 09:50:22 2020 user.debug adblock-3.99pre4[7041]: f_rmtemp ::: tmp_dir: /root/adblock/tmp/tmp.PocMpc, src_file: /tmp/adb_sources.json, pid_file: /var/run/adblock.pid
Thu Mar 26 09:51:27 2020 user.debug adblock-3.99pre4[8161]: f_dns    ::: dns: dnsmasq, dns_dir: /root/adblock/dns, dns_file: adb_list.overall, dns_user: dnsmasq, dns_inotify: 1, dns_instance: 0, backup: 1, backup_dir: /root/adblock/bak, jail_dir: /tmp
Thu Mar 26 09:51:27 2020 user.debug adblock-3.99pre4[8161]: f_fetch  ::: fetch_util: /bin/uclient-fetch, fetch_parm: --timeout=20 -O
Thu Mar 26 09:51:27 2020 user.debug adblock-3.99pre4[8161]: f_bgserv ::: status: stop, bg_pid: 7952 7960 7961 , dns_filereset: 1, ubus_service: /etc/adblock/adblock.monitor
Thu Mar 26 09:51:27 2020 user.debug adblock-3.99pre4[8161]: f_report ::: action: reload, report: 1, search: +, count: 50, process: false, print: false, dump_util: /usr/sbin/tcpdump, repdir: /tmp, repiface: br-lan, replisten: 53, repchunksize: 1, repchunkcnt: 5, bg_pid: 811
Thu Mar 26 09:51:27 2020 user.info adblock-3.99pre4[8161]: adblock instance started ::: action: reload, priority: 0, pid: 8161
Thu Mar 26 09:51:27 2020 user.debug adblock-3.99pre4[8161]: f_jsnup  ::: status: running, cnt: 2610231, mail: 0, mail_service: /etc/adblock/adblock.mail, mail_cnt: 0, mail_pid: -
Thu Mar 26 09:51:27 2020 user.debug adblock-3.99pre4[8161]: f_uci    ::: config: dhcp, change:
Thu Mar 26 09:51:28 2020 user.debug adblock-3.99pre4[8161]: f_uci    ::: config: firewall, change:
Thu Mar 26 09:51:28 2020 user.debug adblock-3.99pre4[8161]: f_temp   ::: tmp_base: /root/adblock/tmp, tmp_dir: /root/adblock/tmp/tmp.Dhhgkp, cores: 2, sort_options: --temporary-directory=/root/adblock/tmp/tmp.Dhhgkp --compress-program=gzip --batch-size=32 --parallel=2, pid_file: /var/run/adblock.pid
Thu Mar 26 09:51:28 2020 user.debug adblock-3.99pre4[8161]: f_main   ::: memory: 1022/828/902, max_queue: 4, safe_search: 1, force_dns: 1, awk: /usr/bin/awk
Thu Mar 26 09:51:28 2020 user.debug adblock-3.99pre4[8161]: f_list   ::: name: blacklist, mode: blacklist, cnt: 0, in_rc: 0, out_rc: 0
Thu Mar 26 09:51:28 2020 user.debug adblock-3.99pre4[8161]: f_list   ::: name: whitelist, mode: whitelist, cnt: 0, in_rc: 0, out_rc: 0
Thu Mar 26 09:51:28 2020 user.debug adblock-3.99pre4[8161]: f_list   ::: name: youtube, mode: safesearch, cnt: 10, in_rc: 0, out_rc: 0
Thu Mar 26 09:51:28 2020 user.debug adblock-3.99pre4[8161]: f_list   ::: name: yandex, mode: safesearch, cnt: 14, in_rc: 0, out_rc: 0
Thu Mar 26 09:51:28 2020 user.debug adblock-3.99pre4[8161]: f_list   ::: name: bing, mode: safesearch, cnt: 2, in_rc: 0, out_rc: 0
Thu Mar 26 09:51:28 2020 user.debug adblock-3.99pre4[8161]: f_list   ::: name: duckduckgo, mode: safesearch, cnt: 3, in_rc: 0, out_rc: 0
Thu Mar 26 09:51:28 2020 user.debug adblock-3.99pre4[8161]: f_list   ::: name: pixabay, mode: safesearch, cnt: 3, in_rc: 0, out_rc: 0
Thu Mar 26 09:51:28 2020 user.debug adblock-3.99pre4[8161]: f_list   ::: name: google, mode: safesearch, cnt: 436, in_rc: 0, out_rc: 0
Thu Mar 26 09:56:08 2020 user.debug adblock-3.99pre4[8161]: f_list   ::: name: utcapitole_porn, mode: download, cnt: 2001366, in_rc: 0, out_rc: 0
Thu Mar 26 09:56:10 2020 user.debug adblock-3.99pre4[8161]: f_list   ::: name: utcapitole_porn, mode: backup, cnt: 2001366, in_rc: 0, out_rc: 0
Thu Mar 26 09:56:44 2020 user.debug adblock-3.99pre4[8161]: f_list   ::: name: -, mode: merge, cnt: 2001366, in_rc: 4, out_rc: 0
Thu Mar 26 10:00:01 2020 user.debug adblock-3.99pre4[8161]: f_tld    ::: source: /root/adblock/tmp/tmp.Dhhgkp/adb_list.overall, cnt: 2001366, cnt_tld: 2000809
Thu Mar 26 10:01:45 2020 user.debug adblock-3.99pre4[8161]: f_list   ::: name: -, mode: final, cnt: 2000809, in_rc: 4, out_rc: 0
Thu Mar 26 10:01:45 2020 user.debug adblock-3.99pre4[8161]: f_dnsup  ::: lookup_util: /usr/bin/nslookup, lookup_domain: example.com, restart_rc: -, dns_timeout: 10, dns_cnt: 0, in_rc: 0, out_rc: 0
Thu Mar 26 10:01:45 2020 user.debug adblock-3.99pre4[8161]: f_jsnup  ::: status: enabled, cnt: 2000809, mail: 0, mail_service: /etc/adblock/adblock.mail, mail_cnt: 0, mail_pid: -
Thu Mar 26 10:01:45 2020 user.info adblock-3.99pre4[8161]: blocklist with overall 2000809 blocked domains loaded successfully and reset afterwards (Globalscale Marvell ESPRESSOBin Board V7 (eMMC), OpenWrt 19.07.2 r10947-65030d81f3)
Thu Mar 26 10:01:46 2020 user.debug adblock-3.99pre4[8161]: f_bgserv ::: status: start, bg_pid: -, dns_filereset: 1, ubus_service: /etc/adblock/adblock.monitor
Thu Mar 26 10:01:46 2020 user.info adblock-3.99pre4[9458]: ubus/adblock monitor started
Thu Mar 26 10:01:46 2020 user.debug adblock-3.99pre4[8161]: f_rmtemp ::: tmp_dir: /root/adblock/tmp/tmp.Dhhgkp, src_file: /tmp/adb_sources.json, pid_file: /var/run/adblock.pid
root@LPM:~# ls /root/adblock/ -Rlah
/root/adblock/:
drwxr-xr-x    5 root     root        4.0K Mar 26 09:50 .
drwxr-xr-x    3 root     root        4.0K Mar 24 09:24 ..
drwxr-xr-x    2 root     root        4.0K Mar 26 09:56 bak
drwxr-xr-x    2 root     root        4.0K Mar 24 12:02 dns
drwxr-xr-x    2 root     root        4.0K Mar 26 10:01 tmp

/root/adblock/bak:
drwxr-xr-x    2 root     root        4.0K Mar 26 09:56 .
drwxr-xr-x    5 root     root        4.0K Mar 26 09:50 ..
-rw-r--r--    1 root     root       12.1M Mar 26 09:57 adb_list.utcapitole_porn.gz
-rw-r--r--    1 root     root         503 Mar 25 20:18 safesearch.google.gz

/root/adblock/dns:
drwxr-xr-x    2 root     root        4.0K Mar 24 12:02 .
drwxr-xr-x    5 root     root        4.0K Mar 26 09:50 ..
-rw-r--r--    1 dnsmasq  root           0 Mar 26 10:01 adb_list.overall

/root/adblock/tmp:
drwxr-xr-x    2 root     root        4.0K Mar 26 10:01 .
drwxr-xr-x    5 root     root        4.0K Mar 26 09:50 ..

root@LPM:~# cat /etc/config/adblock

config adblock 'global'
	option adb_mail '0'
	option adb_backup '1'
	option adb_dns 'dnsmasq'
	option adb_safesearchmoderate '1'
	option adb_report '1'
	option adb_repiface 'br-lan'
	option adb_debug '1'
	option adb_maxqueue '4'
	option adb_forcedns '1'
	option adb_dnsdir '/root/adblock/dns'
	option adb_backupdir '/root/adblock/bak'
	option adb_tmpbase '/root/adblock/tmp'
	option adb_enabled '1'
	option adb_safesearch '1'
	option adb_safesearchmod '1'
	option adb_fetchutil 'uclient-fetch'
	option adb_dnsfilereset '1'
	list adb_sources 'utcapitole_porn'
	option adb_dnsflush '1'

root@LPM:~# cat /etc/config/dhcp 

config dnsmasq
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option expandhosts '1'
	option readethers '1'
	option resolvfile '/tmp/resolv.conf.auto'
	option nonwildcard '0'
	option leasefile '/root/dhcp.leases'
	list rebind_domain 'gk2.net'
	option localservice '0'
	option quietdhcp '1'
	option boguspriv '0'
	option domain 'lpm.nddc.gk2.net'
	list server '212.27.40.240'
	list server '212.27.40.241'
	list server '2a01:e00::2'
	list server '2a01:e00::1'
	list server '8.8.8.8'
	list server '9.9.9.9'
	option local '/lpm.nddc.gk2.net/'
	option authoritative '1'
	option confdir '/root/adblock/dns'


It looks like that you've enabled "dns_inotify" during your test run, cause adblock didn't restart your dnsmasq instance after blocklist creation (no 'restart_rc'!). Just leave this option alone and re-test please.

Edit, yep my dns_inotify assumption was correct:

1 Like
Thu Mar 26 12:00:52 2020 user.debug adblock-3.99pre4[12576]: f_tld    ::: source: /root/adblock/tmp/tmp.IohLmb/adb_list.overall, cnt: 2001366, cnt_tld: 2000809
Thu Mar 26 12:02:35 2020 user.debug adblock-3.99pre4[12576]: f_list   ::: name: -, mode: final, cnt: 2000809, in_rc: 4, out_rc: 0
Thu Mar 26 12:02:55 2020 user.debug adblock-3.99pre4[12576]: f_dnsup  ::: lookup_util: /usr/bin/nslookup, lookup_domain: example.com, restart_rc: 0, dns_timeout: 10, dns_cnt: 11, in_rc: 0, out_rc: 4
Thu Mar 26 12:02:55 2020 user.err adblock-3.99pre4[12576]: dns backend restart with adblock blocklist failed
Thu Mar 26 12:03:01 2020 user.debug adblock-3.99pre4[12576]: f_dnsup  ::: lookup_util: /usr/bin/nslookup, lookup_domain: example.com, restart_rc: 0, dns_timeout: 10, dns_cnt: 0, in_rc: 4, out_rc: 0
Thu Mar 26 12:03:01 2020 user.debug adblock-3.99pre4[12576]: f_rmtemp ::: tmp_dir: /root/adblock/tmp/tmp.IohLmb, src_file: /tmp/adb_sources.json, pid_file: /var/run/adblock.pid
Thu Mar 26 12:03:01 2020 user.debug adblock-3.99pre4[12576]: f_rmdns  ::: dns: dnsmasq, status: true, dns_dir: /root/adblock/dns, dns_file: adb_list.overall, rt_file: /tmp/adb_runtime.json, backup_dir: /root/adblock/bak
Thu Mar 26 12:03:02 2020 user.debug adblock-3.99pre4[12576]: f_bgserv ::: status: stop, bg_pid: -, dns_filereset: 0, ubus_service: /etc/adblock/adblock.monitor
Thu Mar 26 12:03:02 2020 user.debug adblock-3.99pre4[12576]: f_jsnup  ::: status: error, cnt: 0, mail: 0, mail_service: /etc/adblock/adblock.mail, mail_cnt: 0, mail_pid: -

edit: the generated file size is 0
-rw-r--r-- 1 dnsmasq root 0 Mar 26 12:02 adb_list.overall

Then raise the dns_timeout, e.g. to 20 seconds. Most probably your system needs more time to restart dnsmasq with such a huge list.

Regarding file size: in error cases adblock always resets the blocklist, to keep the dns backend running in a stable state.

1 Like

YES !
Raising the dns_timeout to 30 seconds make the system restart dnsmasq correctly.

Thanks (again)

1 Like

Great, please be so kind and send back the debug log (logread -e "f_dnsup") - thanks!

root@LPM:~# logread -e "f_dnsup"
Thu Mar 26 09:14:02 2020 user.debug adblock-3.99pre4[3932]: f_dnsup  ::: lookup_util: /usr/bin/nslookup, lookup_domain: example.com, restart_rc: 0, dns_timeout: 10, dns_cnt: 11, in_rc: 0, out_rc: 4
Thu Mar 26 09:14:09 2020 user.debug adblock-3.99pre4[3932]: f_dnsup  ::: lookup_util: /usr/bin/nslookup, lookup_domain: example.com, restart_rc: 0, dns_timeout: 10, dns_cnt: 0, in_rc: 4, out_rc: 0
Thu Mar 26 09:32:32 2020 user.debug adblock-3.99pre4[5453]: f_dnsup  ::: lookup_util: /usr/bin/nslookup, lookup_domain: example.com, restart_rc: -, dns_timeout: 10, dns_cnt: 0, in_rc: 0, out_rc: 0
Thu Mar 26 09:50:22 2020 user.debug adblock-3.99pre4[7041]: f_dnsup  ::: lookup_util: /usr/bin/nslookup, lookup_domain: example.com, restart_rc: -, dns_timeout: 10, dns_cnt: 0, in_rc: 0, out_rc: 0
Thu Mar 26 10:01:45 2020 user.debug adblock-3.99pre4[8161]: f_dnsup  ::: lookup_util: /usr/bin/nslookup, lookup_domain: example.com, restart_rc: -, dns_timeout: 10, dns_cnt: 0, in_rc: 0, out_rc: 0
Thu Mar 26 11:52:17 2020 user.debug adblock-3.99pre4[12576]: f_dnsup  ::: lookup_util: /usr/bin/nslookup, lookup_domain: example.com, restart_rc: 0, dns_timeout: 10, dns_cnt: 0, in_rc: 0, out_rc: 0
Thu Mar 26 12:02:55 2020 user.debug adblock-3.99pre4[12576]: f_dnsup  ::: lookup_util: /usr/bin/nslookup, lookup_domain: example.com, restart_rc: 0, dns_timeout: 10, dns_cnt: 11, in_rc: 0, out_rc: 4
Thu Mar 26 12:03:01 2020 user.debug adblock-3.99pre4[12576]: f_dnsup  ::: lookup_util: /usr/bin/nslookup, lookup_domain: example.com, restart_rc: 0, dns_timeout: 10, dns_cnt: 0, in_rc: 4, out_rc: 0
Thu Mar 26 15:26:12 2020 user.debug adblock-3.99pre4[15072]: f_dnsup  ::: lookup_util: /usr/bin/nslookup, lookup_domain: example.com, restart_rc: 0, dns_timeout: 30, dns_cnt: 0, in_rc: 0, out_rc: 0
Thu Mar 26 15:36:40 2020 user.debug adblock-3.99pre4[15072]: f_dnsup  ::: lookup_util: /usr/bin/nslookup, lookup_domain: example.com, restart_rc: 0, dns_timeout: 30, dns_cnt: 16, in_rc: 0, out_rc: 0
root@LPM:~# 


OK, thanks. I'll raise the default to 20 seconds in 4.0 release to be on the save side.

1 Like

PRs for adblock 4.0.0 has been added to the main OpenWrt repos - thanks to all pre-testers and your valuable feedback!

I'll close this thread now!

Edit: I can't close/solve this thread, maybe one of the moderators could help!? :wink:

4 Likes