Applies to: DNS records in cPanel Zone Editor, Cloudflare and other DNS providers
An SRV record tells programs which server and port provide a service for a domain. Normal A records only give an IP address; SRV adds the port and a priority. Programs that support SRV look it up automatically, for example VoIP (SIP) phones, chat servers (XMPP), Microsoft Teams and Skype for Business setups, email auto-configuration, and Minecraft: Java Edition.
The parts of an SRV record
_service._protocol.name. TTL IN SRV priority weight port target _sip._tls.example.com. 3600 IN SRV 10 60 5061 sip.example.com.
- Service and protocol: for example
_sip._tls,_xmpp-client._tcpor_minecraft._tcp. - Priority: lower numbers are tried first.
- Weight: shares traffic between servers with the same priority.
- Port: the port the service listens on.
- Target: the host name of the server, which needs its own A record. It can’t be an IP address.
Example: Minecraft on a custom port
Minecraft Java players normally have to type play.example.com:25566 when your server runs on another port. With an SRV record they just type play.example.com:
mc.example.com. IN A 203.0.113.30 _minecraft._tcp.play.example.com. IN SRV 0 5 25566 mc.example.com.
Minecraft: Bedrock Edition doesn’t use SRV records, so Bedrock players still enter the port.
Add it in cPanel
- Open Domains › Zone Editor and click Manage next to the domain.
- Click Add Record and choose type SRV.
- Name:
_minecraft._tcp.play.example.com.Fill in Priority (0), Weight (5), Port (25566) and Target (mc.example.com). Save.
At Cloudflare and many other providers, the SRV form has separate fields for the service (_minecraft), protocol (TCP) and name (play).
Check it
dig +short SRV _minecraft._tcp.play.example.com nslookup -type=SRV _minecraft._tcp.play.example.com
We tested these records on a BIND 9 DNS server: the query returned 0 5 25566 mc.example.com.. After a change, allow time for the TTL to pass, and flush your DNS cache if your computer still sees the old answer.
Hosting a Minecraft server: Minecraft server on Linux. Other record types in cPanel: add a CNAME record.
Ucartz services for this topic
- Web hosting: shared hosting on Virtualmin with NVMe storage, free SSL and email.
- SSL certificates: DV, OV and wildcard, with free installation help.
- Reseller hosting: white-label cPanel hosting for your own clients.
