An SRV record (Service record) is a DNS resource record type that tells clients where to find a service—what host provides it and on which port—allowing service discovery via DNS queries instead of relying on convention or hardcoded endpoints.
The record format follows this pattern:
_service._proto.name. TTL class SRV priority weight port target.
| Field | Purpose |
|---|---|
_service |
Symbolic service name (e.g., _sip, _ldap), prefixed with underscore |
_proto |
Protocol: _tcp or _udp |
priority |
Lower value = preferred; clients try records in order of ascending priority |
weight |
Relative load-balancing preference among same-priority records (weighted random selection) |
port |
TCP/UDP port where the service listens |
target |
FQDN of the server; must resolve to an A record or AAAA record, never a CNAME |
When a client queries an SRV record, it receives one or more entries, sorts them by priority, then probabilistically selects targets within the top priority tier based on their weight values. It then resolves the selected hostname to an IP address and connects on the specified port.
Example: _sip._tcp.example.com. 86400 IN SRV 10 60 5060 sipserver.example.com. directs SIP clients to sipserver.example.com on port 5060.
Common uses include SIP (VoIP), LDAP (directory services), XMPP (messaging), Minecraft servers, and Microsoft Exchange Autodiscover.
WarningSRV records are application-specific and not universally supported. Web browsers do not use SRV for HTTP/HTTPS routing, so you cannot rely on SRV to redirect web traffic. Also ensure the
targetpoints to an A/AAAA record, not a CNAME.