[SOLVED] DNS resolution is currently unavailable

Hi!

When I try to update gravity, appears 2 errors:

  • [✗] DNS resolution is currently unavailable*
  • [✗] DNS resolution is not available*

It is a extrage situation. pi-Hole is working properly, in my home network, all the devices are flowing thru it, and about 90% of ads, are blocked.

I check different forums, and seem that the issue is realted with port 53.

Also, I have a Portainer platform running on a OpenMediaVault, and now I'm not able to pull any image, and I have also a error message about pot 53..

Both situations are something regarded about port 53. ¿?
I changed NAT configuration on my router to send 53TCP/UDP connections to pi-hole IP address.

pi-Hole is running on a Orange Pi Zero Board, I started to use v4, and now I'm with a fresh new installation with v5.

pi-Hole works as a DCHP server, and DHCP server option is not enabled in my router.

I tried to generate a debug file, but when the pi-hole finishes, it is not able to upload to the server, then, I don't have a Token.

[✗] There was an error uploading your debug log.

  • Please try again or contact the Pi-hole team for assistance.
  • A local copy of the debug log can be found at: /var/log/pihole_debug.log

Thanks for your support!

SinE80

4 Likes

Any help will be helpfull... thanks in advance! :sweat_smile:

1 Like

Well, I assume that I'm a newbie.

Solution:

Connect thru putty
Login as root user

then edit resolv.conf as:

#nano /etc/resolv.conf
or
#sudo nano /etc/resolv.conf

And edit the name server to:

# Generated by NetworkManager
search home
nameserver 127.0.0.1

Now, also I can upload a debug file, for your information: x75abjglcd

Regards

11 Likes

This solution worked for me - thank you for posting! However, I have two questions about it:

  1. Why does this change need to be made? My Pihole installation is fresh out the box, so shouldn't this be set correctly in the first place?

  2. I am running Pihole in a Docker container and when I restarted it the changes I had made to the file had reverted. How do I make the change in resolv.conf permanent?

Thank you

4 Likes

How does one go about editing this file? I am having the same issue and cannot reconfigure pihole in any way as it stands.

2 Likes

A post was split to a new topic: Cannot change assigned nameserver for the Pi-hole host

2 posts were split to a new topic: Edit /etc/resolv.conf in Docker container to fix 'DNS resolution is unavailable'

Excellent! Now it works like a charm.

2 Likes

Prefect, thanks. This fixed things for me.

1 Like

Worked fr me too! +1

1 Like

There is an even easier solution that worked for me (and solved another problem too):

In your docker-compose.yml change

    ports:
      - 53:53/tcp
      - 53:53/udp

to this

    ports:
      - 192.168.X.X:53:53/tcp
      - 192.168.X.X:53:53/udp

Replace the X with the IP of the host where your Pi-Hole is running.

I got it from this Stackoverflow thread: docker-compose internal DNS server 127.0.0.11 connection refused - Stack Overflow

3 Likes

If you are using the provided basic docker compose setup on a recent raspberry, the proper (not dependent on your local IP) way is to give a hint of the system dns in addition to the upstream dns.

This is achieved by passing both upstream and system DNS at setup in the docker-compose.yml (truncated for brevity).

services:
  pihole:
    container_name: pihole
    image: pihole/pihole:latest
[...]
    environment:
      PIHOLE_DNS_1: 8.8.8.8 # the main DNS resolver 
      PIHOLE_DNS_2: 8.8.4.4 # secondary DNS resolver
[...]
    dns:
      - 127.0.0.1 # system resolver 

Bear in mind I am using the default network for my pihole docker container

NETWORK ID     NAME                      DRIVER    SCOPE
d7b5df194ceb   pihole_default            bridge    local
3 Likes

This worked for me. Thanks!

2 Likes

Worked for me. Thanks

1 Like

A post was split to a new topic: Issue with trying to run Pi-hole on TrueNAS

Would never have figured this out without your help. Thank you. I've had to change my DNS settings at DHCP just to refresh my gravity DB until this. The whole Pi-hole stack was working somehow, but gravity update failed. Just the "dns:" did it, but I also added your environment defaults too. All's good again.

My Setup: DHCP server is a pfSense box at 10.0.0.1, and Pi-hole is running in a Debian docker container on 10.0.0.50. It still works under the old setup on my 10.0.0.4 Odroid C4 Ubuntu container. So maybe Debian is actually the root-cause. I don't know. Works nicely again now. --cheers.

1 Like