You can point your own domain to your game server by first proving ownership via a TXT record and then connecting either a subdomain via CNAME or an apex domain via an A record. For Minecraft Java, you can additionally set an SRV record so players can join without a visible port.

Overview: Which DNS Records You Need

# Record Purpose Required?
1 TXT Ownership verification yes
2 CNAME (subdomain) or A (apex) Connection to the server yes
3 SRV (Minecraft only) Connect without specifying a port optional

You create these records with your DNS provider, for example Cloudflare, Namecheap, IONOS, or Strato. The exact values are shown in the game-serverhosting dashboard under “Own Domain”. Copy them exactly, especially tokens, hostnames, and port.

If you also want to manage files, worlds, or configuration files on your server, the guide to SFTP access for game server files is helpful. For a basic DNS overview, you can also use the guide Setting up your own domain for game servers – DNS guide.

Requirements

Before you start, you need access to your domain’s DNS zone and access to your game-serverhosting dashboard. You should also know whether you want to use a subdomain like play.yourdomain.com or the apex domain yourdomain.com.

For most game servers, a subdomain is the more practical choice. It can point to your server’s hostname via CNAME and remains more flexible if the technical target address changes later. An apex domain also works, but it requires an A record pointing to the concrete IP address.

Step 1: Ownership Verification via TXT Record

To prevent someone else’s domain from being connected to your game server, you first prove that you control the domain. To do this, create a TXT record in your DNS zone:

Name:  _gsh-verify.yourdomain.com
Typ:   TXT
Wert:  gsh-verify=<your-individual-token>

You can find the exact token in the dashboard. Copy it 1:1, without additional spaces or quotation marks, unless your DNS provider adds them automatically.

If you use a subdomain, the name is adjusted accordingly. For play.yourdomain.com, the TXT name is:

_gsh-verify.play.yourdomain.com

Some DNS interfaces expect only the host part instead of the full domain name. In that case, enter _gsh-verify.play, for example, not _gsh-verify.play.yourdomain.com. What matters is the result of the DNS resolution.

Step 2: Set the Server Target

After the TXT record, the domain must point to your game server. Which record type is correct depends on whether you use a subdomain or an apex domain.

Connect a Subdomain via CNAME

For a subdomain like play.yourdomain.com, create a CNAME pointing to your server’s hostname:

Name:  play.yourdomain.com
Typ:   CNAME
Ziel:  yourserver.game-serverhosting.com

If your DNS provider is Cloudflare, the record must be set to DNS-only. That is the gray cloud. The Cloudflare proxy is intended for HTTP and HTTPS web traffic; raw game TCP or UDP traffic is not forwarded through it like a normal game server service. With the proxy enabled, your server may therefore be unreachable.

Connect an Apex Domain via A Record

An apex domain is the domain without a subdomain, for example yourdomain.com. For this, use an A record pointing to the server IP:

Name:  yourdomain.com
Typ:   A
Wert:  <IP address of your server>

You can find the IP address in the dashboard. Note: if your server later moves to another node or IP, you must update this A record. A subdomain with CNAME, on the other hand, points to the hostname and is usually easier to maintain in such cases.

The reason for this distinction is relevant on the DNS side: in RFC 1034, the IETF describes that a name with CNAME should not carry other data at the same time. The official primary source is RFC 1034 at [Documentation at rfc-editor.org](https://www.rfc-editor.org/rfc/rfc1034). Since an apex domain needs additional zone data in practice, an A record is the appropriate choice there.

Step 3: Optional SRV Record for Minecraft Java

Minecraft Java clients connect to the default port 25565 without an SRV record. If your server runs on a different port, players would have to enter the address with the port, for example:

yourdomain.com:25584

With an SRV record, you can hide the port specification for Minecraft Java:

Name:  _minecraft._tcp.yourdomain.com
Typ:   SRV
Wert:  0 5 <Port> <Target>

Example for port 25584 with target yourserver.game-serverhosting.com:

0 5 25584 yourserver.game-serverhosting.com

The values stand for priority, weight, port, and target hostname. The SRV record is located in your own DNS zone and is optional. It does not affect the actual domain verification.

An SRV record does not conflict with an A record on the apex domain because it is located under its own name: _minecraft._tcp.yourdomain.com. So you can connect yourdomain.com via A record and additionally set the Minecraft SRV record.

If you want to bring an existing Minecraft world to the server, the guide Uploading and switching a Minecraft world fits afterward.

Checking the Result

Wait a few minutes after saving the DNS records. Depending on the provider and TTL, DNS changes may also take longer to become visible. In the dashboard, the domain is verified as soon as TXT and CNAME or A record are detected correctly.

Then check the actual connection. Without an SRV record, you use domain plus port. With a correctly set Minecraft SRV record, the domain without a port is enough for Minecraft Java.

Troubleshooting

The CNAME Is Set, but the Server Is Not Reachable

First check whether the orange cloud is active in Cloudflare. For game server connections, the record must be set to DNS-only. Also check whether the CNAME points exactly to the hostname from the dashboard.

The TXT Record Is Not Detected

Check the name and the value. Common errors are duplicated domain endings, the wrong subdomain level, or a different token. If your provider expects only the host part, a fully entered name can become _gsh-verify.yourdomain.com.yourdomain.com.

The Apex Domain Does Not Work with CNAME

For yourdomain.com, use an A record pointing to the server IP. CNAME is suitable for subdomains like play.yourdomain.com, not for the apex domain.

Players Still Have to Enter the Port Despite the Domain

Then either the SRV record is missing or it points to the wrong port or the wrong target. Without an SRV record, entering the address with a port is normal.

Checks, Limits, and a Safe Way Back

The guide “Connect Your Own Domain to Your Game Server” applies to the server type described in the article and the version status visible at the time of review. Menu names, available versions, mod or plugin compatibility, and required resources may differ after updates. Therefore, do not transfer values to another game, loader, or server version without checking them.

Before making changes to the world, savegame, configuration, or extensions, create a backup of the affected files. Then change only one related step and test it with the same client and server version you want to play with later.

Checkpoint Expected Result Abort and Way Back
Server start The server reaches the operational state without a new error message. If startup errors occur, undo the change and restore the latest backup.
Connection test A test account can connect using the address shown in the panel. If version or connection errors occur, compare version, port, and allowances again.
Function test The specifically changed function works without damaging existing world or game data. If side effects occur, stop the server and restore the backed-up files.

A successful single test is not a performance or availability guarantee. World size, mods, plugins, player count, network route, and simultaneous load can change the result. Document the version, change, and test result so you can trace later deviations.

FAQ

Can I use a subdomain and the main domain at the same time?

Yes, if you configure both DNS names appropriately. A subdomain can point via CNAME, the apex domain via A record. Each name needs its own clean DNS configuration.

Do I always have to set the SRV record?

No. The SRV record is only optional and mainly relevant for Minecraft Java if players should connect without :Port. TXT plus CNAME or A record is enough for domain verification.

Why is DNS-only important with Cloudflare?

The Cloudflare proxy typically processes web traffic via HTTP and HTTPS. Game servers use other TCP or UDP connections. That is why the DNS record should resolve directly and not run through the proxy.

How long does DNS verification take?

That depends on the DNS provider, the TTL, and worldwide DNS propagation. Plan for at least a few minutes. If nothing happens after a longer wait, check record name, value, target, and proxy status.

What happens if the server IP changes?

With an A record, you must enter the new IP yourself in your DNS zone. With a CNAME pointing to the server hostname, maintenance is usually easier because the subdomain points to the hostname.