steventblack / ad-blocker

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

reloading configuration failed: file not found #14

Open webgiftdev opened 2 years ago

webgiftdev commented 2 years ago

Hello, i followed the instructions and try to set NAS DNS Server as Ad-blocker however i receive the following error from logs tab.

Screenshot 2022-01-13 at 09 35 06

Thank you

BruTTus commented 2 years ago

I configured my laptop's DNS and seems not working, on my logs I'm seeing something similar. image

csimlinger commented 2 years ago

Same issue for my. Any ideas?

BruTTus commented 2 years ago

Same issue for my. Any ideas?

You have to enable the forward request to a public DNS like 8.8.8.8 to enable it. That was my problem at least, let me know if was yours too.

dipiana commented 2 years ago

Thanks for the answer but unfortunately I can not make it work.

The first error I encounter after sudo ./ad-blocker.sh the script is:

rndc: 'reload' failed: file not found

Then I see multiple errors like here:

image

Any ideas how to solve that? Can't find any solution online.

Thanks!

robotictacos commented 2 years ago

Down in line 189 he's left off an argument the reload script needs to work. You need to change this:

"${RootDir}"/script/reload.sh

To this:

"${RootDir}"/script/reload.sh null.zone.file

Save it and re-run it.

robotictacos commented 2 years ago

Ah, well, that only fixes one issue, this script is riddled with problems. I fixed some, will have to come back to it though.

raphaeldas commented 2 years ago

Check out the pull request https://github.com/steventblack/ad-blocker/pull/16. there are some changes to the shell script i had to apply to make it work for me.

Aladiah2 commented 1 month ago

Hello, in DSM 7.2 the reload script is not exist. I comment the line out and do a reload with the help of the /etc/crontab 2 minutes later: systemctl reload pkg-DNSServer

Aladiah2 commented 1 month ago

Also the path of the zone files changed! After this changes in the script the service is working again (quick hack):

include "/etc/zone/data/ad-blocker.db"; --> include "/var/packages/DNSServer/target/named/etc/zone/data/ad-blocker.db";

wget -O- "$BlocklistURL" | \ sed -e 's/null.zone.file/\/etc\/zone\/master\/null.zone.file/g' > "/tmp/ad-blocker.new" --> wget -O- "$BlocklistURL" | \ sed -e 's/null.zone.file/null.zone.file/g' > "/tmp/ad-blocker.new"

The first fix should better use the var $ZoneMasterDir. The second fix don't need the absolute path and the sed command could be removed.