steventblack / ad-blocker

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

Long list of errors in DNS Server log #5

Open mfigrs opened 5 years ago

mfigrs commented 5 years ago

After running the ad-blocker.sh script my DNS Server log filled with 30 pages of comments like this: "/etc/zone/data/ad-blocker.db:2959: unknown option 'zone'"

Any idea what's causing it, and how to fix it?

mfigrs commented 5 years ago

Re-running the script did not help. DNSserver has shut down with a critical error.

I have un-done all the changes, and then used the simpler script from: https://synologytweaks.wordpress.com/2015/08/23/use-synology-as-an-ad-blocker/

This works.

However, I would still like to use your script because of blacklist and whitelist features. Any idea what might have caused the errors?

hbertsch commented 5 years ago

Same issue here with a DS216j version DSM 6.2.2-24922

djavorek commented 3 years ago

Same issue here. Anyone who found solution? I have to use the linked script as well.

djavorek commented 3 years ago

Deleted the zone in DSM, then deleted the database file by hand. Recreated everything and works like a charm. Give it a try.

ZeroQI commented 3 years ago

Troubleshooting notes:

Actions taken

root@NAS:/usr/local/bin# sudo wget -O ad-blocker.sh "https://raw.githubusercontent.com/steventblack/ad-blocker/master/ad-blocker.sh"
--2021-04-17 11:41:37--  https://raw.githubusercontent.com/steventblack/ad-blocker/master/ad-blocker.sh
Resolving raw.githubusercontent.com... 185.199.108.133, 185.199.109.133, 185.199.110.133, ...
Connecting to raw.githubusercontent.com|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6709 (6.6K) [text/plain]
Saving to: 'ad-blocker.sh'

ad-blocker.sh       100%[===================>]   6.55K  --.-KB/s    in 0s

2021-04-17 11:41:38 (31.9 MB/s) - 'ad-blocker.sh' saved [6709/6709]

root@NAS:/usr/local/bin# sudo chown root:root ad-blocker.sh
root@NAS:/usr/local/bin# sudo chmod +x ad-blocker.sh
root@NAS:/usr/local/bin# sudo ./ad-blocker.sh
Running as root; switching to DNSServer
--2021-04-17 11:42:01--  http://pgl.yoyo.org/as/serverlist.php?hostformat=bindconfig&showintro=0&mimetype=plaintext
Resolving pgl.yoyo.org... 213.230.210.230
Connecting to pgl.yoyo.org|213.230.210.230|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://pgl.yoyo.org/as/serverlist.php?hostformat=bindconfig&showintro=0&mimetype=plaintext [following]
--2021-04-17 11:42:01--  https://pgl.yoyo.org/as/serverlist.php?hostformat=bindconfig&showintro=0&mimetype=plaintext
Connecting to pgl.yoyo.org|213.230.210.230|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/plain]
Saving to: 'STDOUT'

-                       [ <=>                ] 263.90K  --.-KB/s    in 0.1s

2021-04-17 11:42:02 (2.19 MB/s) - written to stdout [270237]

rndc: 'reload' failed: failure

@steventblack ad-blocker address added crashing the DNS (reverting https://github.com/steventblack/ad-blocker/commit/6bc2754045146db7a3d95be72f9dfdc01c163d19 fixes it) Edit: https://github.com/steventblack/ad-blocker/blob/master/ad-blocker.sh lines 112-113 :

error moved to: /etc/zone/data/ad-blocker.db:18223: unknown option 'zone' cannot change settings, clear logs

re-created zone, used your script ok added

syndication.exdynsrv.com
cdn.cloudvideosa.com
adskeeper.co.uk

/etc/zone/data/ad-blocker.db:3593: zone 'cdn.cloudvideosa.com': missing 'file' entry /etc/zone/data/ad-blocker.db:3592: zone 'syndication.exdynsrv.com': missing 'file' entry reloading configuration failed: failure

removed ALL blacklist entries launch script in SSH again bunch of zone banner.linux.se/IN: zone serial (2021041700) unchanged. zone may fail to transfer to slaves. deleted recreated zone launch script in SSH again All good (no blacklist entries), just one entry: zone null.zone.file/IN: zone serial (2021041700) unchanged. zone may fail to transfer to slaves.

Seem like blacklist is broken... Full fix:echo "zone \"$Domain\" { type master; notify no; file \"null.zone.file\"; };" >> "$BlockList" No longer crashing changes entries:

at least stable now and can add entries, unsures why these ones fail to be imported...

Note:

DNS local cache to go faster: (readme section to be added?)

raphaeldas commented 2 years ago

Check out the pull request #16. there are some changes to the shell script i had to apply to make it work for me.