← DNS RecordsRecord Type / Service
SRV Record
Locates services by name, protocol, and port — enabling automatic service discovery for SIP, XMPP, IMAP, Kubernetes, and many other protocols.
Overview
Service Location Record
SRV records (RFC 2782) allow clients to discover how to reach a specific service without hardcoding server addresses and ports. Applications query _service._proto.domain and receive the hostname and port of the server(s) providing that service.
The record contains four pieces of data: priority (lower = preferred, like MX), weight (for load balancing among equal-priority records), port (the TCP/UDP port the service listens on), and target (the hostname running the service).
- Name format:
_service._tcp.domainor_service._udp.domain - Priority: lower number = try first (same semantics as MX priority)
- Weight: higher number = gets more traffic among same-priority records (0 = no preference)
- Target
.(single dot) means the service is unavailable — clients must not attempt connection - Target must be a hostname with A/AAAA record — not a CNAME or IP address
- Cannot be published at the zone apex
; Syntax
; _svc._proto.name [TTL] IN SRV prio weight port target.
; Single server
_sip._tcp IN SRV 10 20 5060 sip.example.com.
; Redundant (primary + fallback)
_imaps._tcp IN SRV 10 0 993 mail1.example.com.
_imaps._tcp IN SRV 20 0 993 mail2.example.com.
; Load balanced (equal priority, weighted)
_http._tcp IN SRV 10 70 443 web1.example.com.
_http._tcp IN SRV 10 30 443 web2.example.com.
; web1 gets 70% of connections, web2 gets 30%
; Signal service unavailable
_sip._tcp IN SRV 0 0 0 .
SRV Weight Load BalancingAmong records with equal priority, weight determines the proportion of connections. A weight of 70 vs 30 sends approximately 70% of traffic to the first server. Weight 0 means "use only when no other same-priority record is available."
Examples
Common SRV Record Uses
SIP (VoIP)
_sip._tcp.example.com. SRV 10 20 5060 sip.example.com.
XMPP/Jabber
_xmpp-server._tcp.example.com. SRV 5 0 5269 xmpp.example.com.
IMAP autodiscover
_imaps._tcp.example.com. SRV 0 1 993 mail.example.com.
Outlook autodiscover
_autodiscover._tcp.example.com. SRV 0 0 443 autodiscover.example.com.
Minecraft
_minecraft._tcp.example.com. SRV 0 5 25565 mc.example.com.
Kubernetes etcd
_etcd-server._tcp.example.com. SRV 0 0 2380 etcd-0.example.com.
Diagnostics
Querying SRV Records
Query a SRV record
# SIP over TCP
dig _sip._tcp.example.com SRV +short
# IMAP autodiscover
dig _imaps._tcp.example.com SRV +short
# Outlook autodiscover
dig _autodiscover._tcp.example.com SRV
# Full response with all fields
dig _xmpp-server._tcp.example.com SRV
Troubleshoot email autodiscovery
# Test Outlook autodiscover via SRV
dig _autodiscover._tcp.example.com SRV +short
# Also check HTTPS autodiscover endpoint
curl -v https://autodiscover.example.com/
autodiscover/autodiscover.xml
# Check IMAP/POP3 SRV records
dig _imaps._tcp.example.com SRV +short
dig _pop3s._tcp.example.com SRV +short