Skip to content
🎉 Launch sale:50% off everything over $22 — automatically applied at checkout· ends Aug 2Shop the sale →
DevOps AI ToolKit
Newsletter
intermediate Premium Networking · ⏱ 30 min

Diagnose a Docker DNS Failure

Scenario

Service A can’t reach Service B by name, though both are running. Determine whether it’s a network-membership problem, a service-name mismatch, or the default-bridge DNS limitation — and fix it.

Learning objectives

  • Reproduce the resolution failure
  • Inspect network membership
  • Test DNS from inside the container
  • Correct the network/name configuration

Before you start

Required software: Docker Engine 24+

Prerequisites: Docker Networking path (or Fundamentals)

  1. Download and unzip the lab.
  2. Start it: docker compose up -d.
  3. Exec into service-a and try to reach service-b by name — it fails.

Instructions

Full instructions are part of Individual Pro

Unlock the step-by-step instructions, the solution guide, validation scripts, and downloadable files.

Unlock with Pro

Hints

💡 Names don’t resolve on the default bridge

The legacy default bridge network does NOT provide automatic DNS between containers — only user-defined networks do. Check which network the containers are on.

💡 Test from inside

Use docker exec service-a getent hosts service-b (or nslookup) to see whether the name resolves at all, then check docker network inspect for membership.

Validate your work

From the lab folder, run:

bash validation/validate.sh

The script reads only your local Docker state, never transmits data off your machine, and returns a status code:

  • 0 — Lab successfully completed
  • 1 — Validation failed
  • 2 — Required dependency missing
  • 3 — Lab environment not running
  • 4 — Configuration error
  • 5 — Validation timed out

Note: validation targets Linux first. On Docker Desktop (macOS/Windows) some host-level checks (e.g. disk usage) may report differently; each script documents its limitations.

Solution

The full solution + troubleshooting explanation is available to Individual Pro members. Try to solve it first — that’s where the learning is.

Upgrade to Pro

Reset the lab

  • docker compose down -v && docker compose up -d from the original lab files restores the starting (broken) state.

Interview questions

  • Why do containers on a user-defined bridge resolve names but those on the default bridge don’t?
  • How do you list which networks a container is attached to?
  • How would you test DNS resolution from inside a container?

Finished this lab?

Sign in to record your completion and track progress across the path. Completion is recorded server-side.

Related labs