HTTPfy

SRV record

An SRV (service) record tells clients which host and port provide a service, with priorities for failover and weights for load sharing.

type code 33 RFC 2782RFC 6186

Live SRV records from real domains

Checked at via public DNS
_imaps._tcp.gmail.comSRV
_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.comSRV
_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.comSRV
_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.orgSRV
_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

What the SRV record does

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".

Zone-file syntax

_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.

Fields

FieldMeaning
PriorityLower is preferred. Clients only fall to a higher value if all lower targets fail.
WeightRelative share among targets with the same priority; 0 means no preference.
PortTCP or UDP port of the service.
TargetHostname with A/AAAA records. Not a CNAME, not an IP address. . means unavailable.

Common mistakes

  • Forgetting the underscores, or putting the domain in the wrong place: _sip._tcp must come first.
  • Pointing the target at a CNAME or an IP literal.
  • Expecting web browsers to honour SRV for a website.

Specification

  • RFC 2782: A DNS RR for specifying the location of services (DNS SRV)
  • RFC 6186: Use of SRV Records for Locating Email Submission/Access Services

Related record types

  • URI: map a service name to a full URI
  • NAPTR: rewrite rules for SIP and ENUM
  • SVCB: generic service binding for any protocol
  • MX: where email for a domain is delivered

All DNS record types