Skip to content

Container DNS: how web finds api by name

Select an icon to see what it is.

Step 1 of 6

resolv.conf points at 127.0.0.11

On a user-defined network, dockerd writes /etc/resolv.conf in each container with nameserver 127.0.0.11. That address is on the container's own loopback interface. Nothing outside the container's network namespace is involved yet.

$ docker exec web cat /etc/resolv.conf
PrevNext

/etc/resolv.conf inside web (network shop-net)

nameserver 127.0.0.11
options ndots:0