- Published on
What is an SRV record?
- Authors
- Name
- Skip2 Networks
- Title
- Content Manager
SRV
What is SRV?
An SRV (Service) record is a specialized type of DNS record that provides detailed information about available services within a domain, including the hostname, port number, priority, and weight for service discovery and load balancing. Unlike simple A or CNAME records that only point to IP addresses or domain names, SRV records contain comprehensive service metadata that enables clients to automatically discover and connect to the appropriate servers for specific services. The SRV record format follows a structured pattern: _service._protocol.domain
with values specifying priority (lower numbers indicate higher priority), weight (for load distribution among same-priority servers), port number, and target hostname.
SRV records play a crucial role in modern distributed architectures and service-oriented systems where applications need to dynamically discover and connect to various services without hardcoded server addresses. This flexibility becomes particularly valuable in cloud environments, microservices architectures, and CDN deployments where services may scale up or down, change locations, or require load balancing across multiple instances. Major protocols like SIP (Voice over IP), XMPP (instant messaging), and various Microsoft services rely heavily on SRV records for automatic service discovery, making them essential for enterprise communications and collaboration platforms.
SRV Record Example
A company deploys a video conferencing system that uses SIP protocol for voice calls. Instead of configuring each employee's phone with specific server addresses, they create SRV records in their DNS: _sip._tcp.company.com
pointing to multiple SIP servers with different priorities and weights. The primary server gets priority 10 with weight 60, while backup servers receive priority 20 with weights 30 and 10 respectively. When employees' phones need to make calls, they automatically query the SRV record, discover all available SIP servers, and connect to the highest priority server that's currently available, with load distributed according to the configured weights.
SRV Record Structure
Component | Example Value | Purpose |
---|---|---|
Service | _sip | The service name (prefixed with underscore) |
Protocol | _tcp | Transport protocol (TCP or UDP) |
Domain | company.com | The domain offering the service |
Priority | 10 | Lower numbers = higher priority |
Weight | 60 | Load balancing within same priority |
Port | 5060 | Port number for the service |
Target | sip1.company.com | Hostname providing the service |
Common SRV Record Services
- _sip._tcp - Session Initiation Protocol for VoIP
- _xmpp-server._tcp - XMPP server-to-server communication
- _ldap._tcp - Lightweight Directory Access Protocol
- _kerberos._tcp - Kerberos authentication service
- _caldav._tcp - Calendar server discovery
- _imaps._tcp - Secure IMAP email service
SRV Record Benefits
- Automatic Service Discovery - Clients find services without manual configuration
- Load Balancing - Distribute traffic across multiple servers using weights
- Failover Support - Automatic fallback to backup servers when primary fails
- Port Flexibility - Services can run on non-standard ports transparently
- Scalability - Easy addition or removal of service instances
SRV Record Limitations
- Client Support Required - Applications must be programmed to query SRV records
- DNS Dependency - Service availability depends on DNS infrastructure
- Caching Considerations - TTL settings affect how quickly changes propagate
- Complexity - More complex than simple A/CNAME records to configure and troubleshoot