DNS links human-friendly domain names to IP addresses. Docker uses the same idea inside private networks, allowing containers to find one another without depending on fixed addresses. section 7.3
When a container looks up another container name, Docker’s built-in DNS service returns its current IP address. If the name is external, Docker forwards the request to the host for a normal organizational or public DNS lookup. Scaling can return multiple addresses, allowing consumers to reach replicated services. section 7.3
Verify service discovery
Scale the application, enter the web container, and run nslookup accesslog. Repeat with nslookup iotd after scaling iotd to three containers; the lookup can return each service container’s IP address.






