Closed mullasci closed 2 years ago
"sed" also needs to be changed otherwise the script succeeds, but the block is not working
Revised version with change in the sed processing Name resolution works and ads are gone on DSM7
@mullasci This doesn't work on the latest DSM 7. I'm getting "missing file entry". Adding a bogus file entry works, but ad blocking doesn't work. DNS requests get propagated normally.
EDIT: Apparently ad blocking works and I had stale cache somewhere. I made this change to the script to make it work:
Changed this line:
echo "zone \"$Domain\" { type master; notify no;};" >> "$BlockList"
to this:
echo "zone \"$Domain\" { type master; notify no; file \"\";};" >> "$BlockList"
Here is the latest version: ad-blocker.sh.txt
@ssg it looks like @steventblack is not very active in the last year Maybe you can consider creating a fork dedicated only to DSM 7? In the end for DSM 6 there isn't much that needs to be done with the existing script.
DSM7 made several changes with some of the 6.x internal packages becoming "external" in terms of management. This breaks the main script, wich worked fine across version of DSM in the past.
/etc/zone/data/
in DSM7 becomes/volume1/@appstore/DNSServer/named/etc/zone/data/
the hack below seems to work fine on DSM 7 after removing the old
include "/etc/zone/data/ad-blocker.db";
line from/volume1/@appstore/DNSServer/named/etc/zone/data/null.zone.file
[edit: removed obsolete file, refer to the newer one in the most recent comment]