SRV record
What is SRV record?
An SRV record publishes the hostname and port a specific service is reachable on for a domain, letting a client discover where to connect for something like SIP or XMPP without one fixed port. AdminKit's LAN discovery guide covers the related mDNS-based pattern that layers SRV-style records on top of multicast DNS.
By AdminKit team, Netbase JSC · Updated
An SRV record publishes the hostname and port a specific service is reachable on for a domain, in the format _service._proto.name, letting a client look up where to connect for something like SIP or XMPP without a single fixed well-known port the way HTTP uses port 80. It carries priority and weight values so multiple servers can share load or fail over, similar in spirit to how MX records route mail to multiple servers by priority — Cloudflare’s explainer on SRV records covers the same priority/weight fields and what each one controls. Active Directory is one of the heaviest users: Microsoft’s guide to verifying that SRV DNS records have been created checks for a domain controller’s LDAP SRV record, _ldap._tcp.<Domain_Name>, with tools such as nslookup. RFC 2782 says the service label should be a name already registered the way a port’s service name is, drawing on the same strings IANA lists in its Service Name and Transport Protocol Port Number Registry (sip, ldap, and the like) rather than an arbitrary string. The same host-and-port advertisement pattern appears in DNS-SD (RFC 6763), which layers SRV, PTR, and TXT records on top of multicast DNS so devices on a local network can discover services like printers or media servers automatically — the same mDNS-based discovery mechanism covered in AdminKit’s LAN discovery guide, where the convenience of automatic discovery comes with broadcasting device and service details to anything listening on the same network segment. SRV records themselves are defined in RFC 2782.
SRV record is part of AdminKit’s DNS cluster; the full AdminKit glossary lists other related terms.
Frequently asked questions
What format does an SRV record use?
An SRV record is published under a name like `_service._proto.name` (for example `_sip._tcp.example.com`) and returns the hostname and port the service is reachable on.
How does an SRV record handle multiple servers for the same service?
It carries priority and weight values, similar in spirit to MX record priorities, so a client can try a primary server first and fail over to, or load-share across, others.
Do SRV records only matter for things like SIP and XMPP?
No -- the same pattern also underlies DNS-SD (RFC 6763), which layers SRV, PTR, and TXT records on top of multicast DNS so devices on a local network can automatically discover services like printers.
Why not just use a fixed well-known port the way HTTP uses port 80?
An SRV record lets a service be hosted on any hostname and port rather than requiring one fixed well-known port, giving operators flexibility a single assigned port wouldn't.