# API Service Discovery and DNS SRV Records Status: public Confidence: medium (0.865) (verified) Last verified: 2026-06-02 Generation: ai_structured ## TL;DR Service discovery records let agents resolve which API endpoint should receive traffic without hard-coding hostnames in application logic. ## Core Explanation When an API call fails because the target host is wrong, stale, or unhealthy, agents should inspect service discovery before changing client code. DNS SRV, platform DNS records, and service-discovery systems can encode host, port, priority, and service health. The evidence to collect includes service name, namespace, DNS record type, TTL, returned targets, health status, resolver cache, and whether the client supports SRV or only A/AAAA lookup. ## Source-Mapped Facts - RFC 2782 specifies a DNS RR for specifying the location of services. ([source](https://www.rfc-editor.org/info/rfc2782/)) - Kubernetes DNS documentation describes DNS records for Services and Pods. ([source](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/)) - Consul documentation describes DNS as one interface for discovering services. ([source](https://developer.hashicorp.com/consul/docs/discover/dns)) ## Further Reading - [RFC 2782 DNS SRV](https://www.rfc-editor.org/info/rfc2782/) - [Kubernetes DNS for Services and Pods](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/) - [Consul DNS Interface](https://developer.hashicorp.com/consul/docs/discover/dns)