Use SRV records for automatic network service location.
SRV (Service) records allow applications to automatically discover servers providing a specific service. Instead of hardcoding a server address, applications query DNS to find where to connect. This is how many modern protocols work: VoIP, instant messaging, Microsoft 365, and many more.
Unlike A records that simply associate a name with an IP, SRV records contain rich information: the service port, priority (which server to try first), and weight (load distribution among same-priority servers). This DNS-integrated intelligence greatly simplifies client configuration.
SRVs are particularly useful for services that need to run on non-standard ports, architectures with multiple servers, or automatic failover configurations. If you use Microsoft 365, Skype for Business, SIP, XMPP, or Minecraft, you're probably already using SRV records without knowing it.
SRVs have a specific syntax that encodes several pieces of information:
SRVs are used by many services and protocols:
Follow these steps to properly create an SRV:
Here are common SRV configurations for different services:
; Format: _service._proto.domain TTL IN SRV priority weight port target
; Microsoft 365 - Autodiscover
_autodiscover._tcp.example.com. 3600 IN SRV 0 0 443 autodiscover.outlook.com.
; SIP VoIP with failover
_sip._tcp.example.com. 3600 IN SRV 10 60 5060 sip1.example.com.
_sip._tcp.example.com. 3600 IN SRV 10 40 5060 sip2.example.com.
_sip._tcp.example.com. 3600 IN SRV 20 0 5060 sip-backup.example.com.
; Priority 10 = primary (60/40 load balance), priority 20 = backup
; XMPP Messaging
_xmpp-client._tcp.example.com. 3600 IN SRV 5 0 5222 xmpp.example.com.
_xmpp-server._tcp.example.com. 3600 IN SRV 5 0 5269 xmpp.example.com.
; Minecraft on non-standard port
_minecraft._tcp.example.com. 3600 IN SRV 0 5 25566 mc.example.com.
; Verification with dig
$ dig SRV _sip._tcp.example.com +short
10 60 5060 sip1.example.com.
10 40 5060 sip2.example.com.
20 0 5060 sip-backup.example.com.
The SIP example shows failover and load-balancing: sip1 and sip2 have the same priority (10) but different weights (60/40), so sip1 receives 60% of traffic. If both fail, sip-backup (priority 20) takes over.
Optimize your SRV records for resilience and performance:
No, SRV support depends on the application. Modern clients (Teams, SIP phones, XMPP clients) support them, but some applications require manual configuration.
Behavior depends on the client. Some attempt direct connection to the domain on the default port, others fail. Consult service documentation.
Technically no, the RFC states the target must be an A/AAAA. In practice, some resolvers follow the CNAME, but avoid it for compatibility.
Create an SRV with target "." (dot) and port 0. This explicitly indicates the service is unavailable, rather than SRV absence.
Yes, SRVs point to names that can have A (IPv4) and/or AAAA (IPv6) records. The client then chooses the IP version.
Yes, MoniTao can monitor your SRV records and alert you if configuration changes or target servers become unreachable.
SRV records bring intelligence and flexibility to your DNS infrastructure. Load-balancing, automatic failover, custom ports - all without complex client configuration.
Configure your SRVs carefully, test client behavior, and monitor your services. MoniTao can alert you if your SRVs change or if target servers go down.
Start free, no credit card required.