DNSFly
DNS 7 min read

What is a SRV Record?

SRV records tell clients exactly where to find a service — including the hostname, port number, and how to prioritize and balance traffic between multiple servers.

Quick Answer

A SRV (Service) record is a DNS record that specifies the hostname and port number for a particular service. Unlike A records that only map to an IP address, SRV records include additional information: which port the service runs on, which server to prefer (priority), and how to distribute load between servers (weight). They are commonly used for VoIP, instant messaging, Microsoft 365, and game servers.

1. How SRV Records Work

Most DNS records only tell you where a server is. A SRV record goes further — it tells you where a specific service is, on which port, and how to handle multiple servers running the same service.

When a client application (like a VoIP phone or chat app) needs to connect to a service, it queries DNS for the SRV record. The response tells it the exact server and port to connect to, without the application needing to be manually configured.

# SRV record format
_service._protocol.name. TTL IN SRV priority weight port target
# Real example: SIP service over TCP
_sip._tcp.example.com. 3600 IN SRV 10 60 5060 sipserver.example.com.

The naming convention uses underscores to prevent collisions with regular domain names. The service name and protocol are always prefixed with an underscore: _sip, _tcp.

2. SRV Record Fields Explained

FieldExamplePurpose
Service_sipThe name of the service (SIP, XMPP, LDAP, etc.)
Protocol_tcpTransport protocol — usually TCP or UDP
Nameexample.comThe domain this service belongs to
Priority10Lower number = tried first. Used to set primary vs backup servers
Weight60Load balancing among servers with same priority. Higher = more traffic
Port5060The port number the service runs on
Targetsipserver.example.comThe hostname providing the service (must have an A or AAAA record)

Important: The target must point to a hostname with an A record or AAAA record. Pointing a SRV record to a CNAME is not valid and will cause failures.

3. How Priority and Weight Work Together

Priority and weight work as a two-level system for directing traffic. Priority is checked first. Weight only matters when multiple records share the same priority.

# Multiple SRV records for load balancing + failover
_sip._tcp.example.com. 3600 IN SRV 10 60 5060 main.example.com.
_sip._tcp.example.com. 3600 IN SRV 10 20 5060 server2.example.com.
_sip._tcp.example.com. 3600 IN SRV 10 20 5060 server3.example.com.
_sip._tcp.example.com. 3600 IN SRV 20 0 5060 backup.example.com.

Step 1: Check priority

Clients use the records with the lowest priority value first. In this example, the three servers with priority 10 are tried before the backup server with priority 20.

Step 2: Apply weight

Among the three priority-10 servers, traffic is distributed by weight. main.example.com (weight 60) gets 60% of traffic. The other two (weight 20 each) get 20% each.

Step 3: Failover

If all priority-10 servers are down, clients fall back to backup.example.com (priority 20). This creates automatic failover without any manual intervention.

This two-level system gives you both load balancing (weight) and failover (priority) in a single DNS record type — something MX records can do with priority but not with weight-based load distribution.

4. Common Use Cases

ServiceSRV Record NameTypical Port
VoIP (SIP)_sip._tcp.example.com5060
Instant Messaging (XMPP)_xmpp-client._tcp.example.com5222
Microsoft 365 / Teams_sipfederationtls._tcp.example.com5061
Active Directory (LDAP)_ldap._tcp.example.com389
Minecraft Server_minecraft._tcp.example.com25565
CalDAV (Calendar)_caldavs._tcp.example.com443

SRV records are especially important in enterprise environments. Microsoft 365, for example, uses SRV records to help Outlook and Teams clients discover the correct server for federation and autodiscovery. Minecraft servers use SRV records so players can connect with a clean domain name instead of remembering an IP and port number.

5. How to Create a SRV Record

Most DNS providers have a form-based editor for SRV records. The key fields to fill in:

FieldExample ValueNotes
Name / Host_minecraft._tcpService and protocol with underscores
Priority00 for single server setups
Weight00 when no load balancing needed
Port25565The port your service runs on
Targetmc.example.comMust have an A or AAAA record
TTL36001 hour is a safe default

Tip: Some DNS providers combine the service and protocol into the Name/Host field (e.g., _minecraft._tcp), while others have separate fields for each. Check your provider's documentation if the form looks different from what you expect.

6. Common Mistakes

Pointing to a CNAME instead of an A record

The SRV target must resolve directly to an IP address via an A or AAAA record. Using a CNAME as the target violates the DNS specification and may cause resolution failures depending on the resolver.

Forgetting the underscore prefix

Both the service and protocol must start with an underscore: _sip._tcp, not sip.tcp. Without underscores, the record will not be found by clients querying for the service.

Wrong port number

Each service has a standard port (SIP uses 5060, XMPP uses 5222, Minecraft uses 25565). Using the wrong port means clients connect to the right server but the wrong service — or fail to connect entirely.

Missing A record for the target

If your SRV record points to sipserver.example.com but that hostname has no A record, the SRV lookup succeeds but the connection fails. Always ensure the target hostname resolves to an IP.

7. How to Check a SRV Record

# Using dig
dig _sip._tcp.example.com SRV +short
10 60 5060 sipserver.example.com.
# Using nslookup
nslookup -type=SRV _sip._tcp.example.com
# Verify the target has an A record
dig sipserver.example.com A +short
203.0.113.10

You can also use DNSFly's DNS Propagation Checker to verify your SRV records are resolving correctly across global DNS servers. Select SRV from the record type dropdown and enter the full service name (e.g., _sip._tcp.example.com).

Check Your SRV Records

Verify your SRV records are propagating correctly across 21 global DNS servers.

? Frequently Asked Questions