nextdns icon indicating copy to clipboard operation
nextdns copied to clipboard

Synology router (SRM) cannot find nextdns.sh

Open csousougen opened this issue 6 years ago • 41 comments

Installation and configuration is succesfull, but afterwards I get the error:

SynologyRouter> nextdns status
Error: /usr/local/etc/rc.d/nextdns.sh status: exit status 1:

Also, I noticed that nextdns.sh is not located in usr/local/etc/rc.d Thus, commands like start and stop do not work.

csousougen avatar Apr 29 '20 17:04 csousougen

SynologyRouter> DEBUG=1 sh -c "$(curl -sL https://nextdns.io/install)" INFO: OS: synology INFO: GOARCH: armv7 INFO: GOOS: linux DEBUG: Start install loop with CURRENT_RELEASE= DEBUG: NextDNS is not installed i) Install NextDNS e) Exit Choice (default=i): e SynologyRouter> DEBUG=1 sh -c "$(curl -sL https://nextdns.io/install)" INFO: OS: synology INFO: GOARCH: armv7 INFO: GOOS: linux DEBUG: Start install loop with CURRENT_RELEASE= DEBUG: NextDNS is not installed i) Install NextDNS e) Exit Choice (default=i): i INFO: Installing NextDNS... DEBUG: Using bin install type DEBUG: Installing 1.5.4 binary for linux/armv7 to /usr/local/bin/nextdns DEBUG: Downloading https://github.com/nextdns/nextdns/releases/download/v1.5.4/nextdns_1.5.4_linux_armv7.tar.gz DEBUG: Start configure DEBUG: Get configuration ID DEBUG: Previous config ID: xxxx NextDNS Configuration ID (default=xxxx): DEBUG: Add arg -config=xxxx Sending your devices name lets you filter analytics and logs by device. Report device name? [Y|n]: y DEBUG: Add arg -report-client-info=true Only use DNS servers located in jurisdictions with strong privacy laws. This may increase latency. Enable hardened privacy mode (may increase latency)? [Y|n]: y DEBUG: Add arg -hardened-privacy=true DEBUG: Add arg -setup-router=true Changes DNS settings of the host automatically when nextdns is started. If you say no here, you will have to manually configure DNS to 127.0.0.1. Automatically configure host DNS on daemon startup? [Y|n]: n DEBUG: Add arg -auto-activate=false NextDNS installed and started using synology init Error: /usr/local/etc/rc.d/nextdns.sh start: exit status 1: ERROR: install: exit 0 DEBUG: Start install loop with CURRENT_RELEASE=1.5.4 DEBUG: NextDNS is up to date (1.5.4) c) Configure NextDNS r) Remove NextDNS e) Exit Choice (default=c):

csousougen avatar Apr 29 '20 19:04 csousougen

What do you get for ls -ld /usr/local/etc/rc.d/?

rs avatar May 04 '20 05:05 rs

What do you get for ls -ld /usr/local/etc/rc.d/?

SynologyRouter> ls -ld /usr/local/etc/rc.d/ drwxr-xr-x 2 root root 4096 Apr 29 22:37 /usr/local/etc/rc.d/

csousougen avatar May 04 '20 05:05 csousougen

Got the same issue:

NextDNS installed and started using synology init
Error: /usr/local/etc/rc.d/nextdns.sh start: exit status 1:
ERROR: install: exit 0

After trying run script got more informative message:

> /usr/local/etc/rc.d/nextdns.sh start
Starting nextdns
Unable to start
Error: proxy: tcp: listen tcp 127.0.0.1:5342: bind: address already in use

Axam avatar May 12 '20 07:05 Axam

Same here.

I have a Synology router and a Synology NAS, so I tested on both.

Works fine on the NAS, but same issue with router.

The problem with the NAS is that you cannot get the per-device logs and analytics online. It shows all queries coming from the router (DNS set with NextDNS on the NAS). This is why I'd like to install on the router itself.

Thank you!

sqwal avatar May 21 '20 14:05 sqwal

Same here.

I have a Synology router and a Synology NAS, so I tested on both.

Works fine on the NAS, but same issue with router.

The problem with the NAS is that you cannot get the per-device logs and analytics online. It shows all queries coming from the router (DNS set with NextDNS on the NAS). This is why I'd like to install on the router itself.

Thank you!

Hey, try the following:

  1. use the NAS as your dns server on each device, instead of the router
  2. put the devices on /etc/hosts file on NAS

then the devices will appear on analytics.

csousougen avatar May 21 '20 14:05 csousougen

Yes, that should work, indeed. I'll try and let you know.

But the whole point was to avoid having to set up the DNS server on each device, hence the one-time router setting ;-) I'm currently switching back and forth between 1.1.1.1 and unlocator DNS (185.37.37.37), depending on my needs, directly on the router, that is so convenient!

sqwal avatar May 21 '20 14:05 sqwal

What do you get for sudo /usr/local/etc/rc.d/nextdns.sh restart

rs avatar May 21 '20 20:05 rs

What do you get for sudo /usr/local/etc/rc.d/nextdns.sh restart

SynologyRouter> sudo /usr/local/etc/rc.d/nextdns.sh restart -ash: sudo: not found

I can only ssh as root on the router (ssh [email protected]), even if admin user is deactivated. Not the same behaviour as the NAS (ssh with user account, then sudo -i)

sqwal avatar May 22 '20 13:05 sqwal

Please remove sudo

rs avatar May 22 '20 16:05 rs

> SynologyRouter> /usr/local/etc/rc.d/nextdns.sh restart
Not running
Starting nextdns
Unable to start
SynologyRouter> Error: proxy: udp: listen udp 127.0.0.1:5342: bind: address already in use
SynologyRouter> 

sqwal avatar May 23 '20 12:05 sqwal

And ps w | grep nextdns

rs avatar May 23 '20 16:05 rs

SynologyRouter> ps w | grep nextdns
 6116 root      783m S    /usr/local/bin/nextdns run
12462 root      3892 S    grep nextdns
SynologyRouter> 

sqwal avatar May 23 '20 16:05 sqwal

I'm wondering whereas it could come from the SafeAccess app, which is basically a parental control layer. Usually these kind of application use a self DNS server, don't they?

I'd have to try to deactivate it, if that's something you think might help to resolve the issue...

sqwal avatar May 23 '20 16:05 sqwal

Here the problem seem to be the init script not finding the previous process running on restart. The pid is either missing or not containing the right pid.

rs avatar May 23 '20 16:05 rs

PID is correct.

ps | grep nextdns 15014 root 782m S /usr/local/bin/nextdns run 15519 root 3892 S grep nextdns

cat /var/run/nextdns.pid 15014

Failed to start process after install.

Axam avatar Jun 03 '20 04:06 Axam

Looks like real issue is dnsmasq running on port 53. Synology SRM use dnsmasq for DoH and even if you disable DoH dnsmasq still binding to port 53. NextDNS installer changes dhcp-vendor.conf, but that change doesn't work for SRM.

Axam avatar Jun 07 '20 14:06 Axam

I don’t have a SRM. Any idea what would work?

rs avatar Jun 07 '20 14:06 rs

Don't know good way to disable just DNS. Disabling dnsmasq will turn off DHCP server as well. Also dhcpd.conf is managed by SRM, so changes will be overwritten.

Just as idea. Is it possible to tell NextDNS to don't bring up it's own DNS server? I can configure Synology SRM to use NextDNS as upstream server via DNS over HTTP. In that case discovery part of NextDNS client should work and user will need one manual step to configure DNS.

Axam avatar Jun 08 '20 08:06 Axam

Set the dnsmasq port to 0, it will disable dns and keep dhcp.

rs avatar Jun 08 '20 08:06 rs