liveBook · Manning

Domain name system

As explained in Learn Docker in a Month of Lunches, Second Edition

DNS is the Domain Name System, a distributed naming system that resolves domain names to network addresses.

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.

How Learn Docker in a Month of Lunches, Second Edition covers it

How deep it goes
Explains name resolution, Docker forwarding, and scaled lookup results, but stops short of DNS protocol internals.
Examples
Demonstrates nslookup from a web container against accesslog and scaled iotd services.
What it assumes
Assumes basic Docker containers and networks, while introducing DNS through practical container lookup commands.
What you can do after
Diagnose container connectivity by scaling Compose services and inspecting Docker DNS results with nslookup.
How it connects
Connects DNS with Docker Compose, containers, service discovery, IP addresses, and scaling.

Also explained in

Compare how 7 books explain domain name system →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn Docker in a Month of Lunches, Second Edition. The section links point to the parts of the book it draws on.