How do you choose between DNS, Consul and Kubernetes services for microservice discovery?
AdvancedScenarioDNS & Service Discovery
Answer
Situation read → Each solves discovery at a different level of dynamism.
What I'd do →
- Use Kubernetes Services and CoreDNS inside a cluster:
svc.namespace.svc.cluster.local - Use Route 53 or an internal DNS for stable cross-cluster entry points
- Use Consul or a service mesh when you need cross-platform discovery (VMs and pods), health-aware routing and mTLS
- Keep the lowest layer that works, because every extra control plane is an outage source
Why → DNS is simple and universal but slow to change; registries react in seconds but need agents.
Interview tip → Say you avoid building discovery that platform already provides.
More on DNS & Service Discovery
A customer types www.example.com in a browser. Walk through how DNS resolves it.BeginnerWhat is the difference between an A record and a CNAME, and when do you use each?BeginnerWhy can't you put a CNAME at the zone apex, and what do you use instead?BeginnerYou are moving a site to a new server. What do you do with DNS to make the cutover smooth?BeginnerHow do you find which nameservers are authoritative for a domain and query them directly?BeginnerWhat DNS records do you set up for company email?Beginner