advancedScenario-Based & System Design Questions

A container can `ping` another container by IP but DNS resolution by container name fails.

This is the classic default-bridge-network trap: the default bridge network does not provide embedded DNS, only IP-level connectivity. Fix by creating and using a user-defined bridge network (or, in Compose, simply relying on its auto-created project network) — both provide automatic name-based service discovery that the default bridge lacks.

Ready to master this question?

Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.

Sign in to generate a response

Next Step

Continue to A multi-stage Docker build's final image is still much larger than expected despite using multi-stage builds correctly.← Back to all Docker questions