SRV Record: What DNS Service Records Are, Syntax, Priority, Weight, and Examples
An SRV record is a DNS resource record specifying the target hostname and network port of a service. Applications like VoIP SIP, Microsoft Teams, Active Directory, and Minecraft query SRV records automatically during connection setup. The priority and weight fields govern primary server failover and proportional load distribution.
What Is the Structure of an SRV Record? (The 7 Fields Explained)
An SRV record (Service Locator, IANA Type 33, standardized in RFC 2782) is the only traditional DNS resource record that includes a network port number (1 to 65535) alongside a target hostname, allowing applications to connect to non-standard ports without requiring users to type :port manually. Every SRV record uses an underscore-prefixed owner name (_service._proto.domain.com) followed by 4 data values: priority, weight, port, and target. The table below defines all 7 fields of a standard SRV record.
The following annotated BIND zone file excerpt demonstrates production SRV syntax across primary and backup endpoints:
; _service._proto.name. TTL Class Type Priority Weight Port Target Hostname
_sip._tls.example.com. 3600 IN SRV 10 60 443 sip1.example.com.
_sip._tls.example.com. 3600 IN SRV 10 40 443 sip2.example.com.
_sip._tls.example.com. 3600 IN SRV 20 100 443 sip-backup.example.com. | Field Name | Example Value | Valid Range / Format | Function in Service Discovery |
|---|---|---|---|
1. Service (_service) | _sip, _minecraft, _ldap | IANA symbolic name prefixed with underscore | Identifies the specific application protocol requesting discovery. |
2. Protocol (_proto) | _tcp, _udp, _tls | Transport protocol prefixed with underscore | Specifies the transport layer protocol used by the endpoint service. |
3. Domain Name (name) | example.com. | Standard domain or subdomain name | Sets the base domain name under which the network service operates. |
| 4. TTL & Class | 3600 IN SRV | Seconds (TTL), IN (Type 33) | Sets resolver caching duration (DNS TTL Explained) and IANA resource type. |
| 5. Priority | 10 | 16-bit unsigned integer (0 to 65535) | Determines failover rank where lower integers indicate higher preference (MX Record style). |
| 6. Weight | 60 | 16-bit unsigned integer (0 to 65535) | Distributes client connections proportionally among servers sharing identical Priority. |
| 7. Port & Target | 443 sip1.example.com. | Port 1-65535 plus canonical hostname | Specifies destination transport port (Common Network Ports) and resolving target hostname. |
The DNS specification mandates leading underscores for _service and _proto labels to prevent naming collisions with traditional hostnames. An owner name like _sip._tcp.example.com avoids overlapping with a conventional web host named sip.tcp.example.com, preserving namespace isolation. System administrators inspect live service records across international DNS checkpoints using our SRV Record Lookup.
How Do SRV Priority and Weight Work Together? (Failover vs Load Balancing)
Analyzing srv priority vs weight reveals a 2-stage selection process where Priority controls primary-to-backup failover tiers (lower numbers take precedence) and Weight controls proportional traffic balancing within the same tier (higher numbers receive more load). The resolution process completes across 4 sequential stages:
- Group all returned SRV records by their Priority value and order the groups from lowest integer to highest (Priority 10 first, Priority 20 second).
- Select only the servers in the lowest-numbered active tier (Priority 10 containing
sip1.example.comwith Weight 60 andsip2.example.comwith Weight 40), bypassing Priority 20 entirely while either Priority 10 host responds. - Calculate the sum of all Weight values inside that active Priority 10 tier (60 + 40 = 100) and distribute client connections proportionally:
sip1(Weight 60) receives 60 percent of traffic andsip2(Weight 40) receives 40 percent. - Fail over to the next tier (Priority 20 containing
sip-backup.example.com) only if both Priority 10 servers fail connection handshakes or time out.
RFC 2782 defines two special edge-case values for advanced routing. Assigning a Weight of 0 indicates that no proportional load balancing applies, instructing clients to select that server with a very low baseline probability alongside positive peers, or sequentially when all weights equal 0. Assigning a single period (.) to the Target field explicitly informs querying applications that the requested service is completely unavailable at the domain, instructing clients to abort connection attempts immediately without testing fallback hosts. Review broader infrastructure routing principles in our comprehensive guide to DNS Load Balancing.
6 Real-World SRV Record Examples (Microsoft 365, Autodiscover, Active Directory, and Minecraft)
Enterprise collaboration platforms, email clients, directory services, and gaming servers rely on standardized _service._proto SRV records to discover connection ports and endpoints automatically. The table below lists 6 production SRV record configurations with their standard service labels, ports, and target hostnames.
| Application / Service | _service._proto Owner Label | Priority | Weight | Port | Target Hostname Example |
|---|---|---|---|---|---|
| Microsoft Teams / Skype SIP | _sip._tls | 100 | 1 | 443 | sipdir.online.lync.com |
| Microsoft Teams Federation | _sipfederationtls._tcp | 100 | 1 | 5061 | sipfed.online.lync.com |
| Outlook / Exchange Autodiscover | _autodiscover._tcp | 0 | 0 | 443 | autodiscover.outlook.com |
| Minecraft Java Server | _minecraft._tcp | 0 | 5 | 25565 | mc-node1.example.com |
| Active Directory Domain Controller | _ldap._tcp.dc._msdcs | 0 | 100 | 389 | dc01.corp.example.com |
| XMPP / Jabber Federation | _xmpp-server._tcp | 5 | 0 | 5269 | xmpp.example.com |
The minecraft srv record and email Autodiscover configurations eliminate manual port entry for end users. Multiplayer hosts assigning non-standard ports like 25580 publish _minecraft._tcp.play.example.com with Port set to 25580, enabling gamers to join using simply play.example.com. In desktop messaging, mail clients query _autodiscover._tcp alongside mail submission records to detect IMAP and SMTP configurations automatically. Validate your domain's email discovery records using our dedicated Autodiscover / Autoconfig Checker.
What Are the 3 Strict Rules and Limitations of SRV Records?
DNS standards and client software enforce 3 strict operational rules on SRV records covering target hostname resolution, raw IP address prohibition, and standard web browser limitations:
- The Target Field Never Points to a CNAME Alias: RFC 2782 mandates that the target hostname of an SRV record points directly to a canonical domain name containing an A Record (IPv4) or AAAA Record (IPv6). Pointing an SRV target to a CNAME Record creates illegal nested alias chains that cause VoIP phones, email clients, and Active Directory authentication agents to reject the record.
- The Target Field Never Contains a Raw IPv4 or IPv6 Address: Entering a raw numeric IP address (such as
198.51.100.10) directly into the SRV Target field constitutes invalid syntax. Zone administrators create a dedicated A record first (such assip1.example.compointing to198.51.100.10, confirmed via our A Record Lookup) and assign that resolvable hostname as the SRV target. - Web Browsers Do Not Query SRV Records for HTTP or HTTPS Websites: Mainstream browsers (Chrome, Safari, Firefox, Edge) deliberately skip SRV lookups for standard web browsing. Web servers operating on custom ports like 8080 or 3000 still require visitors to type
:8080explicitly in the URL bar unless managed through an upstream proxy.
Administrators seeking to expose web applications running on port 3000 or 8080 over clean HTTPS URLs place a reverse proxy (such as NGINX, Apache, or Cloudflare Tunnel) in front of the application server to handle standard port 443 traffic. Modern web standards address service binding via dedicated SVCB (Type 64) and HTTPS (Type 65) records rather than legacy SRV records. Explore the characteristics of every resource record in our complete index of DNS Record Types.
How to Add an SRV Record in DNS Control Panels and Verify It (dig and nslookup)
DNS management interfaces structure SRV record forms across separate input boxes, requiring 4 configuration and verification steps to deploy service records cleanly across your authoritative DNS provider and terminal:
- Identify how your DNS control panel separates service labels: providers like Cloudflare, GoDaddy, and Namecheap offer distinct form fields for Service (enter
_sip), Protocol (select_tlsor_tcp), and Name / Host (enter@for root orplayfor a subdomain), whereas raw zone files and Route 53 accept the composite owner label_sip._tls.example.com.directly. - Populate the numerical Priority (
10), Weight (60), and Port (443or25565) fields, entering the destination hostname (sip1.example.com) into the Target field. - Query the specific service prefix from your command line using
digornslookup, remembering that querying the bare apex domain returns empty results because the record exists strictly under the_service._protonamespace:# Query SRV record on Linux / macOS (specify _service._proto): dig _sip._tls.example.com SRV +short # Query SRV record on Windows Command Prompt: nslookup -type=srv _sip._tls.example.com 1.1.1.1 - Confirm that global nameservers return uniform SRV answers using our worldwide DNS Propagation Checker.
Executing these diagnostic queries validates accurate service discovery from recursive resolvers down to client endpoints. Maintaining correct SRV record configurations ensures smooth operation for VoIP SIP networks, Microsoft Teams federations, email autodiscovery routines, and multiplayer gaming clusters across the internet.
Frequently asked questions
What is the difference between Priority and Weight in an SRV record?+
Priority controls failover order (clients always try the server with the lowest Priority number first and only use higher numbers as backups). Weight controls load balancing among servers that share the exact same Priority number (a higher Weight receives a larger percentage of traffic).
Why does my SRV lookup return empty when I query my domain name?+
An SRV record is never published on the bare root domain (example.com); it always lives under the _service._proto prefix (such as _sip._tls.example.com or _minecraft._tcp.example.com). Always include the full _service._proto.domain.com string when running an SRV lookup.
Can I use an SRV record to hide a port number (like :8080) on a website?+
No, in practice web browsers (Chrome, Safari, Firefox, Edge) do not check SRV records when loading http:// or https:// URLs. Deploying an NGINX reverse proxy or Cloudflare Tunnel in front of the server routes standard port 443 traffic to backend port 8080 or 3000 without showing the port number.
Why is my DNS provider rejecting my SRV record with a syntax error?+
In real-world setups, most SRV control panel errors happen for one of two reasons: either missing the leading underscore on _service and _proto (writing sip instead of _sip), or typing an IP address in the Target box instead of a hostname that resolves to an A record.
Last verified: 2026-11-05