SRV Records: Telling Clients Which Host and Port to Use
An A record tells a client which address to connect to, but not which port or which of several servers. SRV records add that: for a named service, they list the hosts, the port and the order in which to try them. Phones, chat clients, games and Windows domains rely on them.
What an SRV record says
The name of an SRV record is built from the service and the transport protocol, both prefixed with an underscore; the value has four fields.
_sip._tls.example.com. — The name: service (_sip), protocol (_tls, _tcp or _udp) and the domain. The underscores keep these names apart from real hostnames.
Point at, tap or tab to a part of the record to see what it does.
Priority and weight
Clients pick the lowest priority first and, within it, choose randomly in proportion to the weights. Only if every host at that priority fails do they move on:
_sip._tls.example.com. 3600 IN SRV 10 60 5061 sip1.example.com.
_sip._tls.example.com. 3600 IN SRV 10 40 5061 sip2.example.com.
_sip._tls.example.com. 3600 IN SRV 20 0 5061 backup.example.net.sip1andsip2share priority 10, so clients split between them roughly 60/40.backup.example.nethas priority 20 and is used only when both are unreachable. A weight of 0 is fine when a priority level has a single host.- Weights are relative within one priority. 3 and 2 mean the same as 60 and 40.
Where SRV records are used
| Service | Record names |
|---|---|
| SIP telephony and video calls | _sip._tls · _sip._udp |
| XMPP chat (clients and federation) | _xmpp-client._tcp · _xmpp-server._tcp |
| Active Directory domain controllers | _ldap._tcp · _kerberos._udp |
| Minecraft Java Edition servers | _minecraft._tcp |
| Mail client setup (RFC 6186) | _submission._tcp · _imaps._tcp |
| Calendar and contacts (CalDAV, CardDAV — RFC 6764) | _caldavs._tcp · _carddavs._tcp |
Rules for SRV records
- The target must be a hostname with an A or AAAA record — not an IP address and not a CNAME (RFC 2782).
- Dashboards split the record into fields (service, protocol, priority, weight, port, target). Some want
_sip._tlsas the name, others ask for each part separately; whether to include the domain differs too. - A target of
.means the service is deliberately not available at this domain, which saves clients from trying ports one by one:
; this service is deliberately not offered here (RFC 2782)
_imap._tcp.example.com. 3600 IN SRV 0 0 0 .Checking SRV records
Query the full name, prefixes included; asking for example.com SRV returns nothing.
dig _sip._tls.example.com SRV +short
# 10 60 5061 sip1.example.com.
dig _minecraft._tcp.example.com SRV +shortFrequently asked questions
What is the difference between priority and weight in an SRV record?
Priority decides the order: the lowest is tried first. Weight decides the share of clients among records with the same priority.
Can an SRV target be a CNAME?
No. RFC 2782 requires the target to have its own address records. Some clients follow a CNAME anyway, but not all.
Do websites use SRV records?
No. Browsers look up A, AAAA and HTTPS records for websites, never SRV.
Why does my SRV lookup return nothing?
Usually because the name is incomplete. The query must include the service and protocol, such as _sip._tls.example.com.
See the theory in practice — run a SRV Lookup for your own domain.