DNS resolution - Compose

  • Hi, I'm experiencing a recurring issue across multiple Docker containers where applications fail to resolve dns like localhost or the other containers in the same stack.

    the last docker with this problem is erugo who fails to resolve "localhost" with the following error:

    Code
    dial tcp: lookup localhost on [::1]:53: read udp [::1]:xxxxx->[::1]:53: read: connection refused

    What I've already tried:

    • Modified /etc/resolv.conf in containers
    • Disabled IPv6 via sysctl
    • Changed DNS servers in daemon.json
    • Added extra_hosts and dns options to docker-compose
    • Configured systemd-resolved

    Some containers work fine, others consistently fail with this DNS resolution issue. It seems like certain applications inside containers ignore /etc/hosts and try DNS lookup for "localhost" via IPv6, which fails.

  • votdev

    Approved the thread.
  • cbr650

    Added the Label OMV 8.x
  • Hello,

    I have the same problem with a container in which ioBroker is running—or is supposed to run. ioBroker itself is running, but it cannot establish a connection to downloads.iobroker.net. DNS resolution inside the container appears to be working.

    OMV 8.0.2 was freshly installed. Updating to 8.0.6 did not change anything.

    The IP address is assigned automatically by the router, no firewall is active and IPv6 is not aktive.

  • no :(
    I’m just living with it for now and using alternative dockers that work. However, it’s frustrating not to know the real cause…

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!