What if your apps could always find each other, no matter how often servers change?
Why Service discovery via DNS in Kubernetes? - Purpose & Use Cases
Imagine you have many apps running on different servers, and each app needs to find and talk to others. You write down each server's address by hand and update your apps every time something changes.
This manual way is slow and confusing. Servers can change IPs or move, and your apps get lost trying to find each other. It's like calling a friend who keeps changing their phone number without telling you.
Service discovery via DNS lets apps ask a simple name to find others automatically. When servers change, DNS updates the addresses behind the scenes, so apps always connect to the right place without manual work.
app.connect('192.168.1.10:8080') # hardcoded IP address
app.connect('my-service.default.svc.cluster.local:8080') # DNS name resolves automatically
It makes your apps smart enough to find each other anytime, even when things move or change, without you lifting a finger.
In Kubernetes, when a new version of a service starts on a different pod, DNS updates so other pods always reach the latest version by name, not by IP.
Manual IP management is slow and error-prone.
DNS-based service discovery automates finding services.
Apps stay connected even when infrastructure changes.