Docker's Built-in DNS
LEVEL 0
The Problem
You’ve been using container names to communicate (like ping database). But how does this actually work?
DNS (Domain Name System) is what translates human-readable names into IP addresses. On the public internet, DNS servers translate google.com to 142.250.185.46.
But containers are in a private network. There’s no public DNS server that knows about your database container.
So who’s translating database into 172.18.0.2?