A subdomain is easier to remember than an IP and stays the same if the server moves. This guide uses Cloudflare, but the steps are the same with any DNS provider.
-
Find the server IP and port
They are on the server page in the game panel. You will use them in the next steps.
-
Create the A record
In Cloudflare open DNS → Records and add:
Type Name Content Proxy A playSERVER_IPDNS only (grey cloud) The proxy must be off. Cloudflare only proxies web traffic, not game traffic.
-
Add the port if needed
If the server uses the game's default port, you are done: players type just
play.yourdomain.com. If the port is different, pick your game below.
The port, by game
Minecraft Java reads the port from an SRV record, so players do not need to type it. Add in Cloudflare:
| Field | Value |
|---|---|
| Type | SRV |
| Name | _minecraft._tcp.play |
| Priority | 0 |
| Weight | 5 |
| Port | your server port, for example 25570 |
| Target | play.yourdomain.com |
Players join with play.yourdomain.com.
Players type in the F8 console:
connect play.yourdomain.com:30120Replace 30120 with your port if it is different.
Most games do not read SRV records. Players type the name and port together, for example play.yourdomain.com:27016. On the game's default port the name alone is enough.
Troubleshooting
The name does not work, but the IP does
Check that the A record is set to DNS only. With the orange cloud, game traffic never reaches the server.
Minecraft still asks for the port
Check the record with nslookup -type=SRV _minecraft._tcp.play.yourdomain.com. The name must start exactly with _minecraft._tcp., and the target must be a name with an A record, not an IP.