-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pihole reports "DNS resolution is currently unavailable" when host's DNS references Pihole. #342
Comments
I'm having similar issues as well. Something I am noticing is that my /etc/resolv file has the wrong IP address for the 127 IP: root@dc08168ef1b1:/# cat /etc/resolv.conf My pi-hole configurations also do not expressly configure this IP anywhere, so I'm just as confused. |
When you run docker with a I opened a pull request (#343) to document the recommendation that everyone add More thinking out loud at this point about this problem now: The container starts dnsmasq very early in the startup process before lookups happen to avoid any kind of chicken-before-egg (container dns -> docker dns -> router dhcp dns -> container IP) problems so I don't believe it's so simple as that... look in your log for "DNSMasq binding to default interface", that is dnsmasq starting, and you'll see it before the error. Docker provides dns service by default for containers, so perhaps it's at fault here and just hard coding the pi-hole container and a backup external works perfectly since it avoid that. |
Adding the --dns options to my 'docker run' absolutely resolved my issue. Thanks! |
@jwalton let me know if adding the --dns options works |
Yup, fixed it for me! Thanks! |
Why doesn't pi-hole attempt to use the DNS1/DNS2 ENV variables first (or google, since that't the default without the ENV vars) for the initial DNS resolution check? Perhaps fallback to resolv.conf if env var servers don't respond? This would negate the need to specify DNS servers in docker run/compose |
This line in /etc/resolv.conf seems to be the magic Well, I am running armbian, the essential cause is that, pi-hole assigns static ip address in a 'old' way. I manually configured static ip and name server by 'nmtui' command. And then reboot, the problem is gone. |
This is the repository for our docker images. |
For the compose file:
|
Trying to get this running in k8s as well, and it was seemingly having this issue. Is there a way to use this DNS flag in k8s for a yaml file? |
Why is this issue closed? Solved by above described --dns options. You should add this as a must-have to the documentation. I only saw there are default values for DNS1 and DNS2 and never even considered that there is a problem when restarting the container. |
Thanks so much! it solved my issue in compose (portainer) |
The above is not working for me. Receiving the following error message ignoring nameserver 127.0.0.1 - local interface |
Dude, thank you so much. This was perfect, and resolved my issue! Super happy! Much appreciated! Have a fantastic day! |
Fantastic! This did the trick for me! Everything looked dandy in resolve.conf but no name resolution worked whatsoever. Nothing I did seemed to work. Tried this trick of adding it in docker-compose for the specific docker container and it worked like a charm. Much appreciated! |
If you are using portainer, you can edit the container for pihole and check in the last section, there's a tab named "Network". In the last few fields, you can set "Primary DNS Server" and "Secondary DNS Server" |
Thanks @chepe263 ... this solved it for me. Appreciate you sharing your solution. |
This issue has been mentioned on Pi-hole Userspace. There might be relevant details there: |
Thanks, this work for me! I didnt include de 8.8.8.8, because i dont want to use google DNS servers. I have only included 127.0.0.1 and that solved the problem for me. |
Google finally brought me here. I was seeing Gravity update error DNS resolution is not available. The container's log was giving me on startup:
@diginc and @dcharbonnier posts provide both an explanation and a solution. I'd vote to mention this configuration option within |
This issue was closed 5 years ago, with the following lines in the readme being added in by #343 |
@jwalton commented on Sun Oct 14 2018
In raising this issue, I confirm the following:
{please fill the checkboxes, e.g: [X]}
How familiar are you with the the source code relevant to this issue?:
1
Expected behaviour:
Pihole starts correctly.
Actual behaviour:
Pihole logs:
And then dies.
Steps to reproduce:
It seems that, when starting pihole via docker, if the docker host machine has the pihole listed as a nameserver in resolv.conf, then pihole will fail to start with
DNS resolution is currently unavailable.
, even if other nameservers are listed and the docker host is able to resolve domain names.Debug token provided by:
I tried
pihole -d -a
via docker, but I didn't see a debug token anywhere in the output. This is everything fromdocker logs pihole
: https://gist.github.com/jwalton/508fd6041945ba4e4947072c147d0d79Troubleshooting undertaken, and/or other relevant information:
I have a stock Asus RT-AC68U router at 192.168.0.1 ("the router"). I have a docker host running at 192.168.0.4, which is where pihole runs.
The router runs the DHCP server for the house, and it also is my gateway to the cable modem. The router advertises itself as the DNS lookup (192.168.0.1). In the router config, I can optionally provide another DNS server (the pihole server), in which case the router will advertise the pihole (192.168.0.4) as the primary DNS and itself (192.168.0.1) as the secondary DNS. This works well, as if the pihole dies, I still can resolve things through the router's DNS.
On the docker host, resolv.conf looks like:
If I try to start (or restart) pihole with the resolv.conf looking like this, pihole will start with
DNS resolution is currently unavailable
, and then kill itself. Note that I am able to resolve hostnames on the docker host (e.g.host github.com
returns sensible results). If I remove thenameserver 192.168.0.4
line, the pihole starts correctly (although then the DHCP client on 192.168.0.4 will eventually overwrite resolv.conf, and then if pihole crashes or tries to restart, it will fail).@jwalton commented on Sun Oct 14 2018
I should also point out my pi-hole configuration for DNS servers includes neither 192.168.0.1 nor 192.168.0.4, so I'm not sure why /etc/resolv.conf even comes into play here.
The text was updated successfully, but these errors were encountered: