What is DNS-based service discovery, and how does it work in microservices?
Short answer: ddresses. It simplifies service discovery by relying on existing DNS infrastructure and ensuring that microservices can dynamically find each other without hardcoding addresses. How it works: Service Registration: Each microservice registers its IP address and port with a DNS resolver or service registry. Service Lookup: When a microservice… needs to……… communicate with another, it queries the DNS for the service's…
Explain a bit more
name (e.g., service-name.namespace.svc.cluster.local in Kubernetes), which returns the corresponding IP address. Dynamic Updates: As new service instances are added or removed, DNS entries re automatically updated. Example: Kubernetes uses CoreDNS for service discovery, where each microservice gets a DNS name that resolves to the service's IP.
Say this in the interview
- Define — one clear sentence (the short answer above).
- Example — relate it to a project like ShopNest or your real work.
- Trade-off — when you would not use it.
Share this Q&A
Share preview image: https://www.toolliyo.com/images/toolliyo-logo.png