SRV record: format, uses and how to set one up
Published on June 19, 2026 8 min read
An SRV record points services such as VoIP, chat or a game server to the right server and port. Learn how an SRV record works and how to set one up.
An SRV record (service record) tells programs where to reach a particular service: not only which server, but also which port. Where an A record maps a name to an IP address, an SRV record maps a service such as VoIP calling, chat, or a game server to both a hostname and a port number. This article explains how an SRV record is structured, how priority and weight work, which services use it, and how to set one up and check it yourself.
What is an SRV record?
SRV stands for service, and it is a type of DNS record that describes where a network service lives. The record links a service to a combination of a hostname and a port, so an application automatically knows where to connect. It was defined in RFC 2782 in 2000 and carries the official DNS type number 33.
The difference from other records matters. An A or AAAA record only returns an IP address. An MX record points mail to a server, but it cannot specify a port and applies only to email. An SRV record can do both: it includes a port number and works for many kinds of services. That lets a VoIP phone, a chat client, or a game client configure itself without you having to type in a server address and port by hand.
What does an SRV record look like?
An SRV record has a fixed shape. The name on the left has three parts, and the value on the right has four fields:
_service._protocol.domain. TTL IN SRV priority weight port target
_sip._tcp.example.com. 3600 IN SRV 10 20 5060 sip.example.com.
The name is written as _service._protocol.domain. The first part is the service, preceded by an underscore, for example _sip or _xmpp-client. The second part is the transport protocol, almost always _tcp or _udp, again with a leading underscore. The underscores keep these labels from clashing with regular hostnames. The domain that the rule applies to comes last.
The value of the record consists of four fields, in this order:
| Field | Range | Meaning |
|---|---|---|
| Priority | 0 to 65535 | Which server is tried first. A lower number wins. This is how you set up failover to a backup server. |
| Weight | 0 to 65535 | How traffic is split between servers with the same priority. A higher weight receives proportionally more connections. This is how you set up load balancing. |
| Port | 0 to 65535 | The TCP or UDP port the service runs on. This is what makes an SRV record special: it can point to a non-standard port. |
| Target | hostname | The full name of the server that provides the service. This must be a hostname with an A or AAAA record, not an IP address and not an alias. |
In the example above, a SIP phone looks up the service _sip._tcp for example.com and finds the server sip.example.com on port 5060, with priority 10 and weight 20.
Priority and weight: how a client picks a server
You can place several SRV records under the same name, for example for two or more servers. The application then chooses one of them using two rules.
First, the client looks at the priority. The records with the lowest number are tried first. Only when those cannot be reached does the client move on to the next priority. That is how you build failover: put your main server at priority 10 and a backup at priority 20.
When two records share the same priority, the weight decides the split. Weight works proportionally: a server with weight 60 receives roughly three times as many connections as a server with weight 20. That is how you spread the load across several servers. A weight of 0 gives a server only a small chance of being chosen while other servers with the same priority and a higher weight are available.
Common SRV records
Not every service uses SRV records, but several well-known applications do. The names and default ports are usually fixed:
| Service | Example name | Default port |
|---|---|---|
| VoIP and SIP calling | _sip._udp or _sip._tcp | 5060 (encrypted _sips._tcp on 5061) |
| Chat over XMPP or Jabber | _xmpp-client._tcp and _xmpp-server._tcp | 5222 and 5269 |
| Email autoconfiguration (Autodiscover) | _autodiscover._tcp | 443 |
| Minecraft (Java Edition) | _minecraft._tcp | 25565 (or a custom port) |
On top of that, Microsoft Active Directory (with services such as LDAP and Kerberos), calendar and contact syncing (CalDAV and CardDAV), and some mail clients for automatic setup all rely on SRV records. The idea is always the same: the user only enters a domain, and the software discovers the right server and port on its own.
Important rules and pitfalls
A few rules from RFC 2782 prevent the most common mistakes:
- The target must be a hostname that has its own A or AAAA record. Never enter an IP address, and do not let the target point to a CNAME record (an alias).
- The port belongs in the record itself, in the port field, not in the target. The target is only the server name.
- A target that consists of a single dot, written as
., means the service is deliberately not available at this domain. - An SRV record works only for programs that explicitly look for one. Web browsers do not: you reach a website through an A or AAAA record, never through an SRV record.
That last point is a common source of confusion. You cannot send a website to a different port with an SRV record, because browsers never query for one. SRV records exist for services like VoIP, chat, game servers, and automatic mail setup.
Setting up an SRV record with LJPc hosting
Where you add an SRV record depends on your package. If your domain comes with a hosting package, you manage your DNS records in Plesk. If you only have DNS management with LJPc, you do it in the customer portal. Which route applies to you is explained in managing DNS records. Your records only work if your domain uses the LJPc nameservers; how that works is explained in NS record explained.
In the customer portal
- Log in to the customer portal, open the Services menu, choose Domains and open your domain.
- Under DNS records, click Add record and choose SRV under Type.
- Under Name, enter the service and protocol in the form
_service._protocol, for example_sip._tcp. You do not need to add your domain name after it. - Fill in Priority, Weight, and Port, each a number from 0 to 65535.
- Under Target host, enter the full hostname of the server, for example
sip.example.com. The portal does not accept an IP address or a single dot: you then get the message Invalid hostname. Do not choose an alias as the target host either, because the standard requires it to have its own A or AAAA record. - Leave TTL at 3600 seconds or choose a value between 60 and 86400, and click Save.
In Plesk
In Plesk, go to Websites & Domains, click the Hosting & DNS tab of your domain and then DNS. Then click Add Record. Choose SRV under Record type. Plesk asks for the name in separate parts and adds the underscores itself:
- Service name: the service without the underscore, for example
sip. - Protocol: the protocol without the underscore, for example
tcporudp. - Domain name: leave this empty if the record is for your main domain. Only fill it in if the record belongs to a subdomain.
- Target host: Plesk fills in a single dot by default. Replace it with the full hostname of the server.
- Target port: the port the service runs on.
- Priority and the weight (Relative weight for records with the same priority) are chosen from a list from 0 to 50, in steps of 5. Only the order and the ratio between records count. If a service asks for a value that is not in the list, for example priority 100, and you put only one record under that name, any value works.
Save the record. If Plesk then shows a notice above the list that your changes are not saved yet, click Update. Only then does the record actually go into your DNS zone.
For your email, a hosting package with LJPc already includes an SRV record: _autodiscover._tcp, which points to autodiscover.ljpc.email on port 443. It lets Outlook find the settings for your mailbox automatically. Leave that record in place. How to set up your email further is explained in setting up your email on your phone, tablet and computer.
If you are not sure which values to enter, check the documentation of the service you are setting up: it lists the correct service name, protocol, and port.
Checking an SRV record
After saving, you can look up an SRV record to confirm it is correct. Use the full name, including the service and protocol parts:
# macOS and Linux
dig SRV _sip._tcp.example.com +short
# Windows
nslookup -type=SRV _sip._tcp.example.com
The answer shows the priority, weight, port, and target. At LJPc, a new or changed record usually reaches our name servers within a minute. To see that right away, query one of our name servers directly, for example with dig SRV _sip._tcp.example.com @ns1.ljpc.network +short. Servers that still have the old value in their cache only see the change once the TTL expires, which at LJPc is usually after an hour. Read more in DNS propagation.
Still stuck? Create a support ticket and we will look into it with you.
Frequently asked questions
What is the difference between an SRV record and an A record?
An A record maps a name to an IP address and says nothing about a port or a service. An SRV record maps a specific service to a hostname and a port, and it can also carry a priority and weight for failover and load balancing. The target of an SRV record usually points to a name that has its own A or AAAA record.
Can the target of an SRV record be an IP address or a CNAME?
No. The target must be a hostname that has its own A or AAAA record. An IP address is not allowed, and neither is a pointer to a CNAME record (an alias). If you want to link an IP, give the target its own A or AAAA record.
Why does my website not work through an SRV record?
Because web browsers do not query SRV records. You always reach a website through an A or AAAA record on the right name. SRV records are meant for services such as VoIP, chat, game servers, and automatic email setup, not for web traffic.
What do priority and weight mean?
Priority sets the order: the record with the lowest number is tried first, and the rest act as failover. Weight splits the traffic between records that share the same priority, where a higher weight receives proportionally more connections.
How do I check an SRV record?
Look the record up using its full name. On macOS or Linux, use dig SRV _sip._tcp.example.com +short; on Windows, use nslookup -type=SRV _sip._tcp.example.com. Replace the name with the one for your service. The answer shows the priority, weight, port, and target.
How long before an SRV record works?
At LJPc, a new or changed record usually reaches our name servers within a minute. Servers that still have the old value in their cache only see the change once the TTL expires, which at LJPc is usually after an hour.
Where do I set up an SRV record with LJPc?
If your domain comes with a hosting package, you add the record in Plesk, under DNS Settings for your domain. If you only have DNS management with LJPc, you do it in the customer portal on your domain's page, with the Add record button.
Do I need to create an SRV record for my email myself?
No. A hosting package with LJPc already includes the _autodiscover._tcp record, which points to autodiscover.ljpc.email on port 443. It lets Outlook find the settings for your mailbox automatically. Leave that record in place.