Tree Host

How to Give Your Minecraft Server a Custom Domain

Updated · by the Tree Host team

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.

What you need before you start

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

RecordWhat it doesWhen you need it
APoints a name at an IPv4 addressYour server address is an IP
CNAMEPoints a name at another hostnameYour server address is a hostname on the default port
SRVSays which hostname and port to use for MinecraftYour 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:

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.

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:

FieldValue
TypeSRV
Service_minecraft
Protocol_tcp
Nameplay (for play.yourname.com)
Priority0
Weight5
Port25570
Targetmc.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:

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

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.

More guides

← More guides