Blog · WebJi® India

What Are SRV Records

Quick answer: An SRV record is a DNS record that names the host and port for a service, plus the priority and weight a client uses to choose between servers. One line reads _sip._tcp.example.com. 3600 IN SRV 10 60 5060 sipserver.example.com. The target must point to an A record.
✓ In business since 2005✓ INR + GST billing✓ 24/7 Email Support — avg reply < 60 min
Warm modern Jaipur office interior with jaali lattice screens and an Indian team at work — what are srv records

What an SRV record is

An SRV record is a DNS record that publishes the host and port where a named service runs, with a priority and weight the client uses to pick between servers. It is typed as _service._proto.name and carries record type 33. Where an A record answers "which IP", an SRV record answers "which host, which port, and which one first".

One line, with every field in place:

FieldExampleWhat it means
Name_sip._tcp.example.com.service and transport, then the domain
TTL3600seconds a resolver may cache the answer
Class and typeIN SRValways these two words
Priority10lower is tried first
Weight60share of traffic among equal priorities
Port5060where the service listens on the target
Targetsipserver.example.com.hostname with an A or AAAA record

Put together: _sip._tcp.example.com. 3600 IN SRV 10 60 5060 sipserver.example.com. The trailing dots matter in a zone file; in a control panel they are added for you.

Priority, weight, port and target, field by field

Priority is the first decision and weight is the second. Clients sort all answers by priority, try the lowest number, and only fall to the next priority when the first set fails. Weight then decides how traffic is split across records that share a priority.

RecordPriorityWeightRole
bigbox.example.com1060main server, 60% of new sessions
smallbox1.example.com1020second choice, 20%
smallbox2.example.com1020third choice, 20%
backupbox.example.com200used only when all three above fail

The three priority-10 records share 100 weight points, so each new session lands 60, 20 or 20 percent of the time. If the whole group stops answering, the client moves to the priority-20 record. The port can differ per record, which is how one domain can run services on 5060 and 5061.

The target must resolve to an A or AAAA record. Pointing it at a CNAME is invalid and clients may ignore the record without an error you can see.

What SRV records are used for

SRV records exist for services that need a port and a preference order, which is most real-time and directory protocols.

ServiceRecord nameUsual port
SIP telephony_sip._tcp or _sip._udp5060
XMPP chat_xmpp-client._tcp5222
Active Directory_ldap._tcp.dc._msdcs389
Mail submission_submission._tcp587
Minecraft server_minecraft._tcp25565

Windows domain controllers publish _ldap and _kerberos records under _msdcs so that a joining PC can find the nearest controller, as Microsoft's own verification guide describes. Mail clients use _submission and _imap records to discover ports instead of hard-coding them.

Add an SRV record in cPanel

On cPanel hosting the record is added in the zone editor, not in the email section. The domain must use the hosting account's name servers; if it uses a registrar's DNS, edit it there instead with the same six fields.

  1. Open cPanel, then Zone Editor, and click Manage next to the domain.
  2. Click Add Record and choose SRV from the type list.
  3. In Name type the service and transport, for example _sip._tcp. The panel appends the domain; check the preview line before saving.
  4. Set TTL to 3600, Priority to 10, Weight to 60 and Port to 5060.
  5. Set Target to the server hostname, for example sipserver.example.com. It must already have an A record.
  6. Save the record and wait for the TTL window before you test in a client.

Domains bought through domain registration can point at these name servers in the same panel, so the record and the domain stay in one place.

Check the record with dig or nslookup

Two commands cover every desktop. Run them from a terminal, not from the cPanel preview.

  1. dig +short SRV _sip._tcp.example.com returns four values: priority, weight, port and target.
  2. On Windows, run nslookup, then set type=SRV, then _sip._tcp.example.com.
  3. Read the answer: it should show the same numbers you entered, such as 10 60 5060 sipserver.example.com.

You know it worked when the query returns that line rather than an empty answer. Four failures cover most cases: the target is a CNAME, the name was typed without underscores, the port was left at 0, or the old answer is still cached for the length of the previous TTL.

If the answer is empty and the record looks right, ask support@webji.services with the domain, the record name and the command output. The desk answers 24/7 in Hindi and English; the knowledgebase has the DNS screens for each panel.

SRV versus MX, A and CNAME

The four records answer different questions, and mixing them up is why some SRV edits never work.

  • A record: this name is this IPv4 address. Nothing about ports.
  • AAAA record: the same for IPv6.
  • CNAME: this name is an alias of that name. Valid for websites, invalid as an SRV target.
  • MX: mail for this domain goes to that host, with a preference number. No port.
  • SRV: this service runs on that host and port, in this order. The only one of the five that carries a port.

An SRV record does not serve web traffic and does not make a website faster. If a page is slow, the fix is elsewhere; name servers and DNS resolution only decide where the request goes.

Frequently Asked Questions

What is an SRV record used for?

It tells a client which host and port run a named service, and which server to try first. SIP phones, XMPP chat, Active Directory, mail submission clients and game servers use it. A website does not need one.

What do priority and weight mean in an SRV record?

Priority sorts records; the lowest number is tried first and higher numbers act as backups. Weight splits traffic between records that share a priority, so weights of 60, 20 and 20 send 60, 20 and 20 percent of new sessions to those three hosts.

How do I add an SRV record in cPanel?

Open Zone Editor, click Manage next to the domain, then Add Record and choose SRV. Enter the service name such as _sip._tcp, a TTL of 3600, the priority, weight, port and target hostname, then save. The domain must use the hosting name servers.

Why is my SRV record not working?

Four causes cover most cases: the target is a CNAME instead of an A record, the name is missing its underscores, the port is still 0, or an older answer is cached for the previous TTL. Run dig +short SRV on the exact name and compare the four values.

Does Microsoft 365 need SRV records?

Not for mail in most tenants, where an Autodiscover CNAME does the work. SRV records appear for Skype for Business and for directory services on Windows Server. Add them only when the service you are configuring publishes the exact record to create.

How is SRV different from MX?

MX points mail at a host and gives a preference number, with the port fixed by the protocol. SRV names a host, a port and a priority, so it can move a service to a non-standard port. Mail submission can use either, depending on what the provider publishes.

Need help with this?

WebJi® support does it for you — free. Talk to our Jaipur team →