SRV records are DNS records used to tell applications which server provides a specific service, which protocol to use, and which port to connect to. They are commonly used for services such as Microsoft 365, SIP, XMPP, LDAP and other systems that need more than a simple hostname-to-IP lookup.
Unlike an A record or CNAME record, an SRV record does not usually point users to a website. Instead, it helps software automatically discover the correct destination for a service. This is important when a service runs on a non-standard port, when multiple servers provide the same service, or when a priority and weighting system is needed for failover and load distribution.
An SRV record can look technical at first, but each part has a specific purpose. Understanding how SRV records work makes it much easier to configure services correctly and troubleshoot connection problems.
What an SRV record does
An SRV record publishes service connection details in DNS. When an application supports SRV lookups, it can query DNS for a named service and receive the hostname and port number it should use.
This allows administrators to separate service configuration from the application itself. Instead of manually entering a server and port into every device or client, the client can often discover the correct settings automatically.
SRV records are especially useful when:
* A service uses a port other than the default port
* More than one server can provide the same service
* A primary server and backup server need to be defined
* Client software supports automatic service discovery
How an SRV record is structured
An SRV record contains several fields that work together.
* Service: The symbolic service name, such as _sip or _autodiscover
* Protocol: Usually _tcp or _udp, depending on the service
* Name: The domain the service applies to
* Priority: The order in which target servers should be tried. Lower numbers are preferred first.
* Weight: The relative preference between records that have the same priority. Higher values are more likely to be selected.
* Port: The port number the service listens on
* Target: The hostname of the server providing the service
A common written format is:
_service._protocol.example.com. priority weight port target.example.com.
For example:
_sip._tcp.example.com. 10 60 5060 sipserver.example.com.
In this example:
* The service is SIP
* The protocol is TCP
* Clients should connect on port 5060
* The target server is sipserver.example.com
* The priority and weight help decide which server should be used if multiple records exist
When SRV records are used
SRV records are used by many business and communications platforms. Common examples include:
* Microsoft services such as some domain verification and service discovery processes
* VoIP and SIP phone systems
* XMPP chat services
* Directory services such as LDAP
* Game and application services that need client discovery
Not every application supports SRV records. If a service does not explicitly support SRV lookups, adding an SRV record will not affect how that service connects.
Before you add or change an SRV record
Before creating an SRV record, make sure you have:
* Access to manage DNS for your domain
* The exact SRV values provided by your software vendor or service provider
* The correct target hostname already created in DNS if required
* Confirmed whether the service uses TCP or UDP
* Confirmed the correct priority, weight and port values
It is important to enter SRV records exactly as supplied. A small mistake in the service name, protocol, target hostname or port can stop the service from working.
How to add an SRV record
The exact interface can vary depending on where your DNS is hosted, but the process is usually similar.
1. Log in to the DNS management area for your domain.
2. Open the DNS zone or DNS records section for the domain you want to update.
3. Choose the option to add a new DNS record.
4. Select SRV as the record type.
5. Enter the service value, such as _sip or _autodiscover.
6. Enter the protocol value, such as _tcp or _udp.
7. Enter the name or host value if your DNS platform asks for it separately.
8. Enter the priority value provided by your service vendor.
9. Enter the weight value provided by your service vendor.
10. Enter the port number for the service.
11. Enter the target hostname that provides the service.
12. Save the record.
13. Allow time for DNS changes to propagate.
[Screenshot: DNS editor showing SRV record fields]
Some DNS providers combine the service, protocol and name into one host field, while others split them into separate fields. Always follow the format required by your DNS control panel.
Example SRV record values
Different providers present SRV record values in different ways, but the underlying information is the same.
Example format using separate values:
* Service: _sip
* Protocol: _tcp
* Name: example.com
* Priority: 10
* Weight: 60
* Port: 5060
* Target: sipserver.example.com
Example format using a combined host field:
* Host: _sip._tcp.example.com
* Priority: 10
* Weight: 60
* Port: 5060
* Target: sipserver.example.com
If your provider gives you a trailing full stop at the end of the target hostname, your DNS platform may add it automatically or may accept it as entered. Follow the expected format of your DNS host.
Best practices for SRV records
* Use the exact values supplied by your provider
* Double-check spelling, underscores and port numbers
* Make sure the target hostname resolves correctly in DNS
* Keep related DNS documentation for future reference
* Remove outdated SRV records if they are no longer required
* Allow for DNS propagation time before testing from multiple networks
Where multiple SRV records exist for the same service, ensure the priority and weight values match the design recommended by your provider. Incorrect values can cause uneven behaviour or failover issues.
Troubleshooting SRV records
The service cannot be discovered
This is often caused by an incorrectly entered service name, protocol, target or port.
Check that:
* The service begins with an underscore
* The protocol begins with an underscore
* The target hostname is valid and resolves in DNS
* The record has been added to the correct DNS zone
* Enough time has passed for DNS propagation
The target server is correct but the application still does not connect
The application may not support SRV lookups, or the service may require additional records or configuration.
Review the vendor documentation to confirm that:
* The application supports SRV-based service discovery
* The required port is open and listening on the destination server
* Any related A, AAAA, CNAME, TXT or MX records have also been configured where needed
Multiple SRV records are behaving unexpectedly
If several SRV records exist for the same service, incorrect priority or weight values may cause clients to connect in an unexpected order.
Compare all records carefully and confirm that the values match the intended primary, backup or load-sharing design.
Frequently asked questions
What is the difference between an SRV record and an A record?
An A record maps a hostname to an IPv4 address. An SRV record tells a client which server provides a specific service and which port to use.
Do SRV records affect website traffic?
Usually no. SRV records are generally used by specific applications and services rather than standard website browsing.
Can I use an IP address as the SRV target?
No. The target of an SRV record should be a hostname, not a raw IP address.
How long does an SRV record take to work?
Changes can sometimes work quickly, but global DNS propagation may take time depending on TTL values, caching and the DNS provider.
Related Articles
What is DNS?
DNS Propagation Explained
A Record vs CNAME Record
How to Manage DNS Records
Need More Help?
If you require further assistance, please contact Apexhost Support at support@apexhost.com.au.
