What is an SRV record used for?
How SRV records work
SRV records are named with the service and protocol, such as _sip._tcp or _xmpp-client._tcp, followed by your domain. Each record lists a priority, a weight for load sharing, the port number, and the target host name. Clients that support SRV look up these records before connecting.
Many services use SRV records, including some voice, messaging, and game platforms. Web browsers generally do not use them, which is why websites rely on A and CNAME records instead.
- Name format includes service and protocol
- Fields are priority, weight, port, and target
- Lower priority values are tried first
Setting one up
Get the exact service name and format from the software's documentation, since small mistakes will stop it from working. Create the record, then test it with a lookup tool that can query SRV records.
If the service also needs a valid certificate, make sure the target host name matches the certificate name.
SRV records do not replace A records, so the target host still needs a normal address record. Clients that do not understand SRV will skip the lookup and use the default port. Check the software's default port and whether it allows a custom port in its settings.
Common mistakes
- Guessing the service name instead of copying it from the docs.
- Pointing the target at an IP address when the service expects a host name.
