Journeys · Docker · L1

Two containers talking on a user-defined network

api asks for redis by name. Follow the name to an address, and the address to the other container.

✓ Validated on Docker Engine 29.9.3 · Run 1 · 2026-11-20Preview

The 30-second answer

On a user-defined network, every container's /etc/resolv.conf points at 127.0.0.11: Docker's embedded DNS server. Rules inside the container's own network namespace send those DNS packets to it. It answers redis with redis's address on the network, 172.19.0.2. api then talks to that address directly over the network's Linux bridge, and redis sees api's own address.

Mental model

A shared office with a reception desk. You ask reception for Priya's desk number and walk over to her desk yourself. Reception only knows the people who work on this floor.

Where the analogy breaks

Reception sits inside your own room: 127.0.0.11 is a local address in every container. And the office on the default bridge has no reception at all: names do not resolve there.

🔒 Free account

Sign up free to play this journey

A free account unlocks every scenario, journey and exam, and saves your progress. No payment, ever.