-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Why requirement for --dns=127.0.0.1 ? #431
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
Comments
Modifications to the upstream Pi-hole repos could possibly remove this requirement. I agree it has been the source of some pain. The gravity code you linked ( I think top clients rendering with IPs instead of hostnames is another defect that the container using local DNS fixes also, at least while DHCP is in use... This : https://github.com/pi-hole/AdminLTE/blob/5ec769d9d8ed70d43e1d774722d6e9a7f5002f14/api_db.php#L36 Could perhaps adopt a lookup from this instead, but it ads a dependency: https://stackoverflow.com/q/11563956 Those are the two mean reasons why localhost is set to the container's primary DNS.
You might have a good alternative there with the dev tcp check |
The The gravity script seem to have a fallback mechanism using dig, but that doesn't seem to target the request at
Interesting! However as you say, for people not using pi-hole as a DHCP server, this might not be an issue at all. The docker upstream resolver is most likely able to resolve those names.
Let me know if you want me to write a PR, but it might be easier for you to do it directly ;) |
This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days. |
A lot of people trying to run this docker image have issues coming from the requirement to have the
resolv.conf
file contain127.0.0.1
as the primary resolver.Some docker/docker-compose installs simply don't seem to respect the option (e.g #410), requiring more dramatic hack such as binding a resolv.conf volume. I'm impacted by this, not sure why.
I understand this was proposed as a "fix" to other issues (as implied by #343), but what I can't figure out is what are those issues and what are they stemming from?
The only reference in pi-hole code I found is in gravity.sh that seem to check for DNS availability by issuing a system DNS query.
https://github.com/pi-hole/pi-hole/blob/f65f793a0d0d7dbc5882be38858c986f42b8c776/gravity.sh#L101
If that's the cause, why not target the query there at the localhost?
That's what the healthcheck seem to be doing?
docker-pi-hole/Dockerfile.template
Line 46 in f1f53e7
(Btw, why not do a simple TCP connection check like the basic pi-hole service script? That would avoid cluttering the logs with constant
pi.hole
queries)https://github.com/pi-hole/pi-hole/blob/995ee41d6bc3a405a0402745b24140ca08c148f3/pihole#L259-L261
Removing the DNS mapping might also help add support for using other containers as DNS upstream as requested in #425, since docker's DNS resolver wouldn't be lost.
The text was updated successfully, but these errors were encountered: