Random DNS resolution failures for pihole -g and other commands

Please follow the below template, it will help us to help you!

Expected Behaviour:

DNS resolution for pihole -g to always work?

Actual Behaviour:

pi@pihole:~ $ pihole -g
[✗] DNS resolution is currently unavailable
[✓] DNS resolution is now available

But its not limited to just pihole, also nslookup of www.google.com / www.github.com etc. will suddenly just stop working on my RaspberryPi running pihole, whereas my laptop and other systems work fine.

Are all your devices using Pi-hole? My first thought is some problem with the connection from the Pi to the router.

The pi-hole is plugged straight into my router, and when I enable my router as a 2nd DNS server everything works immediately again.

Will you send a screenshot of where you are setting it? It needs to be in the LAN or DHCP options section.

I only setup my router as DNS on my systems when pi-hole suddenly is unable to resolve DNS queries even on the system itself, nslookup of any address while logged in on the pi-hole system will stop working. Running pihole -g will report DNS unavailable and wait for 120 seconds before trying again and it will sit there with no DNS on the device itself for upto 1 hr.

Yes, that's why I was asking for a screenshot of where you are setting the DNS and linked to the FAQ.

I set my router to be the DNS provider on my MacBook Pro when I run into DNS problems on both the pi and my laptop, and DNS resolution works instantly on my MBP whereas the pi will fail DNS resolution for minutes.

So it's your RPi that can't get out to the Internet?

Correct behaviour that I see on my RPi is this for example:

pihole -upi@pihole:~ $ pihole -up
[i] Checking for updates...
[i] Pi-hole Core: update available
[i] FTL: up to date
[i] Web Interface: up to date

[i] Pi-hole core files out of date
[✓] Check for existing repository in /etc/.pihole
[✓] Update repo in /etc/.pihole

[✓] Root user check

    .;;,.
    .ccccc:,.
     :cccclll:.      ..,,
      :ccccclll.   ;ooodc
       'ccll:;ll .oooodc
         .;cll.;;looo:.
             .. ','.
            .',,,,,,'.
          .',,,,,,,,,,.
        .',,,,,,,,,,,,....
      ....''',,,,,,,'.......
    .........  ....  .........
    ..........      ..........
    ..........      ..........
    .........  ....  .........
      ........,,,,,,,'......
        ....',,,,,,,,,,,,.
           .',,,,,,,,,'.
            .',,,,,,'.
              ..'''.

[i] Performing unattended setup, no whiptail dialogs will be displayed
[✓] Disk space check

[✓] Update local cache of available packages

[✓] Checking apt-get for upgraded packages... 10 updates available
[i] It is recommended to update your OS after installing the Pi-hole!

[i] Installer Dependency checks...
[✓] Checking for apt-utils
[✓] Checking for dialog
[✓] Checking for debconf
[✓] Checking for dhcpcd5
[✓] Checking for git
[✓] Checking for iproute2
[✓] Checking for whiptail

[i] Performing reconfiguration, skipping download of local repos
[✓] Resetting repository within /etc/.pihole...
[✓] Resetting repository within /var/www/html/admin...
[i] Main Dependency checks...
[✓] Checking for bc
[✓] Checking for cron
[✓] Checking for curl
[✓] Checking for dnsmasq
[✓] Checking for dnsutils
[✓] Checking for iputils-ping
[✓] Checking for lsof
[✓] Checking for netcat
[✓] Checking for sudo
[✓] Checking for unzip
[✓] Checking for wget
[✓] Checking for idn2
[i] Checking for sqlite3 (will be installed)
[✓] Checking for lighttpd
[✓] Checking for php-common
[✓] Checking for php-cgi
[✓] Checking for php-sqlite3
[✓] Installing scripts from /etc/.pihole

[i] Installing configs from /etc/.pihole...
[i] Existing dnsmasq.conf found... it is not a Pi-hole file, leaving alone!
[✓] Copying 01-pihole.conf to /etc/dnsmasq.d/01-pihole.conf

[i] Creating log and changing owner to dnsmasq... log already exists!

[i] Installing blocking page...
[✓] Creating directory for blocking page, and copying files
[✗] Backing up index.lighttpd.html
No default index.lighttpd.html file found... not backing up

[✓] Installing sudoer file

[✓] Installing latest Cron script

[✓] Installing latest logrotate script

[i] FTL Checks...
[✓] Detected ARM-hf architecture (armv6 or lower) Using ARM binary
[i] Checking for existing FTL binary...
[i] Latest FTL Binary already installed (v3.0). Confirming Checksum...
[i] Checksum correct. No need to download!
[i] Restarting services...

[✓] Starting dnsmasq service

[✓] Enabling dnsmasq service to start on reboot

[✓] Starting lighttpd service

[✓] Enabling lighttpd service to start on reboot

[✓] Starting pihole-FTL service

[✓] Enabling pihole-FTL service to start on reboot

[i] Preparing to run gravity.sh to refresh hosts...
[i] Cleaning up previous install (preserving whitelist/blacklist)
[i] Running gravity.sh
[✗] DNS resolution is currently unavailable
[i] Time until retry: 113

What version of Pi-hole are you currently on?

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