Use your own domain
Point play.example.com at the right address with A, AAAA, CNAME or SRV.
On this page
What a domain doesThe record typesA direct Java serverA non-default Java port with SRVCNAME with a tunnelCloudflare DNS versus Cloudflare TunnelVerify the resultWhat a domain does#
Instead of sharing 123.45.67.89:25565, you can share play.example.com. DNS tells the Minecraft client where to connect. It does not host the world or carry game traffic by itself.
The record types#
| Record | Meaning | Minecraft use |
|---|---|---|
| A | Name → IPv4 address | Direct home/VPS IPv4 |
| AAAA | Name → IPv6 address | Direct IPv6 when fully reachable |
| CNAME | Name → another hostname | Point a friendly subdomain at a tunnel hostname when allowed |
| SRV | Service name → target hostname and port | Hide a non-default Java port behind a domain |
A direct Java server#
If your public IPv4 is 203.0.113.10 and Java listens on the default port, an A record can point play.example.com to that address. Players enter play.example.com.
If the IP changes, the DNS record must be updated. Dynamic DNS software can automate this, but it is another credential-bearing service to secure.
A non-default Java port with SRV#
Suppose the server is reached at mc-target.example.net:25590, but you want players to enter play.example.com.
Create a target record/hostname, then an SRV record conceptually like:
Service: _minecraft
Protocol: _tcp
Name: play
Priority: 0
Weight: 5
Port: 25590
Target: mc-target.example.netThe SRV target must be a hostname, not an IP address. DNS provider forms label these fields differently. Do not place a period or omit one unless your provider’s instructions say so.
CNAME with a tunnel#
Some tunnel products let you point a CNAME at their assigned hostname; others require a paid custom-domain feature or a specific validation process. Follow the tunnel provider’s current documentation. A DNS record cannot remove a port or protocol restriction the tunnel itself does not support.
Cloudflare DNS versus Cloudflare Tunnel#
Cloudflare DNS publishes records. The orange-cloud HTTP proxy is designed around supported web traffic and does not automatically proxy a normal Minecraft Java TCP connection.
Cloudflare Tunnel is a separate connector product commonly used for HTTP services and private access. Do not assume creating a web tunnel exposes arbitrary Minecraft traffic. Use a game-capable tunnel, a direct connection or a product explicitly documenting that protocol.
Verify the result#
- 1Keep the original working address.
- 2Add the DNS record with a short temporary TTL if appropriate.
- 3Wait for caches to update.
- 4Look up the record from another network.
- 5Join using the new name.
- 6Keep the old address until several friends have tested.
The domain resolves but Minecraft cannot connect
DNS has done its job. Check the target port, protocol, tunnel/forward, firewall and server process. A successful DNS lookup does not prove a service is reachable.