An SRV (service) record tells clients which host and port provide a service, with priorities for failover and weights for load sharing.
_imaps._tcp.gmail.com. 86400 IN SRV 5 0 993 imap.gmail.com.
; priority 5, weight 0: connect to imap.gmail.com port 993
_submission._tcp.gmail.com. 86400 IN SRV 5 0 587 smtp.gmail.com.
; priority 5, weight 0: connect to smtp.gmail.com port 587
_sipfederationtls._tcp.microsoft.com. 3600 IN SRV 100 1 5061 sipfed.online.lync.com.
; priority 100, weight 1: connect to sipfed.online.lync.com port 5061
_xmpp-server._tcp.jabber.org. 60 IN SRV 30 30 5269 scarlet.jabber.org.
; priority 30, weight 30: connect to scarlet.jabber.org port 5269
The owner name encodes the service and transport: _imaps._tcp.example.com or _sip._tls.example.com. Clients query it, try the lowest priority first and, among equal priorities, choose randomly in proportion to weight. SIP, XMPP, LDAP, Kerberos, CalDAV/CardDAV, Minecraft and mail client autoconfiguration (RFC 6186) all use SRV.
Browsers do not use SRV for HTTP; HTTPS/SVCB records fill that role. A target of . (with any port) means "this service is decidedly not available here".
_imaps._tcp.example.com. 3600 IN SRV 5 0 993 imap.example.com.
; priority weight port target
Wire format: RDATA is three 16-bit integers (priority, weight, port) followed by the target name, which must not be compressed.
| Field | Meaning |
|---|---|
| Priority | Lower is preferred. Clients only fall to a higher value if all lower targets fail. |
| Weight | Relative share among targets with the same priority; 0 means no preference. |
| Port | TCP or UDP port of the service. |
| Target | Hostname with A/AAAA records. Not a CNAME, not an IP address. . means unavailable. |
_sip._tcp must come first.