Free hosting
Minecraft JavaMinecraft BedrockPaperMCFabricForgeGeyserMCTerrariaFactorioHytaleDiscord botsRLCraftCobblemonBetter MCCreateMinecraft IndiaAll modpacks
Go premium

No hibernation, no timers, 5 GHz CPUs and up to 32 GB RAM.

From €1.99/month →
Tools & help
RAM calculatorMOTD generatorServer status checkerserver.properties generatorColor codesServer icon makerDiscord permissionsAll free toolsGuidesDiscord community
Language
EnglishNederlandsEspañolFrançaisDeutschItalianoPortuguêsLatviešuPolskiSuomiNorskRomânăPortuguês (BR)Türkçeहिन्दीBahasa IndonesiaالعربيةTiếng Việt
Start free
Minecraft · DNS

How to use a custom domain for your Minecraft server

A custom address like play.yourdomain.com is easier to remember than an IP and port, and it keeps working even if you move hosts. Java players connect with no port at all. Here's the exact DNS record to add, how to test it, and what to do for Bedrock players.

FreeGameHost logo FreeGameHost Guides Updated 4 min read
A Minecraft server list entry for play.yourdomain.com next to the SRV DNS record that powers it

Quick answer

Create one SRV record in your domain's DNS: name _minecraft._tcp.play, priority 0, weight 0, port = your server's port, target = your server's host (for example us.freegamehost.xyz). Java players can then join with play.yourdomain.com and no port.

Before you start: the free option#

If you just want a short address and don't own a domain, you may not need any of this. Every FreeGameHost server can claim a free subdomain such as survival.mcserv.xyz from Settings → Subdomains. The SRV record is created for you, so Java players connect without a port straight away.

FreeGameHost Subdomains page with survival.mcserv.xyz typed in and a live preview of the Java and Bedrock addresses
The Subdomains page shows both addresses before you save: port-free for Java, host plus port for Bedrock.

Want your own brand instead? Read on. You'll need a domain from any registrar (Cloudflare, Namecheap, Porkbun, GoDaddy and so on) and access to its DNS settings.

Step 1: find your server's host and port#

Open your server in the panel. The Console page shows the server address. The part before the colon is the host, the number after it is the port.

FreeGameHost Console page header showing the server address us.freegamehost.xyz:25692 with a copy button
Here the host is us.freegamehost.xyz and the port is 25692. Your values will be different.

Free and shared hosts almost never use Minecraft's default port 25565. Copy the exact port from your panel: a wrong port is the number one reason custom domains don't work.

How an SRV record works#

When a Java player types play.yourdomain.com, Minecraft first asks DNS: is there an SRV record for Minecraft on this name? The SRV record answers with the real host and port, and the game connects there. The player never sees the port.

Diagram: the player types play.yourdomain.com, Minecraft looks up the SRV record _minecraft._tcp.play.yourdomain.com, which points to us.freegamehost.xyz port 25692, and the game connects
One SRV record turns a friendly name into the real host and port.

Step 2: add the SRV record#

In your registrar's DNS settings, add a new record with these values. Every registrar has the same fields, just laid out a little differently.

DNS record form filled in: type SRV, name _minecraft._tcp.play, priority 0, weight 0, port 25692, target us.freegamehost.xyz
The values to enter. Replace play, the port and the target with your own.
FieldValueNotes
TypeSRV
Name_minecraft._tcp.playSwap play for any subdomain. Some registrars split this into Service _minecraft, Protocol _tcp and Name play.
Priority0Only matters if you have several servers.
Weight0Any number works with one server.
PortYour port, e.g. 25692From the Console page.
TargetYour host, e.g. us.freegamehost.xyzSome registrars want a trailing dot: us.freegamehost.xyz.
TTLAuto or 1 hour

Registrar notes#

  • Cloudflare: DNS → Records → Add record, choose SRV. SRV records are never proxied. If you also add a CNAME for Bedrock (below), set it to DNS only (grey cloud): the orange proxy only carries web traffic and blocks game connections.
  • Namecheap: Domain List → Manage → Advanced DNS → Add New Record → SRV Record.
  • GoDaddy: My Products → your domain → DNS → Add → SRV.

You don't need a CNAME or A record for Java players. The SRV target can point straight at your host's name.

Free Minecraft server Comes with a free subdomain on mcserv.xyz, playmc.world and more. SRV record included.
Create a free server

Step 3: test it#

  1. Check the record

    Enter play.yourdomain.com in our server status checker. If it shows your MOTD and player count, DNS is working. On a computer you can also run nslookup -type=SRV _minecraft._tcp.play.yourdomain.com.

  2. Join in Minecraft

    Go to Multiplayer → Add Server, enter play.yourdomain.com with no port, and join.

Bedrock players: add a CNAME too#

Bedrock Edition ignores SRV records. To give Bedrock players the same name, add a CNAME record: name play, target your host (for example us.freegamehost.xyz), proxy off. They enter play.yourdomain.com as the address and type the port separately. If you run Geyser crossplay, that's the Bedrock port, not the Java one.

Troubleshooting#

It works only when I add the port#

The SRV record isn't being found. Check the name is exactly _minecraft._tcp.play (underscores included, matching the subdomain players type), and that your registrar didn't append the domain twice, like _minecraft._tcp.play.yourdomain.com.yourdomain.com.

"Can't connect to server" or it times out#

Usually the port or target is wrong, or DNS hasn't updated yet. Compare both with your Console page. If you added a CNAME on Cloudflare, make sure its proxy is off.

It worked before and stopped#

Your server's address or port changed, for example after a move to another node. Update the SRV record's port and target.

Some players can join and others can't#

Their computers are caching the old DNS answer. Waiting fixes it, or they can run ipconfig /flushdns on Windows and restart Minecraft.

Frequently asked questions#

Do I need to change anything on the server itself?

No. A custom domain is set up entirely in your domain's DNS. The server keeps working on its original address too, so nobody is locked out while DNS updates.

Can I use my root domain (yourdomain.com) instead of a subdomain?

Yes. Leave the subdomain part out of the record name: use _minecraft._tcp (Cloudflare and most panels add your domain automatically) or _minecraft._tcp.yourdomain.com. Players can then type just yourdomain.com. Many owners still prefer play. so the root domain can host a website.

Does a custom domain work for Minecraft Bedrock?

Partly. Bedrock Edition ignores SRV records, so Bedrock players always type a port. Add a CNAME record (for example play pointing to your server's host) and they can enter play.yourdomain.com in the address box plus the port in the port box.

How long does DNS take to update?

On Cloudflare a new record usually works within a few minutes. Other registrars can take up to a few hours. If one device works and another doesn't, the second one is still using a cached answer: wait, or flush its DNS cache.

What happens if my server's port changes?

Update the Port and Target in your SRV record to match the new address on your Console page. Nothing else needs to change, and players keep using the same domain.

Are there free domains for Minecraft servers?

Freenom, the old source of free .tk and .ml domains, has shut down. If you don't want to buy a domain, use a free subdomain from your host instead. Every FreeGameHost server can claim one on domains like mcserv.xyz or playmc.world, with the SRV record created for you.