🚀 Ultra-fast web hosting from just $1/month!
HostPedia

SRV Record

DNS
Definition

SRV Record is a DNS record type that tells clients which host and port provide a specific service for a domain, along with priority and weight for failover and load distribution. Instead of assuming default ports, applications query SRV records to discover the correct endpoint, enabling flexible service location, smoother migrations, and more resilient setups across multiple servers.

How It Works

An SRV (Service) record maps a named service and protocol to a target hostname and port. The record name follows the pattern _service._proto.example.com, such as _sip._tcp or _xmpp-server._tcp. Each SRV record includes four key fields: priority (which server to try first), weight (how to distribute traffic among servers with the same priority), port (the service port), and target (the hostname that actually receives the traffic).

When a compatible client needs to connect, it performs a DNS lookup for the relevant SRV name, then selects a target based on priority and weight. The client then resolves the target hostname to A/AAAA records and connects to the specified port. This indirection lets you move a service to a new host, change ports, or add backup endpoints by updating DNS, without changing application configuration on every client.

Why It Matters for Web Hosting

SRV records matter when your hosting plan includes services beyond basic web traffic, or when you run apps that rely on service discovery (for example, chat, VoIP, game servers, or certain directory and authentication services). They influence which DNS features your provider supports, whether you can publish custom record types, and how easily you can implement failover, split services across hosts, or migrate components without downtime.

Common Use Cases

  • Directing SIP/VoIP clients to the correct server and port with priority-based failover
  • Publishing XMPP (Jabber) server endpoints for messaging clients
  • Pointing game clients to a specific host and port when defaults are not used
  • Locating LDAP, Kerberos, or other internal services in business or hybrid hosting setups
  • Splitting services across multiple hosts (web on one server, real-time service on another) while keeping a single domain

SRV Record vs CNAME Record

A CNAME record aliases one hostname to another, but it does not specify ports, priorities, or weights, and it is not service-specific. An SRV record is designed for service discovery: it can publish multiple endpoints, define connection ports, and control client selection behavior. Use CNAME for simple hostname indirection (like pointing a subdomain to another name), and SRV when an application expects a discoverable service endpoint.