DNS does more than connect domain names to IP addresses. It also helps applications locate the exact servers and ports required for specific services. This is where SRV records come into play. SRV (Service) records allow services like SIP, XMPP, LDAP, and email systems to identify the correct server and communication port automatically. In this blog, we’ll explain what SRV records are, how they work, their structure, and why they are important in modern network environments.
What is an SRV Record?
An SRV (Service) record is a type of DNS record used to identify the hostname and port number of servers that provide specific services. It helps applications locate the correct server for a requested service automatically.
SRV records are defined in RFC 2782 and use DNS type code 33. They are commonly used by internet protocols such as SIP, XMPP, LDAP, and other communication services that require service discovery.
SRV Record Format
An SRV record follows this structure:
_service._protocol.name TTL class SRV priority weight port target
Example SRV Records
_sipfederationtls._tcp 3600 IN SRV 1 100 5061 sipfed.example.com.
_sip._tcp 3600 IN SRV 1 100 443 sipdir.example.com. Components of an SRV Record
1. Service
The service field defines the symbolic name of the service.
Common examples include:
_http– Web service_ftp– File Transfer Protocol_ldap– LDAP directory service_imap– IMAP mail service_sip– SIP communication service_PKIXREP– PKIX Repository service
2. Protocol
This field specifies the transport protocol used by the service.
Common values are:
_tcp– TCP protocol_udp– UDP protocol
3. Name
The domain name for which the SRV record is valid.
4. TTL
TTL (Time To Live) determines how long DNS resolvers cache the record before requesting an update again.
5. Class
This is usually set to IN, which stands for Internet.
6. Priority
The priority field determines which server should be used first.
- Lower values indicate higher priority.
- Similar to MX record priority handling.
Example:
A server with priority 1 is preferred over a server with priority 10.
7. Weight
Weight is used for load balancing between servers with the same priority.
- Higher weight values receive more traffic.
- A value of
0means no weighting preference.
8. Port
Specifies the TCP or UDP port number where the service is available.
Examples:
80for HTTP443for HTTPS5061for secure SIP communication
9. Target
The target field contains the canonical hostname of the server providing the service.
Why Are SRV Records Important?
SRV records help applications automatically discover the correct server and port for specific services. This improves flexibility, scalability, and load balancing in network environments.
They are widely used in:
- VoIP and SIP services
- Microsoft services
- XMPP chat applications
- LDAP authentication
- Email and collaboration platforms
Conclusion
SRV records play an important role in DNS by directing applications to the appropriate server and port for a service. Understanding how SRV records work helps administrators configure communication services, improve reliability, and manage traffic efficiently across multiple servers.
If you require help, contact SupportPRO Server Admin

