Guides

How to Connect a Custom Domain to Your Minecraft Server

SkailarHost Team
November 19, 2026
6 min read
How to Connect a Custom Domain to Your Minecraft Server

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.

TL;DR

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.

The two records you need

RecordWhat it doesNeeded?
APoints a name like play.yourdomain.com at your server's IP addressAlmost always
SRVTells Minecraft Java which host and port to connect to, so players don't type the portWhen 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.

Before you start

  • A domain. Any registrar works, and a .com usually costs around $10 to $20 a year. You can use a subdomain of a domain you already have for a website: the site keeps working.
  • Access to its DNS settings. That's usually the registrar's dashboard, or Cloudflare if your domain uses it.
  • Your server's IP and port. Step 1 shows where to find them.

How to connect your domain, step by step

1. Find your server's IP and port

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.

2. Add an A record

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.

3. Add an SRV record

Add a second record with type SRV and fill it in like this:

FieldValueNote
Service_minecraftExactly like this, with the underscore
Protocol_tcp (or TCP)Minecraft Java connects over TCP
NameplayThe subdomain players type. Use @ for the root domain
Priority0Only matters with several records for one name
Weight5Same: any number works for a single record
PortYour server's port, e.g. 25580The number after the colon in your panel
Targetplay.yourdomain.comThe 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.

4. Check the records and join

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.com

The 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).

Use your root domain instead

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.

When an A record is enough

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 players

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.

More than one server on one domain

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.

Troubleshooting

ProblemFix
"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 withoutThe 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.comYour DNS provider adds the domain by itself. Edit the name so it's only _minecraft._tcp.play.
Bedrock players can't join with the domainBedrock ignores SRV records. They need to type the port into the Port box too.
It works for you but not for a friendTheir 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.

Minecraft servers on SkailarHost

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.

FAQ

Do I have to buy a domain?

No. Minecraft plans come with a free subdomain. Your own domain is for when you want your server's name in the address.

Does a domain hide my server's IP?

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.

Can I use Cloudflare's orange cloud?

No. Set the A record to DNS only. Cloudflare's regular proxy only handles web traffic, so Minecraft can't connect through it.

Does it work with modded servers?

Yes. The records don't care what the server runs: vanilla, Paper, Forge, Fabric and NeoForge all work the same way.

How long until the domain works?

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.

An address your players remember

Minecraft servers from $1.80/month, with a free subdomain, free DDoS protection, one-click plugins and daily backups.

Tags

#Minecraft#Domain#DNS#SRV Record#Guides

Related Articles