What is SRV Record?
Also known as: Service Record
An SRV record is a DNS resource record that defines the hostname and port number for a specific service, enabling clients to discover services like SIP or XMPP.
An SRV record is a DNS resource record type defined in RFC 2782 that specifies the location of a particular service on a network. Unlike standard A or AAAA records, which map a hostname to an IP address, an SRV record includes the port number and a priority and weight value that allows a client to select among multiple servers offering the same service. This enables protocol-level service discovery without hardcoding ports or hostnames.
The SRV record format contains these fields: service name (prefixed with an underscore, e.g. _sip), protocol (e.g. _udp), priority, weight, port, and target hostname. A client resolving an SRV record for a given service and protocol will receive a set of targets, sorted by priority. Within equal-priority entries, it uses the weight to probabilistically select a target. This supports load balancing and failover. The record is typically queried via a DNS lookup where the domain owner has published SRV records for their services.
SRV records are required by several internet protocols. SIP (Session Initiation Protocol, RFC 3261) relies on SRV records to locate SIP servers. XMPP (Extensible Messaging and Presence Protocol, RFC 6120) uses SRV lookups for client-to-server connections. LDAP (Lightweight Directory Access Protocol) can also use SRV records in its connection process. Many email systems still use MX records for mail transport, which predate SRV and lack port information, but SRV is the more general mechanism. When an SRV record is present, it can be used in combination with NAPTR records in DNS-based service discovery.
Key facts
- Defined in RFC 2782 in February 2000.
- Contains service, protocol, priority, weight, port, and target hostname.
- Priority selects primary server; weight distributes load among equal priority servers.
- Used by SIP, XMPP, LDAP, Kerberos, and other protocols for service discovery.
- Service and protocol fields are prefixed with an underscore (e.g. _sip._tcp.example.com).
How it works in practice
Related terms
References
More in DNS
A Record
A DNS resource record that maps a hostname to a 32-bit IPv4 address. It is the most fundamental record type for translating domain names to numeric addresses on the Internet.
AAAA Record
A DNS resource record that maps a hostname to a 128-bit IPv6 address, analogous to the A record for IPv4.
Authoritative DNS
An authoritative DNS server holds the definitive resource records for a specific domain and responds to queries with the final answer for that zone, not a cached copy.
CAA Record
A CAA (Certification Authority Authorization) DNS record lets domain owners specify which certificate authorities are permitted to issue SSL/TLS certificates for their domain.
CNAME Record
A DNS record that maps an alias hostname to the true or canonical hostname, allowing multiple names to resolve to the same IP address without duplicating A or AAAA records.
DNS
The Domain Name System (DNS) is a hierarchical, distributed naming system that translates human-readable domain names (like example.com) into IP addresses and other resource records used by internet protocols.
DNS Anycast
DNS Anycast uses one IP address served from multiple geographically distributed nameservers; queries are routed to the nearest or healthiest node, improving resilience and reducing latency.
DNS Caching
DNS caching stores resolved domain name query results for the specified TTL duration to avoid repeated queries to upstream authoritative servers.
DNS Hijacking
DNS hijacking is an attack or misconfiguration that returns forged DNS responses, causing users to connect to attacker-controlled hosts instead of the intended server.
DNSSEC
DNSSEC (DNS Security Extensions) add cryptographic digital signatures to DNS records, enabling resolvers to verify that responses have not been tampered with or spoofed.