DNS stops working randomly

I have a git issue request opened, I was wondering if anyone else from the community had this same issue and some resolution. Do I need to add in a cron job to restart dns everyday? Id really like to know why its stopped working.

Please upload a debug log and post just the token URL that is generated after the log is uploaded by running the following command from the Pi-hole host terminal:

pihole -d

or do it through the Web interface:

Tools > Generate Debug Log

Hi, there is one posted on the GIT already. Did you want me to post that here instead?

Yes. The other one has expired.

did you want me to wait till it happens again? Everything is working at the moment, till it doesn't.

You could upload one now for us to take a look at, and if that doesn't show anything obvious, another one if your issue reoccurs.

https://tricorder.pi-hole.net/90nlMjAB/
This was generated while everything is working. I can usually tell by going to the dashboard and seeing graphs, otherwise will see NAN.

This is usually means your browser session expired and you need to login again to the web interface.

To be sure, next time it happens only login again and see if the problem is gone.

I will try this again but its been my experience that NAN is showing due to not being able to process any DNS queries. At the time this happens, I have to relog into the portal which should reset the browser session, no? None of my systems are able to get out to the inet till I pass that command that was mentioned previously, then NAN gets replaced by query information.

When this happens again, I will document if this cleared that NAN issue.

It just happened again, this was run right after I ran the OP command though. https://tricorder.pi-hole.net/zyI7gQnQ/

Is there a way to manually upload logs to tricorder? I ran pihole -d but I couldn't upload the logs due to dns resolutions. I was able to ping IP's but I could not resolve anything. I can post the output but since its so large, I dont know what to scrub as its so big.

Add nameserver 8.8.8.8 to /etc/resolv.conf and try again.

There was already an entry of 8.8.4.4 in there. When it breaks, it does not resolve. Also, I was asking if I could upload what pihole -d printed out because it would not post anything since your script ONLY does a DNS resolution rather than adding a check to also check the IP. I thought what pihole -d printed out while the dns was broken would provide better insight as to what is broken rather than that would is now working.

I'm not sure if I understood your comment.

The result of the last pihole -d run can be found at /var/log/pihole/pihole_debug.log. You can read the file using:

cat /var/log/pihole/pihole_debug.log
or
less -r /var/log/pihole/pihole_debug.log

When I do a pihole -d when the dns is not working, pihole -d will not work as its trying to reach a resolved domain, which it cannot do because the dns is broken. IP's still work so your script will not upload any data to tricorder if dns resolution still isn't working. I was making comment that it should try and upload the data regardless if the dns can be resolved or not. I had what I think would have been useful info but I do not know of a way to manually upload this to tricorder for someone to view this.

Anyways, its done this again, dns has stopped working and I have to run the OP command to get it working again. I am at a loss on how to fix this as I do not know what is causing this so I am going to resort to restarting the dns on a daily basis.

If you still have the debug log created when you saw the error, run:

cat /var/log/pihole/pihole_debug.log | pihole tricorder

This will upload your last debug log.

It does not seem I have this log any longer and I have added a cronjob to restart the dns everyday, I hope this will at least resolve the issue, for now, sans the log, is there any other information I can provide?

Running pihole on a spare rpi3b
Raspbian GNU/Linux 11 (bullseye)
Wired eth
Using mostly default pihole settings, using opendns settings (tried 8.8.8.8 as per one of the posts, still same issue), using dhcpd option.

pihole -d will create /var/log/pihole/pihole_debug.log - it is only the upload to our servers that would fail when DNS isn't operational.

yubiuser's earlier advice to edit your /etc/resolv.conf intended to restore DNS resolution to your Pi-hole host machine by having that machine use a public DNS server.

If applied correctly, that should have allowed you to upload the file, either by rerunning pihole -d or by manually uploading an existing debug log as advised by rdwebdesign.

Pi-hole would not delete pihole_debug.log by itself.

Run from your RPi3B hosting Pi-hole, please share the output of the following commands:

ls -lah /var/log/pihole/pihole_debug.log
cat /etc/resolv.conf

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.