DomainsAugust 4, 20265 min read

How to Set Up a Subdomain for a Game Server

Give players a memorable address like play.yourdomain.com instead of a raw IP and port — with the right DNS record, and an SRV record to hide the port entirely.

NBy Nxeon

Players remember play.yourserver.com far better than 203.0.113.10:25565. A subdomain gives your game server a clean address, and — for games that support it, like Minecraft — an SRV record can hide the port entirely. This guide covers both, with a real Minecraft example.

Step 1: Point a subdomain at the server IP

Add an A record for the subdomain pointing at your game server's IP:

  • Type: A, Name: play, Value: 203.0.113.10, TTL: 3600

Now play.yourserver.com resolves to your server. Players connect with play.yourserver.com:25565 (the default Minecraft port). If your host or DNS is behind Cloudflare, set this record to grey / DNS-only — game traffic isn't HTTP, so Cloudflare's proxy would break it (a point we make in how to point a domain to a VPS with Cloudflare). The subdomain basics are in subdomains explained.

Verify:

dig +short play.yourserver.com A

Step 2: Hide the port with an SRV record (Minecraft Java)

Minecraft Java Edition reads SRV records, which lets players connect with just play.yourserver.com — no port. The SRV record encodes the port for them:

_minecraft._tcp.play.yourserver.com.  SRV  0 5 25565 play.yourserver.com.

Broken into the fields most panels ask for:

  • Service: _minecraft
  • Protocol: _tcp
  • Name: play (the subdomain)
  • Priority: 0
  • Weight: 5
  • Port: 25565 (your actual server port)
  • Target: play.yourserver.com (which must have its own A record)

Now the address in the client is simply play.yourserver.com. This is how big servers run on non-default ports without players ever typing one.

Managing DNS records for a domain in the Nxeon control panel
Managing DNS records for a domain in the Nxeon control panel

Step 3: Open the firewall

DNS points players at the box, but the game port must be reachable. On the server:

ufw allow 25565/tcp
ufw allow 25565/udp

(TCP for Java, UDP for Bedrock and many other games.) Confirm it's listening and open with a port checker — see how to check if a port is open or the free port checker tool.

Other games

Most games don't read SRV records, so players use subdomain:port — which is still far nicer than a raw IP. The A record from Step 1 is all you need; just tell players the port. For running the server itself, see how to set up a Minecraft server on a VPS or the wider custom domain for your game server guide.

Step 4: Verify the SRV

dig +short _minecraft._tcp.play.yourserver.com SRV

You should see the priority, weight, port and target back. If the client still asks for a port, the SRV name is wrong (check the _minecraft._tcp prefix and that the target has an A record). Query help: diagnosing DNS problems with dig and nslookup.

SRV formats for other games

Minecraft Java is the famous SRV case, but a few other games and services read SRV too, each with its own service/protocol prefix:

  • Minecraft Java: _minecraft._tcp
  • Minecraft Bedrock: _minecraft._udp (though many Bedrock clients ignore SRV, so give players the port anyway)
  • TeamSpeak 3: _ts3._udp
  • Mumble: _mumble._tcp

Most other games — Rust, Valheim, ARK, Palworld — don't read SRV at all, so players use subdomain:port. That's still a big upgrade over a raw IP, and if you rebuild the server on a new box you only update one A record instead of telling everyone a new address. Running the game servers themselves is a separate topic, each with its own per-game setup guide.

Keep the subdomain stable across server moves

The whole point of a subdomain is that players learn one address forever. When you upgrade hardware or change hosts, keep the address stable:

  1. Lower the subdomain's A-record TTL to 300 a day before the move.
  2. Point the A record at the new server IP.
  3. Update the SRV target only if the hostname changed (usually it doesn't).

Players keep typing play.yourserver.com and never notice. This is far friendlier than a raw IP that changes with every migration.

Don't proxy game traffic — but do protect it

As noted, Cloudflare's HTTP proxy can't carry game traffic, so the DNS record stays grey. That means your server IP is exposed, which matters for popular servers that attract DDoS. Options: a game-aware anti-DDoS provider that gives you a proxied host to CNAME to, your host's built-in mitigation, or firewall rate-limiting. Background on the threat: DDoS protection for game servers. And confirm the port is actually reachable after every change with a port checker.

FAQ

Can players connect without typing a port?

For Minecraft Java, yes — add an SRV record and they use just the subdomain. Most other games need subdomain:port, though that's still cleaner than an IP.

Should I proxy the game subdomain through Cloudflare?

No. Cloudflare's orange-cloud proxy only handles HTTP/HTTPS. Set game subdomains to grey (DNS-only) so raw game traffic reaches your server.

Why does my subdomain resolve but players can't connect?

The port isn't open or the server isn't listening. Open it in the firewall (ufw allow 25565) and confirm with a port checker.

Can I use a subdomain for a Bedrock server?

Yes, with an A record. Bedrock uses UDP and a different SRV format (_minecraft._udp), and some clients ignore SRV — so give Bedrock players the port to be safe.

Why does my game subdomain resolve but players still can't join?

Almost always a firewall or port problem, not DNS. If dig play.yourserver.com returns the right IP but nobody can connect, the game port isn't reachable: check the server is actually listening (ss -tulpn | grep 25565), that the firewall allows it (ufw allow 25565/tcp and /udp as appropriate), and that no host-level network firewall is blocking it. The second common cause is proxying the subdomain through Cloudflare's orange cloud, which only carries HTTP — set the record to grey (DNS-only) for game traffic. Confirm reachability from outside with a port checker. DNS gets players to the door; the firewall and the listening service decide whether they can walk in.

A clean address deserves a server that can handle the players. Launch one on game server hosting from Nxeon, or dedicated Minecraft server hosting for one-click setup.

#game-server#subdomains#dns#srv-record#minecraft#seobatch

Deploy your first server in under a minute

Creating an account is free and takes no card details. You pay when you deploy — choose a billing term and pay from your wallet or by card at checkout.