
Your server's address probably looks something like 123.45.67.89:25580: hard to remember, easy to mistype, and it changes if the server ever moves. With your own domain, players join with play.yourdomain.com instead. It takes two DNS records and about ten minutes, and you don't change anything on the server itself.
In your domain's DNS settings, add an A record that points play at your server's IP (DNS only if you use Cloudflare). Then add an SRV record named _minecraft._tcp.play with your server's port and play.yourdomain.com as the target. Java players can then join with just play.yourdomain.com. Bedrock doesn't read SRV records, so Bedrock players type the domain and the port.
| Record | What it does | Needed? |
|---|---|---|
| A | Points a name like play.yourdomain.com at your server's IP address | Almost always |
| SRV | Tells Minecraft Java which host and port to connect to, so players don't type the port | When your port isn't 25565 |
An A record alone gets players to the right machine, but Minecraft Java assumes port 25565 unless told otherwise. Hosted servers usually run on a different port, because many servers share one machine. The SRV record is what hands Minecraft the right port, so nobody has to type it.
Open your server in the game panel. The address on its console page is the one players use today, for example 123.45.67.89:25580. The part before the colon is the IP, the number after it is the port. Use this address, not the panel's own web address.
If the panel shows a hostname instead of an IP (letters instead of numbers before the colon), skip step 2 and use that hostname as the SRV record's target in step 3.
In your DNS settings, add a record with type A, the name play (or mc, or anything you like) and your server's IP as the value. Leave the TTL on Auto or the lowest option.
On Cloudflare, set the proxy status to DNS only (the grey cloud). With the orange cloud on, Cloudflare answers with its own IP address, and its proxy only passes web traffic, so Minecraft can't get through.
Add a second record with type SRV and fill it in like this:
| Field | Value | Note |
|---|---|---|
| Service | _minecraft | Exactly like this, with the underscore |
| Protocol | _tcp (or TCP) | Minecraft Java connects over TCP |
| Name | play | The subdomain players type. Use @ for the root domain |
| Priority | 0 | Only matters with several records for one name |
| Weight | 5 | Same: any number works for a single record |
| Port | Your server's port, e.g. 25580 | The number after the colon in your panel |
| Target | play.yourdomain.com | The A record from step 2. A hostname, never an IP |
DNS providers lay this form out differently. Some have separate Service, Protocol and Name boxes. Others, like Cloudflare, have a single Name box: type _minecraft._tcp.play there. Don't add your domain to the end of the name, since most providers add it for you.
Written out the way DNS stores them, the two records look like this:
play.yourdomain.com. A 123.45.67.89
_minecraft._tcp.play.yourdomain.com. SRV 0 5 25580 play.yourdomain.com.New records usually work within a few minutes, though it can take a few hours depending on the TTL. To check, open Command Prompt on Windows (or Terminal on Mac and Linux) and run:
nslookup -type=SRV _minecraft._tcp.play.yourdomain.comThe answer should show your port and target. Then open Minecraft, go to Multiplayer, then Add Server, and enter play.yourdomain.com with no port. If the game says it can't resolve the host, give it a few more minutes, or clear your PC's DNS cache with ipconfig /flushdns.
You don't change anything on the server. In particular, don't put your domain in server-ip in server.properties: that setting decides which network address the server listens on, and a wrong value stops it from starting (see our guide to a Minecraft server that won't start).
Want players to type just yourdomain.com? Minecraft looks for an SRV record on whatever name it's given, so put the SRV record on the root. In a separate Name box, enter @. Where there's a single Name box, like Cloudflare's, enter _minecraft._tcp. For the target, add an A record like mc that points at your server. Your website keeps its own record on the root, so the domain shows your site in a browser and your server in Minecraft.
mc.yourdomain.com. A 123.45.67.89
_minecraft._tcp.yourdomain.com. SRV 0 5 25580 mc.yourdomain.com.If your server's port is 25565, Minecraft's default, you can skip the SRV record: the A record alone lets players join with the domain. With any other port, an A record alone means players still type the port, as in play.yourdomain.com:25580.
Bedrock Edition doesn't look up SRV records, so the port can't be hidden for them. Bedrock players add the server with your domain as the address and the port in the Port box. On a Bedrock server that's the server's own port. On a Java server with Geyser, it's the extra allocation you created for Bedrock: our Geyser crossplay guide covers that setup.
Give each server its own subdomain and SRV record. Servers on the same machine can share one A record, with only the port changing:
play.yourdomain.com. A 123.45.67.89
_minecraft._tcp.survival.yourdomain.com. SRV 0 5 25580 play.yourdomain.com.
_minecraft._tcp.creative.yourdomain.com. SRV 0 5 25590 play.yourdomain.com.Players then join survival.yourdomain.com or creative.yourdomain.com. If the server ever moves, update the records and everyone keeps the same address.
| Problem | Fix |
|---|---|
| "Unknown host" or "Can't resolve hostname" | The records haven't spread yet, or the name has a typo. Check them with nslookup (step 4), wait a few minutes and run ipconfig /flushdns on Windows. |
| "Connection timed out" or "Connection refused" | The A record points at the wrong IP (often the panel's website instead of the server), or Cloudflare's proxy is on. Use the IP from your server's console page and set the record to DNS only. |
| It works with :port on the end, but not without | The SRV record is wrong. Check _minecraft and _tcp are spelled with underscores, the port matches your panel and the target is your A record's name, not an IP. |
| The record shows up as _minecraft._tcp.play.yourdomain.com.yourdomain.com | Your DNS provider adds the domain by itself. Edit the name so it's only _minecraft._tcp.play. |
| Bedrock players can't join with the domain | Bedrock ignores SRV records. They need to type the port into the Port box too. |
| It works for you but not for a friend | Their PC or internet provider still has the old answer cached. It clears by itself within the record's TTL, or right away with ipconfig /flushdns. |
Our Minecraft server hosting starts at $1.80/month, and every Minecraft plan comes with a free subdomain, so you can give players an easy address without buying a domain. When you want your own name, the steps above work with any domain. Plans also include free DDoS protection, one-click plugins and modpacks, and daily backups.
No. Minecraft plans come with a free subdomain. Your own domain is for when you want your server's name in the address.
No. Anyone can look up the A record and see the IP. A domain makes the address easier to share, while DDoS protection is what keeps the server safe from attacks.
No. Set the A record to DNS only. Cloudflare's regular proxy only handles web traffic, so Minecraft can't connect through it.
Yes. The records don't care what the server runs: vanilla, Paper, Forge, Fabric and NeoForge all work the same way.
Usually a few minutes. If you changed an existing record, some players may get the old answer until its TTL runs out, which can take a few hours.
Minecraft servers from $1.80/month, with a free subdomain, free DDoS protection, one-click plugins and daily backups.