docker-pi-hole icon indicating copy to clipboard operation
docker-pi-hole copied to clipboard

resolv.conf nameserver is set to 127.0.0.11

Open RABijl opened this issue 1 year ago • 4 comments

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

RABijl avatar Dec 16 '23 14:12 RABijl

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.

zeisingmi avatar Dec 29 '23 22:12 zeisingmi

For some reason /etc/resolv.conf has the name server set to 127.0.0.11 instead of 127.0.0.1

All containers here are using 127.0.0.11 (docker DNS) without issues.

rdwebdesign avatar Dec 30 '23 01:12 rdwebdesign

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

PromoFaux avatar Dec 30 '23 11:12 PromoFaux

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.

RABijl avatar Dec 30 '23 12:12 RABijl

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.

github-actions[bot] avatar Jan 30 '24 08:01 github-actions[bot]

Sorry, but I don't understand why not FIX a clear problem with an easy change, instead of using a workaround?

pippo73 avatar Mar 01 '24 07:03 pippo73