Internal DNS fails after docker-compose down (Windows)

I’m running Windows containers on a Windows 21H2 host and I’ve recently been running into an issue with DNS resolution and I’m stumped.

When I first start my computer, if I type docker-compose up, the containers can talk to each other just fine. However, if I then type docker-compose down and then docker-compose up again, without changing anything, the containers can’t resolve each other’s hostnames.

  • I can ping the other containers directly by IP.
  • I’ve confirmed they’re all in the same network.
  • When the DNS wasn’t resolving, I tried adding a USB ethernet adapter and running docker-compose up again.
    • The DNS was able to resolve on the USB ethernet adapter
    • The DNS failed again after running down and then up again
  • May be worth noting, whenever I remove a docker network, the WiFi adapter loses its connection briefly. This has always been the case however, even prior to this DNS problem.

Rebooting the entire machine seems to be the only way to resolve it, but it’s temporary because the next time I docker-compose down again, the problem will repeat.

  • Windows 21H2 (19044.1706)
  • Docker Desktop 4.9.0 (80466)
  • Docker Engine 20.10.16

Corporate IT forced a Windows update recently, and I also updated Docker Desktop. I don’t know if either (or both) of those could be the problem.