docker-pi-hole
docker-pi-hole copied to clipboard
resolv.conf nameserver is set to 127.0.0.11
Versions
Pi-hole version is v5.17.2 (Latest: v5.17.2) web version is v5.21 (Latest: v5.21) FTL version is v5.23 (Latest: v5.23) Container tag is: 2023.11.0
Platform
- OS and version: Raspbian 11 and Arch Linux
- Platform: Raspberry Pi 3, x86
- Docker: 24.0.5 / 24.0.7
Expected behavior
When starting up the latest docker image via docker compose, the container manages to connect to the host dns server.
Actual behavior / bug
For some reason /etc/resolv.conf
has the name server set to 127.0.0.11
instead of 127.0.0.1, therefore pi hole can not update it's local ad lists. I do not know where this problem comes from, but i've been able to work around it making a volume of the resolv.conf without the extra 1
Steps to reproduce
Steps to reproduce the behavior:
take an example docker-compose.yml and run docker compose up --detach
Additional context
none
I found no editor inside the docker image, so I used "echo" to change the file. First have a look into the current settings: cat /etc/resolv.conf
Note the existing content of the file and alter the wrong line. In my case this is: echo "nameserver 127.0.0.1" > /etc/resolv.conf echo "options ndots:0" >> /etc/resolv.conf
Yes, I know, this is not a solution, just a workaround.
For some reason
/etc/resolv.conf
has the name server set to127.0.0.11
instead of 127.0.0.1
All containers here are using 127.0.0.11
(docker DNS) without issues.
In your compose file, put something like
dns: 8.8.8.8
Or whatever DNS you want the container to use
No need to edit the resolv.conf
Ah so the container should be set with a DNS server it will use. Is this required by default? If so, maybe the example could be updated to reflect this.
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.
Sorry, but I don't understand why not FIX a clear problem with an easy change, instead of using a workaround?