Table of Contents
A DNS SRV record tells a compatible application which hostname and port to use for a named service. For example, a SIP client can look up _sip._tcp.example.com to find the SIP server for example.com. The client must support SRV discovery for that service.

SRV record syntax and example
_sip._tcp.example.com. 3600 IN SRV 10 0 5060 sip1.example.com.
- Name:
_sip._tcp.example.com.combines the service, transport protocol, and domain. Both service and protocol have leading underscores. - TTL:
3600is the cache lifetime in seconds.INis the Internet DNS class. - Priority:
10is tried before a higher number such as20. - Weight:
0works when there is one target at that priority. For multiple targets at the same priority, larger weights make a target more likely to be selected. Use separate priorities for primary and backup hosts. - Port:
5060is the port the client should connect to in this example. - Target:
sip1.example.com.is a hostname with its own A or AAAA record. Use neither an IP literal nor a CNAME alias as the target.
SRV supplies the endpoint name and port. Address records supply the IP address. See the DNS basics lesson for how that separate lookup works.
Add the record in your DNS control panel
- Open the DNS zone at the provider that hosts your authoritative nameservers and create an SRV record.
- Enter the service, protocol, and domain name supplied by your service provider. Some panels want
_sip._tcpas the record name and append the zone automatically. Others have separate fields or ask for the full name. - Enter the documented priority, weight, port, and target. Make sure the target has the correct address record and the server is listening on the specified port.
- Save and test the exact name your application queries.
Verify the result
dig +short SRV _sip._tcp.example.com
nslookup -type=SRV _sip._tcp.example.com
The first command should return the priority, weight, port, and target in that order. For more Windows examples, see how to use nslookup for DNS troubleshooting.
If the answer is empty, check the service and protocol prefixes and look for a duplicated zone name. Query an authoritative nameserver directly if you need to distinguish a DNS configuration error from an older cached answer. If the SRV result is correct but the application fails to connect, resolve the target hostname and check whether the application supports SRV and can reach the published port.
For the record format and target selection rules, see RFC 2782.
Reader Comments 0
Sign in with email or Google to join the discussion.