Minecraft Domain Without a Port: How to Set Up an SRV Record

Want players to join via example.com instead of an IP and port? This guide shows how SRV records work for Minecraft Java Edition and how to configure them correctly.

Networking
setupmc.com Team

Need a cleaner baseline?

Generate a Compose setup before you keep patching by hand

If you are still refining the server baseline, use the configurator to create a cleaner Docker Compose setup and then return to the guides for the next issue.

Open configurator

What an SRV record solves

Without an SRV record, players must join like this:

203.0.113.10:25565

With a properly configured SRV record, they can join like this instead:

example.com

That is especially useful when:

  • your Minecraft server runs on a non-default port
  • you want to change hosts later without telling players a raw IP
  • you want a cleaner public join address

This guide covers Minecraft Java Edition.

Before you start

You need three things:

  • a working Minecraft server that is already reachable from the internet
  • a domain you control
  • a DNS provider where you can create A, AAAA, and SRV records

If players still cannot connect at all, fix that first with How to Open Port 25565 for a Minecraft Server on Hetzner and Linux.

How SRV records work for Minecraft

An SRV record adds two pieces of information that a normal A record does not contain:

  • the service
  • the port

For Minecraft Java Edition, the service record format is:

_minecraft._tcp.example.com

The SRV record then points to a host and a port. That target host must resolve directly through an A record for IPv4 or an AAAA record for IPv6.

Step 1: Create the actual game host record

First create the hostname that should point to the actual Minecraft server. This is useful when your website already lives on example.com, but the game server should stay on a separate IP.

Example:

TypeNameValue
Aexample.com198.51.100.20
Amc.example.com203.0.113.10

If you use IPv6 as well, add an AAAA record for the same hostname.

Here, example.com can keep serving the website while mc.example.com becomes the target for the Minecraft SRV record.

Step 2: Decide on the public join hostname

Now decide what players should type into Minecraft. If you want the cleanest possible address, use the root domain:

example.com

That public hostname will be represented by the SRV record, while the actual game traffic still goes to mc.example.com.

Step 3: Create the SRV record

Create an SRV record with the following pattern:

FieldExample value
Service_minecraft
Protocol_tcp
Name@ or empty, depending on your DNS provider
Priority0
Weight5
Port25565
Targetmc.example.com

If your server uses the default Minecraft Java port 25565, an SRV record is still useful when the public hostname should differ from the actual game host.

If your server listens on a different port, the SRV record is how Java clients discover it.

If you prefer play.example.com instead of example.com, use play in the Name field and keep the same target host pattern.

Step 4: Wait for DNS propagation

Most DNS changes are visible quickly, but not instantly everywhere. If the record looks correct and connecting still fails, give it a few minutes and test again.

Step 5: Test the join address

Open Minecraft Java Edition and connect using only the hostname:

example.com

Do not append the port if the SRV record is correct.

If the join still fails, go through the troubleshooting list below.

Troubleshooting

SymptomLikely causeFix
Root domain resolves, but the client still asks for the portSRV record missing or malformedRecreate _minecraft._tcp.example.com correctly
DNS looks right, but the game cannot connectGame port still blockedRe-check port 25565 end to end
SRV target points to a CNAMETarget record is invalidPoint SRV to a hostname with a direct A or AAAA record
Java works, Bedrock still needs a portDifferent client behaviorBedrock does not use this Java SRV setup; keep the Bedrock address and port separate

Good defaults

For a single Minecraft Java server, these defaults are enough:

  • priority 0
  • weight 5
  • target host with direct A and optionally AAAA
  • one clear public hostname such as example.com or play.example.com

There is no benefit in making the DNS setup more complicated unless you actually run multiple backends.

FAQ

Should the SRV record point directly to the root domain?

Yes, and that is one of the most useful SRV patterns when the website stays on example.com but the Minecraft server itself runs on a different host such as mc.example.com.

Does this help Bedrock players who join through Geyser?

Not usually. Bedrock clients still connect to the Bedrock listener address and port that Geyser exposes, so this Java-style SRV setup should not be treated as a Bedrock solution.

Do I also need a normal A record for play.example.com?

Not necessarily for the SRV setup itself. The important part is that the SRV target resolves correctly.

Next steps

Frequently asked questions

Short answers to the questions that usually come up while working through this topic.