How to Give Your Minecraft Server a Custom Domain
To give a Minecraft server a custom domain, buy a domain, then add an A record that points a name such as play.yourname.com at your server's IP address. If the server does not use port 25565, add an SRV record named _minecraft._tcp.play that sets the port. Players join with just play.yourname.com.
Why use a custom domain
A domain is easier to say, type and remember than a string of numbers. It also stays the same if you move the server. You change one DNS record and your players keep using the same address.
- Easy to share.
play.yourname.comfits on a poster, a Discord pin or a YouTube description. - It survives moves. If you change hosts or machines, you update DNS and nobody has to change their server list.
- It looks serious. Players trust a named server more than a raw IP.
- No port to type. With an SRV record, the port is hidden.
What you need before you start
- A Minecraft Java Edition server that people can already join with its current address. If they cannot, fix that first.
- The server's address and port. On Tree Host it is the Join address at the top of the server page, see getting started.
- A domain you own, or $10 to $20 for the first year. Any registrar that lets you edit DNS records will do.
- Access to the DNS settings of that domain.
Find out whether your server address is an IP or a hostname. This decides which record you add. An IP address looks like 203.0.113.10. A hostname looks like something.example.net.
Records at a glance
| Record | What it does | When you need it |
|---|---|---|
| A | Points a name at an IPv4 address | Your server address is an IP |
| CNAME | Points a name at another hostname | Your server address is a hostname on the default port |
| SRV | Says which hostname and port to use for Minecraft | Your server is not on port 25565 |
1. Pick a name for your server
Most servers use a subdomain such as play.yourname.com, mc.yourname.com or survival.yourname.com. A subdomain leaves the main name free for a website. You can also use the root domain, yourname.com, but a subdomain is easier to change later.
2. Add the A record (server on an IP address)
Open the DNS settings for your domain and add a new record:
- Type: A
- Name (host):
play(some registrars want the fullplay.yourname.com) - Value (points to): your server's IP address
- TTL: 300 seconds or
Auto
If the server runs on the default port 25565, you are done. Skip to step 5.
3. Or add a CNAME (server on a hostname)
If your host gives you a hostname instead of an IP address, add a CNAME record.
- Type: CNAME
- Name:
play - Value: the hostname you were given, with no port
- TTL: 300 seconds or
Auto
A CNAME cannot sit on the root domain at most registrars, and it cannot carry a port. If your host's address includes a port number, you need the SRV record in the next step.
4. Add the SRV record (server on another port)
The SRV record tells Minecraft Java Edition which port to use, so players never type it. Suppose your A record is mc.yourname.com and your server runs on port 25570. Add:
| Field | Value |
|---|---|
| Type | SRV |
| Service | _minecraft |
| Protocol | _tcp |
| Name | play (for play.yourname.com) |
| Priority | 0 |
| Weight | 5 |
| Port | 25570 |
| Target | mc.yourname.com |
Some registrars show a single field. In that case the name is _minecraft._tcp.play, and the value is 0 5 25570 mc.yourname.com.
Three rules matter here. The target must be a hostname, not an IP, so keep the A record from step 2 under a different name such as mc. The service and protocol parts start with an underscore. And you do not add a dot or port to the target.
5. Wait, then test
New records usually work within a few minutes. Some take up to an hour. Check from a computer first:
- On Windows, open a terminal and run
nslookup play.yourname.com. You should see your server's IP. - To check the SRV record, run
nslookup -type=SRV _minecraft._tcp.play.yourname.com. - On macOS or Linux, run
dig play.yourname.comanddig SRV _minecraft._tcp.play.yourname.com. - Then open Minecraft, go to Multiplayer, Add Server, type
play.yourname.comand join.
If the old address still works but the new one does not, DNS has probably not spread yet. Wait and try again.
Bedrock Edition
Bedrock does not read SRV records. Players enter the address and the port in two boxes, and the default Bedrock port is 19132. An A record gives Bedrock players the address part. Tell them the port to type if it is not 19132. For a setup where both editions join the same server, see how crossplay works in the server guide.
Common problems
- "Can't resolve hostname". The record is missing, has a typo, or has not spread. Check with
nslookup. - The domain works only with the port. The SRV record is missing or its name is wrong. It must be
_minecraft._tcp.<subdomain>. - It connects to the wrong server. An old record is still cached. Lower the TTL to 300 and wait.
- The record is set to proxied. Services that proxy web traffic cannot carry Minecraft. Set the record to DNS only (grey cloud).
- The SRV target is an IP address. Make an A record for a hostname and point the SRV record at that.
If players still cannot connect after DNS looks right, the problem may be the server itself. Our Minecraft server properties guide covers server-port and online-mode, and the troubleshooting guide lists the usual causes.
Keep your players safe after the switch
Once the domain works, share only that name. Keep the whitelist on if the server is for friends, because a public domain is easier for strangers to find.
Moving the server later
This is where a domain pays off. When the server moves, change the value of the A record to the new IP, or change the SRV port and target. After the TTL runs out, everyone who joins with the domain lands on the new server. Make a backup before any move.
Tree Host servers come with a join address you can share right away. Compare the plans, or try the demo server first.