compose: [BUG] Internal DNS server randomly not working since v2.24.6

Description

Hello, with Docker v25.0.3 and Docker Compose v2.24.6 (Debian Bookworm, up2date), i am experiencing random issues with the internal DNS server of docker.

The problem shows up, as the applications in the containers try to resolve the DNS name of another container - they are trying to send a DNS request to 127.0.0.11:53 and are getting a connection refused. The behavior is absolutely random, so i am not able to provide a way to reproduce it.

The behavior showed up on 5 servers - so basically on all servers in my setup, that got the update to Docker Compose v2.24.6.

With Docker Compose v2.24.5, the behavior doesnt show up on all of the mentioned systems. Downgrade + down and up on all docker compose stacks helped for me.

Steps To Reproduce

No response

Compose Version

v2.24.6

Docker Environment

Client: Docker Engine - Community
 Version:    25.0.3
 Context:    default
 Debug Mode: false
 Plugins:
  compose: Docker Compose (Docker Inc.)
    Version:  v2.24.5
    Path:     /usr/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 14
  Running: 14
  Paused: 0
  Stopped: 0
 Images: 13
 Server Version: 25.0.3
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc version: v1.1.12-0-g51d5e94
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.1.0-18-amd64
 Operating System: Debian GNU/Linux 12 (bookworm)
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 23.46GiB
 Name: docker-prod-2
 ID: 055df007-4d51-4aa4-835d-a806a8e73050
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: true
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Anything else?

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 7
  • Comments: 17 (2 by maintainers)

Most upvoted comments

Just released v2.24.7 which fixes multiple networks issues on the Compose side. Docker Engine v25.0.4 will also be released soon, which includes bugfixes in the dockerd daemon. See the Moby v25.0.4 milestone for the full list.

I believe the new Compose version will resolve the problems being seen here, but I don’t have a repro case to confirm this specific issue

I was having DNS issues running compose 2.24.6 on Arch Linux. My compose stack had separate networks connecting a frontend, backend and database. So, between these containers, there are 3 networks:

  • public-net → frontend → backend-net → backend → database-net → database

The frontend was having issues resolving backend, even though it was connected to the correct network and I could connect to it by IP address.

I’m not sure if this is related to https://github.com/docker/compose/issues/11533, but the suggestion there is the same: to update compose.

As I’m on Arch Linux, I installed docker-compose-v2-git from the AUR and rebooted, but the frontend still couldn’t resolve the backend container. After rebuilding my containers (docker compose down && docker compose up -d), my networking issues seem to have been solved now.

This was a very frustrating issue, I spent a good part of my Sunday thinking there was an issue with my compose.yaml file and tinkering with that (as I’d just bumped the base image versions).

I have gone back to 4.27.2 docker desktop for mac and haven’t had this issue since

https://desktop.docker.com/mac/main/arm64/137060/Docker.dmg if anybody needs the download url

It’s a long shot but I had some dns issues as well between these versions — though it presented differently for me — and what seemed to resolve it was purging the docker networks.

Technically I just purged everything as a Hail Mary but in hindsight perhaps it was the networks being cleaned up that unjammed my dns resolution.

EDIT: I should have said, I also use multiple networks like as mentioned by other folks below.