steventblack / ad-blocker

Simple ad-blocker for Synology devices
54 stars 14 forks source link

DSM 7.0 incompatible #13

Closed mullasci closed 2 years ago

mullasci commented 3 years ago

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]

mullasci commented 3 years ago

"sed" also needs to be changed otherwise the script succeeds, but the block is not working

mullasci commented 3 years ago

Revised version with change in the sed processing Name resolution works and ads are gone on DSM7

ad-blocker.sh.txt

ssg commented 2 years ago

@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.

ssg commented 2 years ago

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

mullasci commented 2 years ago

@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.