SRV records: what they are for, and how to create one

An A record says where a machine is. An SRV record says more: which machine, on which port, and in what order answers for a service on your domain. It is the record a mail client, a calendar app or a voice system looks up when it wants to configure itself without anyone typing a server name.

If you have not read the round-up of record types yet, start there: DNS records explained. This article is only about SRV, which is the one that usually comes out wrong.

Half the record lives in the name

This is where nearly everyone trips. The zone editor has no field called service and no field called protocol: both are written inside the name, always in this order.

Part of the name What it is
_service The service name, always starting with an underscore. Do not invent it: whoever asks you for the record tells you what it is. Real examples: _autodiscover, _caldav, _sip.
_protocol Almost always _tcp. Some services ask for _udp or _tls. It carries an underscore too.
the domain The panel appends it for you. The finished name looks like _autodiscover._tcp.yourcompany.com.
Without the underscores the record is useless. An autodiscover._tcp with the leading underscore missing saves without complaint, sits in the zone, and no program ever finds it. It is the number one cause of "I created the SRV and nothing happens".

The four fields, and what goes in each

After the name, the cPanel zone editor asks for four values. All four are required, and none of them accepts a number above 65535.

Field What it means, and what to put there
Priority The order things are tried in. Lower goes first. With a single server, 0 is fine. You only use more than one value when there is a fallback server, and the fallback gets the higher number.
Weight Only matters between records of equal priority: it splits the traffic between them, and the larger weight takes more. With one server, 0.
Port The port the service listens on. Never guess it: it comes from whoever asked for the record. A wrong port gives you a service that "connects and never answers".
Target The name of the machine that answers, which must have an A or AAAA record of its own. It cannot be an IP address, and it should not point at a name that is itself a CNAME.

A real case: the SRV records your zone already has

This is not theory. When the domain is hosted with us and uses our nameservers, cPanel has already created five SRV records in your zone. They are what makes automatic setup of mail, calendars and contacts work when you type nothing but an address and a password on your phone. Open the zone editor and look:

Name Priority / Weight / Port Target
_autodiscover._tcp 0 / 0 / 443 a discovery service run by cPanel itself, which hands the program the right settings for your account
_caldav._tcp 0 / 0 / 2079 your domain (calendars, unencrypted)
_caldavs._tcp 0 / 0 / 2080 your domain (calendars, encrypted)
_carddav._tcp 0 / 0 / 2079 your domain (contacts, unencrypted)
_carddavs._tcp 0 / 0 / 2080 your domain (contacts, encrypted)
Notice the pattern. Priority and weight are zero because there is only one server; the port changes with the service; the target is always a name, never an IP. That is exactly what you will write when you create your own.
Do not delete these five. Remove them and mail still arrives, but automatic setup on phones and calendar apps stops finding the settings, and everything has to be typed in by hand again.

Creating an SRV record in cPanel

1 Open cPanel from My MozOut and look for Zone Editor. Next to the domain, click Manage.
2 Click Add Record and pick the type SRV.
3 In Name, type _service._protocol, underscores included. The panel completes it with your domain. Check that the finished name ends in the right domain.
4 TTL is in seconds and can stay as it comes. If you are experimenting, lower it beforehand and raise it again afterwards: how TTL works.
5 Fill in Priority, Weight, Port and Target with the values the service gave you, then Save Record.

If the domain does not use our nameservers, the record has to be created in the panel that holds them, not here. Check where they point first: what nameservers are and which to use. If they are at Cloudflare, that is where you go: what changes with Cloudflare.

How to check it from outside

The only proof that counts is the one taken from outside. Swap in your own name:

System Command
Windows nslookup -type=SRV _autodiscover._tcp.yourcompany.com at the command prompt
macOS or Linux dig SRV _autodiscover._tcp.yourcompany.com +short in Terminal

The answer comes back with the four values in the same order as the form: priority, weight, port, target. If nothing comes back, either it was written somewhere else, or it has not propagated yet: how long propagation takes.

If the service hands you the line already written, something like _sip._tcp.yourcompany.com. 3600 IN SRV 10 5 5060 voice.yourcompany.com., read it left to right after the SRV: priority, weight, port, target. Those are the four form fields, in that order.

Send us the SRV line you were asked for, or just tell us which service you are trying to set up. We will create the record.

Open a support ticket

SEE ALSO

Frequently asked questions

Professional e-mail

Hosting plans

RECOMMENDED PRODUCT

Web hosting with cPanel

Domain and SSL included, daily backups and the panel you already know. from KSh1,300.00/mo

See plans
  • 0 Users Found This Useful
Was this answer helpful?