Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long list of errors in DNS Server log #5

Open
mfigrs opened this issue Mar 20, 2019 · 6 comments
Open

Long list of errors in DNS Server log #5

mfigrs opened this issue Mar 20, 2019 · 6 comments

Comments

@mfigrs
Copy link

mfigrs commented Mar 20, 2019

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
Copy link
Author

mfigrs commented Mar 21, 2019

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
Copy link

Same issue here with a DS216j version DSM 6.2.2-24922

@djavorek
Copy link
Contributor

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

@djavorek
Copy link
Contributor

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

@ZeroQI
Copy link

ZeroQI commented Apr 17, 2021

Troubleshooting notes:

  • Had DNS server not starting and had to remove and reinstall
  • I did have a bunch of entries i added to the blacklist (removed comments)
  • 147 pages of errors[18223 to 3610]: /etc/zone/data/ad-blocker.db:3624: zone '778669.com': missing 'file' entry
  • Not allowing deleting logs "The operation failed. Please log in to DSM again and retry.", same on saving resolution settings
  • vi /var/packages/DNSServer/target/named/etc/zone/data/ad-blocker.db shows from 3592missing 'line' field
  • stopped working since the update to DSM 6.2.1-23824. but rebuilding fixed it according Recent issues #4 and this thread

Actions taken

  • deleted the 'null.zone.file' zone
  • deleting logs worked, saying zone started
  • Re-created the zone, launched the commands again
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
  • Not working for me (using another account than 'admin' but with admin rights on DSM 6.2.4 -25556)

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

  • from: ` echo "zone "$Domain" { type master; notify no;};" >> "$BlockList"````
  • to: echo "zone \"$Domain\" { type master; notify no; file \"/etc/zone/master/null.zone.file\"; };" >> "$BlockList"

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

  • disabled zone
  • cleared settings
  • removed all entries from /usr/local/etc/ad-blocker-bl.conf
  • re-enabled zone: does not go back up

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:

  • exdynsrv.com: zone exdynsrv.com/IN: loading from master file null.zone.file failed: file not found
  • cloudvideosa.com: zone cloudvideosa.com/IN: loading from master file null.zone.file failed: file not found

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

Note:

  • List of third part repositories: https://search.synopackage.com/
  • "Config File Editor" v1.6 (Synology italia, original form Mertymade but 1.4 at latest, doesn't work with recent DSM) allow editing of existing files from DSM directly
  • we can already add "/usr/local/etc/ad-blocker-bl.conf,Ad-blocker blacklist" to the last drop down entry in "Config file editor", reopen the app and we can select the blacklist and edit live without SSH, perfect to add entries on the fly...
  • we can add /usr/local/bin/ad-blocker.sh,ad-blocker.sh to the last drop down entry in "Config file editor", reopen the app and we can select the script, and edit the path to the one script

DNS local cache to go faster: (readme section to be added?)
- enable forwarder, launch https://www.grc.com/dns/benchmark.htm, to check your router DNS (add it) and open DNS
- Forwarder 1: 9.9.9.9 (best for me, lowest red, biggest blue and greed)
- second best: 192.168.0.1 (my ISP, 1.0.0.1 was not far)
- Forward policy: forward first
o DNS Firewall: add port to "Remote (by apps)" group (local, all subnet can do everything, remote by region for dsm https port as using reverse proxy for all else, remote all for apps: dns, proxy, BT, emule)

@raphaeldas
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants