2

Need full tutorial about using nextdns on Raspberry Pi.

If you don’t mind can you please make a full tutorial about using nextdns on Raspberry Pi? I’m new to this program. I bought the pro version of Nextdns but my DNS is not encrypted. I link the IP, I changed the DNS server on my router to Nextdns and link Dynamic DNS (DDNS) to have your linked IP updated automatically. But no luck.

10 replies

null
    • Henry
    • 3 yrs ago
    • Reported - view

    If you have a Raspberry Pi, install NextDNS CLI, update your DHCP to give the IP of your Raspberry Pi out to your clients as the DNS server.

    When you install NextDNS CLI, it makes it a DNS over HTTPS (DoH) proxy. This will send encrypted DNS requests to NextDNS and as a bonus, you will get per device logs.

      • jade_light
      • 3 yrs ago
      • Reported - view

      Henry , Thank you for your response. I use Asus-ZenWiFi AX Mini as Mesh WiFi. If I used PI as DHCP server Mesh will not work and and I install nextdns and tried to run the nextdns. I'm getting error messages as (Not sure how to Fix this error messages)

      ram@raspberrypi:~ $ nextdns log
      Jan 13 00:19:39 raspberrypi systemd[1]: Started NextDNS DNS53 to DoH proxy..
      Jan 13 00:19:39 raspberrypi nextdns[2765]: Starting NextDNS 1.9.6/linux on local                                                                                                                                                             host:53
      Jan 13 00:19:39 raspberrypi nextdns[2765]: Listening on TCP/[::1]:53
      Jan 13 00:19:39 raspberrypi nextdns[2765]: Listening on TCP/127.0.0.1:53
      Jan 13 00:19:39 raspberrypi nextdns[2765]: Listening on UDP/127.0.0.1:53
      Jan 13 00:19:39 raspberrypi nextdns[2765]: Listening on UDP/[::1]:53
      Jan 13 00:19:39 raspberrypi nextdns[2765]: Startup failed: proxy: tcp: listen tc                                                                                                                                                             p [::1]:53: bind: address already in use
      Jan 13 00:19:39 raspberrypi nextdns[2765]: Error: proxy: tcp: listen tcp [::1]:5                                                                                                                                                             3: bind: address already in use
      Jan 13 00:19:39 raspberrypi systemd[1]: nextdns.service: Main process exited, co                                                                                                                                                             de=exited, status=1/FAILURE
      Jan 13 00:19:39 raspberrypi systemd[1]: nextdns.service: Failed with result 'exi                                                                                                                                                             t-code'.
      Jan 13 00:21:37 raspberrypi systemd[1]: Started NextDNS DNS53 to DoH proxy..
      Jan 13 00:21:37 raspberrypi nextdns[2908]: Starting NextDNS 1.9.6/linux on :53
      Jan 13 00:21:37 raspberrypi nextdns[2908]: Listening on TCP/:53
      Jan 13 00:21:37 raspberrypi nextdns[2908]: Starting mDNS discovery
      Jan 13 00:21:37 raspberrypi nextdns[2908]: Listening on UDP/:53
      Jan 13 00:21:37 raspberrypi nextdns[2908]: Startup failed: proxy: tcp: listen tc                                                                                                                                                             p :53: bind: address already in use
      Jan 13 00:21:37 raspberrypi nextdns[2908]: Error: proxy: tcp: listen tcp :53: bi                                                                                                                                                             nd: address already in use
      Jan 13 00:21:37 raspberrypi systemd[1]: nextdns.service: Main process exited, co                                                                                                                                                             de=exited, status=1/FAILURE
      Jan 13 00:21:37 raspberrypi systemd[1]: nextdns.service: Failed with result 'exi                                                                                                                                                             t-code'.
      Jan 13 00:22:05 raspberrypi systemd[1]: Started NextDNS DNS53 to DoH proxy..
      Jan 13 00:22:05 raspberrypi nextdns[2941]: Starting NextDNS 1.9.6/linux on :53
      Jan 13 00:22:05 raspberrypi nextdns[2941]: Listening on TCP/:53
      Jan 13 00:22:05 raspberrypi nextdns[2941]: Starting mDNS discovery
      Jan 13 00:22:05 raspberrypi nextdns[2941]: Listening on UDP/:53
      Jan 13 00:22:05 raspberrypi nextdns[2941]: Startup failed: proxy: tcp: listen tc                                                                                                                                                             p :53: bind: address already in use
      Jan 13 00:22:05 raspberrypi nextdns[2941]: Error: proxy: tcp: listen tcp :53: bi                                                                                                                                                             nd: address already in use
      Jan 13 00:22:05 raspberrypi systemd[1]: nextdns.service: Main process exited, co                                                                                                                                                             de=exited, status=1/FAILURE
      Jan 13 00:22:05 raspberrypi systemd[1]: nextdns.service: Failed with result 'exi                                                                                                                                                             t-code'.
      Jan 13 00:24:19 raspberrypi systemd[1]: Started NextDNS DNS53 to DoH proxy..
      Jan 13 00:24:19 raspberrypi nextdns[3128]: Starting NextDNS 1.9.6/linux on :53
      Jan 13 00:24:19 raspberrypi nextdns[3128]: Starting mDNS discovery
      Jan 13 00:24:19 raspberrypi nextdns[3128]: Listening on TCP/:53
      Jan 13 00:24:19 raspberrypi nextdns[3128]: Listening on UDP/:53
      Jan 13 00:24:19 raspberrypi nextdns[3128]: Startup failed: proxy: tcp: listen tc                                                                                                                                                             p :53: bind: address already in use
      Jan 13 00:24:19 raspberrypi nextdns[3128]: Error: proxy: tcp: listen tcp :53: bi                                                                                                                                                             nd: address already in use
      Jan 13 00:24:19 raspberrypi systemd[1]: nextdns.service: Main process exited, co                                                                                                                                                             de=exited, status=1/FAILURE
      Jan 13 00:24:19 raspberrypi systemd[1]: nextdns.service: Failed with result 'exi                                                                                                                                                             t-code'.
      Jan 13 00:37:09 raspberrypi systemd[1]: Started NextDNS DNS53 to DoH proxy..
      Jan 13 00:37:09 raspberrypi nextdns[3413]: Starting NextDNS 1.9.6/linux on :53
      Jan 13 00:37:09 raspberrypi nextdns[3413]: Listening on TCP/:53
      Jan 13 00:37:09 raspberrypi nextdns[3413]: Listening on UDP/:53
      Jan 13 00:37:09 raspberrypi nextdns[3413]: Startup failed: proxy: tcp: listen tc                                                                                                                                                             p :53: bind: address already in use
      Jan 13 00:37:09 raspberrypi nextdns[3413]: Error: proxy: tcp: listen tcp :53: bi                                                                                                                                                             nd: address already in use
      Jan 13 00:37:09 raspberrypi systemd[1]: nextdns.service: Main process exited, co                                                                                                                                                             de=exited, status=1/FAILURE
      Jan 13 00:37:09 raspberrypi systemd[1]: nextdns.service: Failed with result 'exi                                                                                                                                                             t-code'.
      Jan 13 00:37:16 raspberrypi systemd[1]: Started NextDNS DNS53 to DoH proxy..
      Jan 13 00:37:16 raspberrypi nextdns[3434]: Starting NextDNS 1.9.6/linux on :53
      Jan 13 00:37:16 raspberrypi nextdns[3434]: Starting mDNS discovery
      Jan 13 00:37:16 raspberrypi nextdns[3434]: Listening on TCP/:53
      Jan 13 00:37:16 raspberrypi nextdns[3434]: Listening on UDP/:53
      Jan 13 00:37:16 raspberrypi nextdns[3434]: Startup failed: proxy: tcp: listen tc                                                                                                                                                             p :53: bind: address already in use
      Jan 13 00:37:16 raspberrypi nextdns[3434]: Error: proxy: tcp: listen tcp :53: bi                                                                                                                                                             nd: address already in use
      Jan 13 00:37:16 raspberrypi systemd[1]: nextdns.service: Main process exited, co                                                                                                                                                             de=exited, status=1/FAILURE
      Jan 13 00:37:16 raspberrypi systemd[1]: nextdns.service: Failed with result 'exi                                                                                                                                                             t-code'.
      Jan 13 01:05:27 raspberrypi systemd[1]: Started NextDNS DNS53 to DoH proxy..
      Jan 13 01:05:27 raspberrypi nextdns[4206]: Starting NextDNS 1.9.6/linux on :53
      Jan 13 01:05:27 raspberrypi nextdns[4206]: Listening on TCP/:53
      Jan 13 01:05:27 raspberrypi nextdns[4206]: Starting mDNS discovery
      Jan 13 01:05:27 raspberrypi nextdns[4206]: Listening on UDP/:53
      Jan 13 01:05:27 raspberrypi nextdns[4206]: Startup failed: proxy: tcp: listen tc                                                                                                                                                             p :53: bind: address already in use
      Jan 13 01:05:27 raspberrypi nextdns[4206]: Error: proxy: tcp: listen tcp :53: bi                                                                                                                                                             nd: address already in use
      Jan 13 01:05:27 raspberrypi systemd[1]: nextdns.service: Main process exited, co                                                                                                                                                             de=exited, status=1/FAILURE
      Jan 13 01:05:27 raspberrypi systemd[1]: nextdns.service: Failed with result 'exi                                                                                                                                                             t-code'.
      Jan 13 01:05:34 raspberrypi systemd[1]: Started NextDNS DNS53 to DoH proxy..
      Jan 13 01:05:34 raspberrypi nextdns[4224]: Starting NextDNS 1.9.6/linux on :53
      Jan 13 01:05:34 raspberrypi nextdns[4224]: Listening on TCP/:53
      Jan 13 01:05:34 raspberrypi nextdns[4224]: Starting mDNS discovery
      Jan 13 01:05:34 raspberrypi nextdns[4224]: Listening on UDP/:53
      Jan 13 01:05:34 raspberrypi nextdns[4224]: Startup failed: proxy: tcp: listen tc                                                                                                                                                             p :53: bind: address already in use
      Jan 13 01:05:34 raspberrypi nextdns[4224]: Error: proxy: tcp: listen tcp :53: bi                                                                                                                                                             nd: address already in use
      Jan 13 01:05:34 raspberrypi systemd[1]: nextdns.service: Main process exited, co                                                                                                                                                             de=exited, status=1/FAILURE
      Jan 13 01:05:34 raspberrypi systemd[1]: nextdns.service: Failed with result 'exi                                                                                                                                                             t-code'.
       

      • olivier
      • 3 yrs ago
      • Reported - view

      RK please try systemctl disable systemd-resolved

      • Henry
      • 3 yrs ago
      • Reported - view

      RK Do you have another DNS server running on the Pi, like Pi-Hole? Sounds like it cannot start on port 53 because something else might be using it already? If not, can reinstall the OS and do it fresh. I've done that a few times, only takes about 15 minutes.

      For the mesh system, when you assign a custom DNS, is it giving that specified IP out to each client or is it giving the IP of the primary mesh AP out as DNS (and then the primary AP sends DNS requests to NextDNS)? I have seen on forums for Google Mesh DHCP to give limit the scope to one address and then the other DHCP server (Pi) would hand out the rest. If it hands out the DNS that you specify (Raspberry Pi), that would be easiest to just let Asus handle DHCP and just make the Pi a DNS server. 

      • jade_light
      • 3 yrs ago
      • Reported - view

      Henry  Yes, I used Pi-hole and try to use next dns ont it. That is why I'm getting errors.  I don't know that I can run nextdns in Raspbian itself. It was kind of new learning to assign new IP and install Raspbian in USB and run. Can you please verify,  if I post the log files Am I running correctly or not? Thank you in advance.

      nextdns log
      Jan 13 18:21:30 raspberrypi systemd[1]: Started NextDNS DNS53 to DoH proxy..
      Jan 13 18:21:30 raspberrypi nextdns[1185]: Starting NextDNS 1.9.6/linux on localhost:53
      Jan 13 18:21:30 raspberrypi nextdns[1185]: Listening on TCP/[::1]:53
      Jan 13 18:21:30 raspberrypi nextdns[1185]: Listening on TCP/127.0.0.1:53
      Jan 13 18:21:30 raspberrypi nextdns[1185]: Listening on UDP/[::1]:53
      Jan 13 18:21:30 raspberrypi nextdns[1185]: Listening on UDP/127.0.0.1:53
      Jan 13 18:21:57 raspberrypi nextdns[1185]: Received signal: terminated
      Jan 13 18:21:57 raspberrypi nextdns[1185]: Stopping NextDNS 1.9.6/linux
      Jan 13 18:21:57 raspberrypi nextdns[1185]: NextDNS 1.9.6/linux stopped
      Jan 13 18:21:57 raspberrypi systemd[1]: Stopping NextDNS DNS53 to DoH proxy....
      Jan 13 18:21:57 raspberrypi systemd[1]: nextdns.service: Succeeded.
      Jan 13 18:21:57 raspberrypi systemd[1]: Stopped NextDNS DNS53 to DoH proxy..
      Jan 13 18:21:58 raspberrypi systemd[1]: Started NextDNS DNS53 to DoH proxy..
      Jan 13 18:21:58 raspberrypi nextdns[1300]: Starting NextDNS 1.9.6/linux on :53
      Jan 13 18:21:58 raspberrypi nextdns[1300]: Starting mDNS discovery
      Jan 13 18:21:58 raspberrypi nextdns[1300]: Listening on TCP/:53
      Jan 13 18:21:58 raspberrypi nextdns[1300]: Listening on UDP/:53
      Jan 13 18:22:03 raspberrypi nextdns[1300]: Setting up router
      Jan 13 18:22:03 raspberrypi nextdns[1300]: Activating
      Jan 13 18:22:16 raspberrypi dhcpcd[1320]: dhcp6_dump: eth0: No such file or directory
      Jan 13 18:22:16 raspberrypi nextdns[1300]: Connected 45.90.28.0:443 (con=24ms tls=87ms, TLS13)
      Jan 13 18:22:16 raspberrypi nextdns[1300]: Connected 45.76.16.236:443 (con=22ms tls=37ms, TLS13)
      Jan 13 18:22:16 raspberrypi nextdns[1300]: Switching endpoint: https://vultr-chi-1.edge.nextdns.io#45.76.16.236,2001:19f0:5c01:1ebc:5400:2ff:fece:28ed
      Jan 13 18:30:45 raspberrypi nextdns[1300]: Query 192.168.22.2 UDP A prod.amcs-tachyon.com. (qry=39/res=12) 1ms : doh resolve: write tcp 192.168.22.3:57284->45.76.16.236:443: write: connection reset by peer
      Jan 13 18:30:45 raspberrypi nextdns[1300]: Query 192.168.22.247 UDP A ap.spotify.com. (qry=32/res=12) 321ms : doh resolve: unexpected EOF
      Jan 13 18:30:45 raspberrypi nextdns[1300]: Query 192.168.22.35 UDP A fireoscaptiveportal.com. (qry=41/res=12) 476ms : doh resolve: unexpected EOF
      Jan 13 18:30:45 raspberrypi nextdns[1300]: Query 192.168.22.247 UDP A dns.nextdns.io. (qry=32/res=12) cached HTTP/2.0: doh resolve: unexpected EOF
      Jan 13 18:30:45 raspberrypi nextdns[1300]: Query 192.168.22.35 UDP AAAA ap.spotify.com. (qry=32/res=12) 477ms : doh resolve: unexpected EOF
      Jan 13 18:30:45 raspberrypi nextdns[1300]: Query 192.168.22.35 UDP AAAA avs-alexa-3-na.amazon.com. (qry=43/res=12) cached HTTP/2.0: doh resolve: unexpected EOF
      Jan 13 18:30:45 raspberrypi nextdns[1300]: Query 192.168.22.35 UDP A d3p8zr0ffa9t17.cloudfront.net. (qry=47/res=12) cached HTTP/2.0: doh resolve: unexpected EOF
      Jan 13 18:30:45 raspberrypi nextdns[1300]: Query 192.168.22.189 TCP A connectivity-check.ubuntu.com. (qry=47/res=12) 569ms : doh resolve: unexpected EOF
      Jan 13 18:30:45 raspberrypi nextdns[1300]: Query 192.168.22.35 UDP A dp-gw-na.amazon.com. (qry=37/res=12) 477ms : doh resolve: unexpected EOF
      Jan 13 18:30:45 raspberrypi nextdns[1300]: Query 192.168.22.35 UDP A prod.amcs-tachyon.com. (qry=39/res=12) 478ms : doh resolve: unexpected EOF
      Jan 13 18:30:45 raspberrypi nextdns[1300]: Query 192.168.22.35 UDP A dcape-na.amazon.com. (qry=37/res=12) cached HTTP/2.0: doh resolve: unexpected EOF
      Jan 13 18:30:45 raspberrypi nextdns[1300]: Received signal: broken pipe (ignored)

      • Henry
      • 3 yrs ago
      • Reported - view

      RK Yes, you can run NextDNS CLI on Raspbian (I am doing the same). I used to have Pi-Hole as well. NextDNS is a replacement for Pi-Hole. It is essentially the same (unless you have custom blocklists), but with cloud management. I generally recommend the NextDNS blocklist and OISD blocklists.

      You can't run both at the same time as they are services trying to run on the same port (port 53). Uninstall Pi-Hole, uninstall NextDNS CLI, reinstall NextDNS CLI (in the config, setup as a router). Then update the DNS in your Asus setup to point to your Pi. Should be good at that point. If your Asus gives the DNS server to each client, you will get per device logs. If it gives your Asus system as DNS and then it sends DNS to NextDNS, you will not get per device logs, but everything should be encrypted to NextDNS.

      pihole uninstall
      #If it doesn't work, try sudo pihole uninstall.
      
      nextdns uninstall
      #If it doesn't work, try sudo nextdns uninstall.
      
      sh -c "$(curl -sL https://nextdns.io/install)"

      https://github.com/nextdns/nextdns/wiki/Debian-Based-Distribution

      • M_van_Amelsvoort
      • 3 yrs ago
      • Reported - view

      Henry I have a question about the Raspberry Pi to hand out the IP adresses as a DHCP server.
      In my privat situation all my devices have Bind IP adresses.... so iff i have to make the Raspberry as DHCP i will lose the Bind to IP function.

      Is there no other solution to this.

    • Teslapod
    • 3 yrs ago
    • Reported - view

    I would also like a step by step guide for installing the NextDNS CLI on a raspberry Pi.  Explain it like I'm 5 years old.  I have a new Pi coming with a Noobs micro sd card...  so I'm just beginning.  Step-by step, what do I have to do  to get this new Pi running with the NextDNS CLI and to restart automatically ion the Pi is ever rebooted.  THANK YOU!

    • summerbugs
    • 3 yrs ago
    • Reported - view

    I added some delay in nextdns.service, otherwise NextDNS CLI doesn't work correctly on  my Raspberry Pi 4.

    sudo nano /etc/systemd/system/nextdns.service
    ...
    Environment=SERVICE_RUN_MODE=1
    ExecStartPre=/bin/sleep 20        #add some delay here
    ExecStart=/usr/bin/nextdns run
    ...

    And modified dhcpcd.conf to pointing to NextDNS server as backup in case the CLI has failed.

    sudo nano /etc/dhcpcd.conf
    ...
    static domain_name_servers=<your_nextdns_ip>
    ...

    Works like a charm after these changes.

Content aside

  • 2 Likes
  • 3 yrs agoLast active
  • 10Replies
  • 4253Views
  • 8 Following