Quick answer
Create one SRV record in your domain's DNS: name _minecraft._tcp.play, priority 0, weight 0, port = your server's port, target = your server's host (for example us.freegamehost.xyz). Java players can then join with play.yourdomain.com and no port.
Before you start: the free option#
If you just want a short address and don't own a domain, you may not need any of this. Every FreeGameHost server can claim a free subdomain such as survival.mcserv.xyz from Settings → Subdomains. The SRV record is created for you, so Java players connect without a port straight away.

Want your own brand instead? Read on. You'll need a domain from any registrar (Cloudflare, Namecheap, Porkbun, GoDaddy and so on) and access to its DNS settings.
Step 1: find your server's host and port#
Open your server in the panel. The Console page shows the server address. The part before the colon is the host, the number after it is the port.

us.freegamehost.xyz and the port is 25692. Your values will be different.Free and shared hosts almost never use Minecraft's default port 25565. Copy the exact port from your panel: a wrong port is the number one reason custom domains don't work.
How an SRV record works#
When a Java player types play.yourdomain.com, Minecraft first asks DNS: is there an SRV record for Minecraft on this name? The SRV record answers with the real host and port, and the game connects there. The player never sees the port.

Step 2: add the SRV record#
In your registrar's DNS settings, add a new record with these values. Every registrar has the same fields, just laid out a little differently.

play, the port and the target with your own.| Field | Value | Notes |
|---|---|---|
| Type | SRV | |
| Name | _minecraft._tcp.play | Swap play for any subdomain. Some registrars split this into Service _minecraft, Protocol _tcp and Name play. |
| Priority | 0 | Only matters if you have several servers. |
| Weight | 0 | Any number works with one server. |
| Port | Your port, e.g. 25692 | From the Console page. |
| Target | Your host, e.g. us.freegamehost.xyz | Some registrars want a trailing dot: us.freegamehost.xyz. |
| TTL | Auto or 1 hour |
Registrar notes#
- Cloudflare: DNS → Records → Add record, choose SRV. SRV records are never proxied. If you also add a CNAME for Bedrock (below), set it to DNS only (grey cloud): the orange proxy only carries web traffic and blocks game connections.
- Namecheap: Domain List → Manage → Advanced DNS → Add New Record → SRV Record.
- GoDaddy: My Products → your domain → DNS → Add → SRV.
You don't need a CNAME or A record for Java players. The SRV target can point straight at your host's name.
Step 3: test it#
- Check the record
Enter
play.yourdomain.comin our server status checker. If it shows your MOTD and player count, DNS is working. On a computer you can also runnslookup -type=SRV _minecraft._tcp.play.yourdomain.com. - Join in Minecraft
Go to Multiplayer → Add Server, enter
play.yourdomain.comwith no port, and join.
Bedrock players: add a CNAME too#
Bedrock Edition ignores SRV records. To give Bedrock players the same name, add a CNAME record: name play, target your host (for example us.freegamehost.xyz), proxy off. They enter play.yourdomain.com as the address and type the port separately. If you run Geyser crossplay, that's the Bedrock port, not the Java one.
Troubleshooting#
It works only when I add the port#
The SRV record isn't being found. Check the name is exactly _minecraft._tcp.play (underscores included, matching the subdomain players type), and that your registrar didn't append the domain twice, like _minecraft._tcp.play.yourdomain.com.yourdomain.com.
"Can't connect to server" or it times out#
Usually the port or target is wrong, or DNS hasn't updated yet. Compare both with your Console page. If you added a CNAME on Cloudflare, make sure its proxy is off.
It worked before and stopped#
Your server's address or port changed, for example after a move to another node. Update the SRV record's port and target.
Some players can join and others can't#
Their computers are caching the old DNS answer. Waiting fixes it, or they can run ipconfig /flushdns on Windows and restart Minecraft.
Frequently asked questions#
Do I need to change anything on the server itself?
No. A custom domain is set up entirely in your domain's DNS. The server keeps working on its original address too, so nobody is locked out while DNS updates.
Can I use my root domain (yourdomain.com) instead of a subdomain?
Yes. Leave the subdomain part out of the record name: use _minecraft._tcp (Cloudflare and most panels add your domain automatically) or _minecraft._tcp.yourdomain.com. Players can then type just yourdomain.com. Many owners still prefer play. so the root domain can host a website.
Does a custom domain work for Minecraft Bedrock?
Partly. Bedrock Edition ignores SRV records, so Bedrock players always type a port. Add a CNAME record (for example play pointing to your server's host) and they can enter play.yourdomain.com in the address box plus the port in the port box.
How long does DNS take to update?
On Cloudflare a new record usually works within a few minutes. Other registrars can take up to a few hours. If one device works and another doesn't, the second one is still using a cached answer: wait, or flush its DNS cache.
What happens if my server's port changes?
Update the Port and Target in your SRV record to match the new address on your Console page. Nothing else needs to change, and players keep using the same domain.
Are there free domains for Minecraft servers?
Freenom, the old source of free .tk and .ml domains, has shut down. If you don't want to buy a domain, use a free subdomain from your host instead. Every FreeGameHost server can claim one on domains like mcserv.xyz or playmc.world, with the SRV record created for you.