Just configure upstream dns server on these clients, e.g. google or others.
@dibdot Can that be done from the router, or is a per client setup? . Ideally I'd want it to happen automatically without the client changing anything.
Updated to OpenWrt 23.05.5 from 23.05.4
Also started getting the error
Sat Nov 23 12:43:59 2024 user.info adblock-[5055]: backup directory '/tmp/adblock/backup' created
Sat Nov 23 12:43:59 2024 user.info adblock-[5055]: DEBUG ::: 200 packages
Sat Nov 23 12:43:59 2024 user.info adblock-[5055]: adblock instance started ::: action: start, priority: 0, pid: 5055
DNS Backend was set to dnsmasq, changed to RAW, Blocked Domains download without error, but ads are not blocked.
I checked the directory \tmp\dnsmasq.d\ on the router, there is a file inside adb_list.overall.
Same applies to you ...
solved the problem, removed dnsmasq and installed dnsmasq-full, rebooted
A brief note on our own behalf: in master- and 24.10-branch is a new adblock release. Among other things, it includes significant performance improvements.
Edit: runtime statistics of a full reload with the new version on an Openwrt One (the old version takes approx. 20-30 sec. longer):
::: adblock runtime information
+ adblock_status : enabled
+ adblock_version : 4.2.3-r1
+ blocked_domains : 782678
+ active_sources : adguard, doh_blocklist, hagezi, winspy
+ dns_backend : dnsmasq (-), /tmp/dnsmasq.d
+ run_utils : download: /usr/bin/curl, sort: /usr/libexec/sort-coreutils, awk: /usr/bin/gawk
+ run_ifaces : trigger: trm_wwan, report: br-lan
+ run_directories : base: /tmp, backup: /tmp/adblock-Backup, report: /tmp/adblock-Report, jail: /tmp
+ run_flags : backup: β, tld: β, force: β, flush: β, search: β, report: β, mail: β, jail: β
+ last_run : reload, 0m 58s, 647 MB available, 1792 KB max. used, 2024-11-25T20:19:02+01:00
+ system : OpenWrt One, mediatek/filogic, OpenWrt 24.10-SNAPSHOT r28033-c279ca8b79
Tested with the following sources/categories:
list adb_sources 'adguard'
list adb_sources 'doh_blocklist'
list adb_sources 'hagezi'
list adb_sources 'winspy'
list adb_hag_sources 'pro-onlydomains.txt'
list adb_hag_sources 'tif-onlydomains.txt'
Is it possible to make it possible to create ready-made presets for searching, so that you donβt have to enter them manually every time?
In general no problem, what kind of presets did you have in mind?
Any customizable.
For example, there are 30 devices in the network, of which I often need to monitor 5.
In order not to write their name in the filters every time, you could save 5 presets to choose from (for example, in a drop-down menu) and choose the one you are interested in from this list.
Or monitor specific sites, add presets for each of them.
I'm having a slightly different issue.
When my VLANs were part of a bridged interface ("br-lan"), then I could simply specify the Report Interface to be "br-lan" and everything worked as expected.
But now I have moved to a NON-bridged physical interface (eth1) with VLANs (e.g. eth1.10, eth1.20, eth1.30, etc.) and it is failing to report anything when I set Report Interface to "eth1".
It works when I set to "any" but that also includes my WAN interface, which I do not want to report on (because it is showing me essentially duplicate values - e.g. the original DNS query from eth1 VLAN and then again from the WAN interface).
Help?!
Thanks.
...I guess a follow-up question to the above would be: Can I specify >1 interface in the Report Interface field? (I think this is a straight tcpdump
command, so I'm afraid the answer is No, after trying several times.) Thanks!
Yep, that's right. Unfortunately tcpdump only supports a single interface or 'any' for all ... multiple interfaces are not supported - sorry.
Thanks for the fast reply... but what about your thoughts for me using a single physical interface (e.g. eth1) that has VLANs running over it? I just can't get it to work, even though a bridged interface (e.g. br-lan) with VLANs works perfectly fine.
You'd think tcpdump wouldn't know/care about the differences between a physical or logical i/f. Frustrating.
Thanks again, though.
Hello,
I have adblock working great but I was wondering if there was a way to allow a certain ip to not use it adblock?
Ie i block youtube but its across the whole subnet,
I am trying to log blocked Requests by Adblock/openwrt
I am using this package:
1.https://github.com/openwrt/packages/blob/master/net/adblock/files/README.md
Hey, I am trying to log total "blocked" requests in a json file like this :
{
"TOTAL": 39100,
"BLOCKED": 16172
}
which is being extracted from "adb_reports.json".
But, when I refresh the report to generate current report json file, start_timestamp and end_timestamp changes (don't know how and when it changes), so I can't compute actual total numbers.
my code is attached below.
#!/bin/bash
# Path to the JSON file
JSON_S_FILE="adb_report.json"
# Path to extracted datd file
JSON_O_FILE="stored_data.json"
# Check if the JSON file exists
if [ ! -f "$JSON_S_FILE" ]; then
echo "Error: JSON file '$JSON_S_FILE' not found!"
exit 1
fi
# Extract specific values using jq
TOTAL=$(jq -r '.total' "$JSON_S_FILE")
BLOCKED=$(jq -r '.blocked' "$JSON_S_FILE")
#updating values in extracted data file
if [ -s $JSON_O_FILE ] && jq empty $JSON_O_FILE >/dev/null 2>&1; then
#if exists & valid
echo "The JSON file is valid and not empty."
jq --arg total "$TOTAL" --arg blocked "$BLOCKED" \
'{"TOTAL": ((.TOTAL|tonumber) + ($total|tonumber)),
"BLOCKED": ((.BLOCKED|tonumber) + ($blocked|tonumber))}' \
"$JSON_O_FILE" > temp.json && mv temp.json "$JSON_O_FILE"
else
#if not, create & write!!
echo "The JSON file is either empty or not valid."
echo "{\"TOTAL\": \"$TOTAL\", \"BLOCKED\": \"$BLOCKED\"}" >stored_data.json
fi
Problem is that this package doesn't generate adb_report.json on its own, when I generate that json file the time stamps changes, don't know when and how,
sample Json is like below:
"start_date": "2024-12-24",
"start_time": "22:13:12",
"end_date": "2024-12-25",
"end_time": "01:05:04",
"total": "6076",
"blocked": "4355",
"percent": "71.68%",
anyone know how the starting and ending time stamps change; or is there any better way to log total block requests??
thank you!
Take a look in /tmp/adblock-Report/
, where you'll see the pcap files used to generate reports. They are logged in round-robin fashion, so as not to fill the disk. As the entries age out, the reporting window changes accordingly.
I have a toggle switch in my HomeAssistant (HA) that was able to let me toggle my ads using FreshTomato.
I recently moved to OpenWrt and was able to use these 3 adblock commands in the latest version:
resume
turn blocking onsuspend
turn blocking offstatus
get current blocking status
However, the status as read by /etc/init.d/adblock status
takes up to 1 min to report the correct state and that causes the toggle switch to misbehave.
Is there a way to have the status report "what it should be" in under 1 second?
adblock status always reports the correct status. Suspend always checks if the dns backend is still running correctly (which takes time). Resume rebuilds the blocklist and checks the dns backend as well.
If you're need a fast feedback, just check if the file "adb_list.overall" (by default located in /tmp/dnsmasq.d) is empty (suspend/disabled) or filled (resume/enabled).
That worked! Thanks!