Minecraft

Minecraft Server Domain: How to Add a Custom Domain

Point a name like play.yourname.com at your server with one A record and one _minecraft._tcp SRV record, so players never type an IP or a port again.

TheGameHosting Team 9 min read
Network cables in a server rack, the hardware behind a Minecraft server domain and its DNS records
Photo: Dsimic, CC BY-SA 4.0, via Wikimedia Commons

A Minecraft server domain turns 203.0.113.10:25570 into something your friends can remember, like play.yourname.com. You need a domain you control and two DNS records: an A record that points a name at the server's IP, and an SRV record that tells Minecraft: Java Edition which port to use. This guide shows both records, the exact values to type, how to test them, and the three mistakes that break most setups.

What you need before you start

  • A domain name. Any domain you own works. You manage its DNS at your domain registrar or at the DNS provider you moved it to (Cloudflare is a common one).
  • Your server's IP and port. On a hosted server, the panel shows the address and port players use to connect. At home, it's your public IP and the port you forwarded (the Java default is 25565).
  • About 15 minutes, plus some waiting while the new records reach players' DNS caches.

If you don't have a server running yet, start with how to make a Minecraft Java server and come back once you can join it by IP.

How to make a Minecraft server address (domain name)

When a Java player types play.yourname.com into Multiplayer → Add Server, the game first asks DNS for an SRV record called _minecraft._tcp.play.yourname.com. The Minecraft Wiki notes this lookup has existed since Java Edition 1.3.1. If the SRV record exists, the game reads the port and target host from it, looks up the target's A record to get the IP, and connects. If there is no SRV record, the game falls back to the plain A record and uses port 25565.

That leaves three possible setups:

Your server's portRecords you needWhat players type
25565 (Java default)A record onlyplay.yourname.com
Any other port (for example 25570)A record + SRV recordplay.yourname.com
Any other port, no SRVA record onlyplay.yourname.com:25570

On shared hosting the port is often not 25565, because many servers share one IP. That is exactly what the SRV record fixes.

Step 1: Create the A record

The A record maps a hostname to an IPv4 address. In your DNS provider, add:

FieldValue
TypeA
Name / Hostplay (becomes play.yourname.com)
IPv4 addressyour server's IP, for example 203.0.113.10
TTLAuto or 300 seconds
Proxy (Cloudflare only)DNS only (grey cloud)

You can use the root domain instead of a subdomain (@ in most DNS panels), but a subdomain such as play or mc keeps your website free for the root.

Can I use a CNAME instead?

Yes, if your host gives you a hostname instead of a bare IP, a CNAME from play.yourname.com to that hostname works for the A part. Two limits: a CNAME can't sit on the root domain, and the target of an SRV record must not be a CNAME. RFC 2782 says the SRV target "MUST NOT be an alias", so point the SRV at a name that has its own A record.

Step 2: Create the SRV record

The SRV format comes from RFC 2782: _Service._Proto.Name TTL Class SRV Priority Weight Port Target. For Minecraft the service is _minecraft and the protocol is _tcp. Here is the full record for our example:

DNS zone (example)
play.yourname.com.                   300 IN A    203.0.113.10
_minecraft._tcp.play.yourname.com.   300 IN SRV  0 5 25570 play.yourname.com.

What each field means:

FieldExampleMeaning
Name_minecraft._tcp.playService + protocol + the name players type
Priority0Lower number is tried first. One server: any number works
Weight5Splits traffic between records with the same priority. One server: any number
Port25570The port your server listens on, exactly as the panel shows it
Targetplay.yourname.comA hostname with an A record. Never an IP
  1. Open the DNS settings of your domain at your registrar or DNS provider.
  2. Add a record of type SRV.
  3. In Name, type _minecraft._tcp.play. If your panel has separate fields, put _minecraft in Service, TCP in Protocol and play in Name.
  4. Set Priority to 0 and Weight to 5.
  5. Set Port to your server's port, for example 25570.
  6. Set Target to play.yourname.com (the name from your A record), not the IP.
  7. Save, wait a few minutes and test it with the commands in Step 3.

Cloudflare: turn the proxy off (grey cloud)

This is the most common reason a Minecraft server domain doesn't work. Cloudflare's docs say a proxied record (orange cloud) puts Cloudflare between players and your server instead of returning your server's IP, and that only A, AAAA and CNAME records serving HTTP or HTTPS can be proxied. Minecraft is not web traffic, so a proxied A record sends players to an address that won't pass the game through. The SRV record itself can't be proxied at all.

Set the A record that your SRV target uses to DNS only (grey cloud). Cloudflare's docs say TCP or UDP apps need their separate Spectrum product to go through the proxy; for a normal Minecraft server, DNS only is the setting you want.

The side effect: with a grey cloud, anyone who looks up your domain sees the server's real IP. That's normal for game servers, and it's why the protection has to live on the server's network, not in front of the domain.

Step 3: Test your domain with nslookup or dig

Don't wait for a friend to report "can't connect". Check the records yourself. On Windows, open Command Prompt:

Windows (Command Prompt)
nslookup -type=SRV _minecraft._tcp.play.yourname.com
nslookup play.yourname.com

On macOS or Linux, use dig. Asking a public resolver directly (@1.1.1.1 or @8.8.8.8) shows what players see, not your own cached answer:

macOS / Linux terminal
dig SRV _minecraft._tcp.play.yourname.com +short @1.1.1.1
dig A play.yourname.com +short @1.1.1.1

A correct setup returns something like this:

Expected output
0 5 25570 play.yourname.com.
203.0.113.10

If the SRV query returns nothing, the name is wrong or the record hasn't spread yet. If the A query returns an IP that isn't yours, the Cloudflare proxy is probably still on.

How long does DNS propagation take?

New records usually work in minutes, but resolvers keep old answers until the TTL runs out. Cloudflare's "Auto" TTL is 300 seconds (five minutes), and its docs warn that local caches can take longer. The Minecraft Wiki says changes "may take a day or so" on some resolvers. If the commands above return the right values but the game doesn't, close the game completely, open it again and retry.

Does a Minecraft Bedrock server use SRV records?

No. The Minecraft Wiki lists it among the limitations of Bedrock Dedicated Server: it "doesn't support SRV record for a domain name". Bedrock players can still use your domain through the A record, but they type the port in the Port field themselves. The Bedrock defaults are 19132 (IPv4) and 19133 (IPv6). If the port you were given is 19132, players only need the domain. For the full join process, see how to add a server in Minecraft Bedrock.

If you run Java with a crossplay plugin for Bedrock players, they connect to the Bedrock-side port of that plugin, again typed by hand. The SRV record only helps the Java players.

Common Minecraft server domain mistakes

SymptomLikely causeFix
Domain works only with :port at the endSRV missing or wrong nameCheck it's _minecraft._tcp.<name> and protocol TCP
"Can't resolve hostname"Typo or record not propagatedRun dig / nslookup, wait for the TTL
Times out on the domain, works on the IPCloudflare proxy onGrey cloud on the A record
SRV saved but ignoredTarget is an IP or a CNAMETarget must be a hostname with an A record
Worked yesterday, broken todayServer IP changedUpdate the A record with the new IP

If the IP itself doesn't answer, the problem isn't DNS: read Minecraft server connection timed out.

How to make a Minecraft server IP address that doesn't change

A domain only hides the IP; it doesn't make it stable. Most home connections have a dynamic public IP, so a server on your PC can get a new address after a router restart. When that happens, every A record pointing at the old IP sends players nowhere until you notice and fix it. You also need port forwarding, and your PC has to stay on for anyone to play.

A hosted server avoids all of that. On TheGameHosting, your server runs 24/7 on our network, and the panel shows the address and port players connect to. You put those two values into your A and SRV records once. Two things to keep in mind:

  • If you move the server with Location Changer (Dallas or Amsterdam), it lands on a different node, so check the new address in the panel and update your A record and SRV port.
  • DDoS protection is included on every plan. That matters here because a grey-cloud domain shows the real IP to anyone who looks it up.

Once players can reach your server by name, decide who gets in: a whitelist for your Minecraft server keeps a public address from turning into a public server.

Get a server worth pointing a domain at

A domain is the finishing touch for a server people come back to. If yours still lives on a PC with a changing IP, every DNS record you set up today can break tomorrow. With TheGameHosting, Minecraft plans start at $1.90 USD/month with 2 GB, running on AMD 9950X / 7950X3D CPUs and NVMe storage, ready in about 60 seconds after payment, with Version Changer for Paper, Purpur, Fabric, Forge and more. Pick a size on our plans and pricing page, copy the address and port from the panel into the two records above, and use code FULL2026 for 15% off for life. If you're unsure which plan fits, compare all plans here.

FAQ

How do I make a Minecraft server domain name?

Buy or use a domain you own, create an A record that points a subdomain like play.yourname.com at your server's IP, and add an SRV record named _minecraft._tcp.play with your server's port if it isn't 25565.

Do I need an SRV record if my server uses port 25565?

No. Java Edition uses port 25565 by default, so an A record alone lets players join with just the domain. The SRV record is only needed for other ports.

Why does my Minecraft domain not work with Cloudflare?

Usually the A record is proxied (orange cloud). Cloudflare's proxy only handles web traffic, so switch the record to DNS only (grey cloud) and wait a few minutes.

Can an SRV record point directly to an IP address?

No. RFC 2782 requires the target to be a hostname, and it must not be a CNAME alias. Create an A record for the IP and use that hostname as the SRV target.

Does the SRV record work for Minecraft Bedrock?

No. Bedrock Dedicated Server doesn't support SRV records, so Bedrock players type your domain and the port by hand, unless the server uses the default port 19132.

How long does a new Minecraft server domain take to work?

Often a few minutes. Resolvers cache answers until the TTL expires, so allow up to a day in the worst case and test with dig or nslookup meanwhile.

Hosting for this game

Written by TheGameHosting Team, the people who run our servers in Dallas and Amsterdam and answer your tickets.

All posts