Repository: nextdns/nextdns

Issue #651: NextDNS CLI not working on UDM
Created: 2022-02-02T03:57:02Z
I installed successfully the nextdns CLI on my UDM Base but it does not show me as connected when I go to nextdns. I have changed the DNS IP in my network settings as well and checked the status using nextdns status and it came back as running.

Duplicate issue #657: Fresh install on UDM fails to start
Created: 2022-02-16T20:59:47Z
Just tried installing NextDNS for the first time. Resulted in an error during the setup process, and looking at the logs it is unable to start.
Attempted rebooting the UDM and manually running nextdns start. Neither successful.

CLI Version: 1.37.7
Platform: Ubiquiti Dream Machine, up-to-date on updates



Results of the install process:

# sh -c 'sh -c "$(curl -sL https://nextdns.io/install)"'
INFO: OS: ubios
INFO: GOARCH: arm64
INFO: GOOS: linux
INFO: NEXTDNS_BIN: /data/nextdns
INFO: INSTALL_RELEASE: 1.37.7
i) Install NextDNS
e) Exit
Choice (default=i): i
INFO: Installing NextDNS...
Reading package lists...
Building dependency tree...
Reading state information...
curl is already the newest version (7.52.1-5+deb9u16).
The following additional packages will be installed:
  gnupg1-curl gnupg1-l10n
Suggested packages:
  parcimonie xloadimage | imagemagick | eog
The following NEW packages will be installed:
  gnupg1 gnupg1-curl gnupg1-l10n
0 upgraded, 3 newly installed, 0 to remove and 25 not upgraded.
Need to get 1128 kB of archives.
After this operation, 5035 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian stretch/main arm64 gnupg1 arm64 1.4.21-4+deb9u1 [539 kB]
Get:2 http://deb.debian.org/debian stretch/main arm64 gnupg1-curl arm64 1.4.21-4+deb9u1 [51.8 kB]
Get:3 http://deb.debian.org/debian stretch/main arm64 gnupg1-l10n all 1.4.21-4+deb9u1 [537 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 1128 kB in 0s (1425 kB/s)
Selecting previously unselected package gnupg1.
(Reading database ... 24196 files and directories currently installed.)
Preparing to unpack .../gnupg1_1.4.21-4+deb9u1_arm64.deb ...
Unpacking gnupg1 (1.4.21-4+deb9u1) ...
Selecting previously unselected package gnupg1-curl.
Preparing to unpack .../gnupg1-curl_1.4.21-4+deb9u1_arm64.deb ...
Adding 'diversion of /usr/lib/gnupg1/gpgkeys_curl to /usr/lib/gnupg1/gpgkeys_curl.non_curl by gnupg1-curl'
Adding 'diversion of /usr/lib/gnupg1/gpgkeys_hkp to /usr/lib/gnupg1/gpgkeys_hkp.non_curl by gnupg1-curl'
Unpacking gnupg1-curl (1.4.21-4+deb9u1) ...
Selecting previously unselected package gnupg1-l10n.
Preparing to unpack .../gnupg1-l10n_1.4.21-4+deb9u1_all.deb ...
Unpacking gnupg1-l10n (1.4.21-4+deb9u1) ...
#-> ubnt-dpkg-cache unpack
gnupg1: action=unpack, package=/data/dpkg-cache/stretch/packages/gnupg1_1.4.21-4+deb9u1_arm64.deb mark=manual
gnupg1-curl: action=unpack, package=/data/dpkg-cache/stretch/packages/gnupg1-curl_1.4.21-4+deb9u1_arm64.deb mark=auto
gnupg1-l10n: action=unpack, package=/data/dpkg-cache/stretch/packages/gnupg1-l10n_1.4.21-4+deb9u1_all.deb mark=auto
<-# ubnt-dpkg-cache unpack
Setting up gnupg1 (1.4.21-4+deb9u1) ...
Setting up gnupg1-l10n (1.4.21-4+deb9u1) ...
Setting up gnupg1-curl (1.4.21-4+deb9u1) ...
#-> ubnt-dpkg-cache configure
<-# ubnt-dpkg-cache configure
Get:1 https://repo.nextdns.io/deb stable InRelease [8490 B]
Get:2 https://repo.nextdns.io/deb stable/main arm64 Packages [425 B]
Fetched 8915 B in 0s (14.7 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
  nextdns
0 upgraded, 1 newly installed, 0 to remove and 25 not upgraded.
Need to get 2488 kB of archives.
After this operation, 6554 kB of additional disk space will be used.
Get:1 https://repo.nextdns.io/deb stable/main arm64 nextdns arm64 1.37.7 [2488 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 2488 kB in 0s (3230 kB/s)
Selecting previously unselected package nextdns.
(Reading database ... 24267 files and directories currently installed.)
Preparing to unpack .../nextdns_1.37.7_arm64.deb ...
Unpacking nextdns (1.37.7) ...
#-> ubnt-dpkg-cache unpack
nextdns: action=unpack, package=/data/dpkg-cache/stretch/packages/nextdns_1.37.7_arm64.deb mark=manual
<-# ubnt-dpkg-cache unpack
Setting up nextdns (1.37.7) ...
NextDNS installed and started using ubios init
Error: systemctl start nextdns.service: exit status 1: Job for nextdns.service failed because the control process exited with error code.
See "systemctl status nextdns.service" and "journalctl -xe" for details.

#-> ubnt-dpkg-cache configure
<-# ubnt-dpkg-cache configure
NextDNS Configuration ID: 7f1dc4
Sending your devices name lets you filter analytics and logs by device.
Report device name? [Y|n]: UDM
Report device name? [Y|n]: Y
Make nextdns CLI cache responses. This improves latency and reduces the amount
of queries sent to NextDNS.
Note that enabling this feature will disable dnsmasq for DNS to avoid double
caching.
Enable caching? (y/n): y
Instant refresh will force low TTL on responses sent to clients so they rely
on CLI DNS cache. This will allow changes on your NextDNS config to be applied
on you LAN hosts without having to wait for their cache to expire.
Enable instant refresh? (y/n): y
invalid boolean value "Invalid" for -report-client-info: parse error
Usage of  nextdns install:
  -auto-activate
    	Run activate at startup and deactivate on exit.
  -bogus-priv
    	Bogus private reverse lookups.

    	All reverse lookups for private IP ranges (ie 192.168.x.x, etc.) are
    	answered with "no such domain" rather than being forwarded upstream.
    	The set of prefixes affected is the list given in RFC6303, for IPv4
    	and IPv6. (default true)
  -cache-max-age duration
    	If set to greater than 0, a cached entry will be considered stale after
    	this duration, even if the record's TTL is higher.
  -cache-size string
    	Set the size of the cache in byte. Use 0 to disable caching. The value
    	can be expressed with unit like kB, MB, GB. The cache is automatically
    	flushed when the pointed configuration is updated. (default "0")
  -config value
    	NextDNS custom configuration id.

    	The configuration id can be prefixed with a condition that is match for
    	each query:
    	* 10.0.3.0/24=abcdef: A CIDR can be used to restrict a configuration to
    	  a subnet.
    	* 00:1c:42:2e:60:4a=abcdef: A MAC address can be used to restrict
    	  configuration to a specific host on the LAN.

    	This parameter can be repeated. The first match wins.
  -config-file string
    	Custom path to configuration file.
  -control string
    	Address to the control socket. (default "/var/run/nextdns.sock")
  -detect-captive-portals
    	Automatic detection of captive portals and fallback on system DNS to
    	allow the connection to establish.

    	Beware that enabling this feature can allow an attacker to force nextdns
    	to disable DoH and leak unencrypted DNS traffic.
  -discovery-dns string
    	The address of a DNS server to be used to discover client names.
    	If not defined, the address learned via DHCP will be used. This setting
    	is only active if report-client-info is set to true.
  -forwarder value
    	A DNS server to use for a specified domain.

    	Forwarders can be defined to send proxy DNS traffic to an alternative
    	DNS upstream resolver for specific domains. The format of this parameter
    	is [DOMAIN=]SERVER_ADDR[,SERVER_ADDR...].

    	A SERVER_ADDR can ben either an IP[:PORT] for DNS53 (unencrypted UDP,
    	TCP), or a HTTPS URL for a DNS over HTTPS server. For DoH, a bootstrap
    	IP can be specified as follow: https://dns.nextdns.io#45.90.28.0.
    	Several servers can be specified, separated by comas to implement
    	failover.
    	This parameter can be repeated. The first match wins.
  -hardened-privacy
    	Deprecated.
  -listen value
    	Listen address for UDP DNS proxy server.
  -log-queries
    	Log DNS queries.
  -max-inflight-requests uint
    	Maximum number of inflight requests handled by the proxy. No additional
    	requests will not be answered after this threshold is met. Increasing
    	this value can reduce latency in case of burst of requests but it can
    	also increase significantly memory usage. (default 256)
  -max-ttl duration
    	If set to greater than 0, defines the maximum TTL value that will be
    	handed out to clients. The specified maximum TTL will be given to
    	clients instead of the true TTL value if it is lower. The true TTL
    	value is however kept in the cache to evaluate cache entries
    	freshness. This is best used in conjunction with the cache to force
    	clients not to rely on their own cache in order to pick up
    	configuration changes faster.
  -mdns string
    	Enable mDNS to discover client information and serve mDNS learned names over DNS.
    	Use "all" to listen on all interface or an interface name to limit mDNS on a
    	specific network interface. Use "disabled" to disable mDNS altogether. (default "all")
  -report-client-info
    	Embed clients information with queries.
  -setup-router
    	Automatically configure NextDNS for a router setup.
    	Common types of router are detected to integrate gracefuly. Changes
    	applies are undone on daemon exit. The listen option is ignored when
    	this option is used.
  -timeout duration
    	Maximum duration allowed for a request before failing. (default 5s)
  -use-hosts
    	Lookup /etc/hosts before sending queries to upstream resolver. (default true)
Error: non zero exit code: 2: OCI runtime error



Log output:
# nextdns log
Feb 16 14:53:23 ubnt systemd[1]: Starting NextDNS DNS53 to DoH proxy....
Feb 16 14:53:23 ubnt nextdns[2502]: Starting NextDNS 1.37.7/linux on localhost:53
Feb 16 14:53:23 ubnt nextdns[2502]: Listening on TCP/127.0.0.1:53
Feb 16 14:53:23 ubnt nextdns[2502]: Listening on UDP/127.0.0.1:53
Feb 16 14:53:23 ubnt nextdns[2502]: Startup failed: proxy: tcp: listen tcp 127.0.0.1:53: bind: address already in use
Feb 16 14:53:23 ubnt nextdns[2502]: Error: proxy: tcp: listen tcp 127.0.0.1:53: bind: address already in use
Feb 16 14:53:23 ubnt ssh[2503]: Welcome to UbiOS
Feb 16 14:53:23 ubnt ssh[2503]: By logging in, accessing, or using the Ubiquiti product, you
Feb 16 14:53:23 ubnt ssh[2503]: acknowledge that you have read and understood the Ubiquiti
Feb 16 14:53:23 ubnt ssh[2503]: License Agreement and agree to be bound by its terms.
Feb 16 14:53:24 ubnt systemd[1]: nextdns.service: Main process exited, code=exited, status=1/FAILURE
Feb 16 14:53:24 ubnt systemd[1]: nextdns.service: Failed with result 'exit-code'.
Feb 16 14:53:24 ubnt systemd[1]: Failed to start NextDNS DNS53 to DoH proxy..
Feb 16 14:53:24 ubnt systemd[1]: nextdns.service: Consumed 61ms CPU time.

Closing comment (2022-02-16T21:12:04Z): Related to #651