/var/run/nextdns.sock: connect: no such file or directory
Hello,
I'm running NextDNS CLI version 1.37.3 on pfSense 2.5.2-RELEASE (amd64) successfully. Everything seems to be working well. However, when executing the following, an error is thrown:
[2.5.2-RELEASE][someuser@XXX.XXX]/root: sh -c "nextdns cache-keys"
Error: dial unix /var/run/nextdns.sock: connect: no such file or directory
[2.5.2-RELEASE][someuser@XXX.XXX]/root: sh -c "nextdns cache-stats"
Error: dial unix /var/run/nextdns.sock: connect: no such file or directoryMy config is:
[2.5.2-RELEASE][someuser@XXX.XXX]/root: sh -c "nextdns config"
auto-activate true
bogus-priv true
cache-max-age 0s
cache-size 50MB
config XXXXXX
control /var/run/nextdns.sock
detect-captive-portals false
discovery-dns
hardened-privacy false
listen 192.168.1.254:53
listen localhost:53
log-queries false
max-inflight-requests 256
max-ttl 5s
report-client-info true
setup-router false
timeout 5s
use-hosts trueI'd like to be able to inspect the cache-keys and cache-stats. How should I do that please?
9 replies
- 
  Hi, I'm experiencing the same behaviour. Did you solve it? Thanks 
- 
  Same issue here on pfsense 22.05 
- 
  I found a way to work around this bug. I changed my config to have the file created in /tmp control /tmp/nextdns.sockAfter restarting nextdns i can see the nextdns.sock file is created correctly in /tmp directory. However, running nextdns cache-stats still results in the same error about the file missing from /var/run/nextdns.sock so it appears that this path is hardcoded in the cli. So i created a softlink to /var/run/netxtnds.sock by running the following command from pfsense shell cd /var/run ln -s /tmp/nextdns.sock nextdns.sockNow when running nextdns cache-status it works correctly. I'm not sure if this will survive a reboot but will try and report back. 
- 
  This fix does not survive a reboot so i installed the shellcmd pfsense package and added an entry for ln -s /tmp/nextdns.sock /var/run/nextdns.sockNow after pfsense reboots its working as expected 
- 
  Facing the same issue. Quite sad to see that no one from nextdns has bothered to even pick this up. As a paying customer, this reduces my confidence and desire to renew. 
- 
  Created a php script to start nextDNS upon reboot and send out appropriate alerts. Leaving this here in case it helps anyone. Note: This will only work on pfSense. #!/usr/bin/env php <?php require_once("/etc/inc/notices.inc"); # get the current nextDNS status exec('nextdns status',$nextdnsStatus, $status); if ($nextdnsStatus[0] == "running") { # send alert that nextDNS is ok notify_via_telegram("nextDNS running ok after reboot."); } else { # send alert that nextDNS is not ok notify_via_telegram("nextDNS is NOT running after reboot. Attempting to fix..."); exec('nextdns start',$nextdnsRestart, $status); exec('nextdns status',$nextdnsStatusPostFix, $status); if ($nextdnsStatusPostFix[0] == "running") { # clean up and create required symlink (hack) exec('rm /var/run/nextdns.sock',$cleanSymlink, $status); exec('ln -s /tmp/nextdns.sock /var/run/nextdns.sock',$symlink, $status); notify_via_telegram("nextDNS running ok after fix.", true); } else { notify_via_telegram("Unable to start nextDNS. Please check the system."); } } ?>
- 
  FYI... the script above should be run on pfSense via the "shellcmd" pfsense package @rob_cork referenced above my posts. 
- 
  You don't need to create this link, you can pass the -control flag to the cache-keys and cache-stats sub-commands. 
Content aside
- 
    3
    
      Votes
    
- 2 yrs agoLast active
- 9Replies
- 419Views
- 
    6
    Following
    
