Search⌘ K

Service Discovery

Explore Docker's service discovery feature within Docker networking to understand how containers and Swarm services resolve names to IP addresses. Learn the step-by-step DNS resolution process and how to customize DNS options for advanced container networking scenarios.

As well as core networking, libnetwork also provides service discovery that allows all containers and Swarm services to locate each other by name. The only requirement is that the containers should be on the same network. Under the hood, Docker implements a native DNS server and configures every container to use it for name resolution.

The figure below shows a container called c1 pinging another container called c2 by name. The same principle applies to Swarm service replicas.

 Container c1 pinging another container c2
Container c1 pinging another container c2

Service discovery process

Let’s step through the process.

    ...