0

Linux nextdns version 1.46.0-SNAPSHOT-6e53a79 Not Handling IP Address Change

I am facing an issue where DNS look-ups fail after time with the NextDNS Linux service installed and running. The issue has been reproducible on a Debian Trixie install for days. I am now not reproducing this issue only after adding my changed IP address assigned by my ISP to my.nextdns.io under Linked IP. This IP address will change in the future. When it changes, the Linux tool will break again.

It is clearly stated that when using your own tools, linking IP addresses is not required.  It looks like this feature is broken under Linux.  Windows 11 has no issues with NextDNS tool installed.  All DNS look-ups worked.  Only the Linux tool faced this issue.

10 replies

null
    • dryst
    • 3 wk ago
    • Reported - view

    After some time, this is the error I get using nslookup:

    This looks like a bug with the Linux version

      • dryst
      • 3 wk ago
      • Reported - view

      Updating Linked IP address makes no difference.  This is running under VMWare Professional.  Why is the 127.0.0.53#53 server that is local not responding?  This is the cause of the issue.

    • dryst
    • 3 wk ago
    • Reported - view

    A couple of notes here:

    1.  I installed an upgrade to this version, and now version 1.4.6.0 is installed.  The same issue happens with this upgrade.

    2. Adding my changed address under Linked IP makes no difference and does not help.  This issue still happens, and it looks like your bug:

    • R_P_M
    • 3 wk ago
    • Reported - view

    This has nothing to do with the NextDNS CLI. Linking IP is not required with the CLI if correctly configured.

    I suspect this error is to do with the systemd-resolved service overriding and not allowing the CLI from running.

    Please check that the NextDNS CLI is actually running by entering this command:

    systemctl status nextdns
      • dryst
      • 2 wk ago
      • Reported - view

      I disabled my cron job that fixes this issue, waited for it to happen again, and executed the requested commands.  Below is a screenshot:

      • R_P_M
      • 2 wk ago
      • Reported - view

        What was your cron job doing? I don’t see you mention it anywhere here.

      From your nslookups your system is using 127.0.0.53 this is not the NextDNS CLI default listening address (this address is used by the systemd-resolved program).

      Please share your NextDNS config file here (obscuring your profile ID of course - don’t want that getting out). I can have a look through it see if anything is not right with it. 
      You can list it with:

      nextdns config
      
      • dryst
      • 2 wk ago
      • Reported - view

      cron is schedule to execute a script every 15 minutes.  It runs as root and logs all activity when nslookup fails:

      #!/bin/bash
      # DNS Monitor Script
      # Checks if DNS resolution is working and restarts systemd-resolved if needed
      # Author: DNS Troubleshooting Script
      # Date: $(date +%Y-%m-%d)
      # Configuration
      DNS_TEST_HOST="www.google.com"
      LOG_FILE="/var/log/dns-monitor.log"
      SERVICE_NAME="systemd-resolved.service"
      # Function to log messages with timestamp
      log_message() {
          echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" >> "$LOG_FILE"
      }
      # Function to test DNS resolution
      test_dns() {
          nslookup "$DNS_TEST_HOST" >/dev/null 2>&1
          return $?
      }
      # Main script execution
      main() {
          # Test DNS resolution
          if test_dns; then
              # DNS is working - log success (optional, comment out if you don't want success logs)
              # log_message "DNS resolution test passed for $DNS_TEST_HOST"
              exit 0
          else
              # DNS failed - log the failure and restart service
              log_message "DNS resolution failed for $DNS_TEST_HOST - restarting $SERVICE_NAME"
      
              # Restart systemd-resolved service
              systemctl restart "$SERVICE_NAME"
              restart_result=$?
      
              if [ $restart_result -eq 0 ]; then
                  log_message "Successfully restarted $SERVICE_NAME"
      
                  # Wait a moment and test again
                  sleep 5
                  if test_dns; then
                      log_message "DNS resolution restored after service restart"
                  else
                      log_message "WARNING: DNS still not working after service restart"
                  fi
              else
                  log_message "ERROR: Failed to restart $SERVICE_NAME (exit code: $restart_result)"
              fi
      
              exit 1
          fi
      }
      # Create log file if it doesn't exist
      touch "$LOG_FILE"
      # Run main function
      main
      
      • dryst
      • yesterday
      • Reported - view

       Below is the requested info:

      root@debian-vm:/home/jamil# nextdns config
      discovery-dns
      detect-captive-portals false
      cache-size 0
      hardened-privacy false
      use-hosts true
      max-inflight-requests 256
      max-ttl 0s
      mdns all
      setup-router false
      auto-activate false
      listen localhost:53
      control /var/run/nextdns.sock
      log-queries false
      cache-max-age 0s
      report-client-info false
      debug false
      bogus-priv true
      timeout 5s
      
      • R_P_M
      • yesterday
      • Reported - view

       Ah, I see the problem. "auto-activate" should be set to "true" if you want it to set the system up to use the CLI. With it off you would have to activate NextDNS CLI manually every time you restart.

      Run this command to set it to true:

      nextdns config set -auto-activate

      Then simply restart the CLI:

      nextdns restart
      • dryst
      • 14 hrs ago
      • Reported - view

       This is all completed, and Debian has been rebooted.  The cronjob remains scheduled to run, so I will know if this change resolves the issue by allowing the system to remain operational by tomorrow.

Content aside

  • 14 hrs agoLast active
  • 10Replies
  • 98Views
  • 2 Following