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.