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, andSRVrecords
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:
| Type | Name | Value |
|---|---|---|
| A | example.com | 198.51.100.20 |
| A | mc.example.com | 203.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:
| Field | Example value |
|---|---|
| Service | _minecraft |
| Protocol | _tcp |
| Name | @ or empty, depending on your DNS provider |
| Priority | 0 |
| Weight | 5 |
| Port | 25565 |
| Target | mc.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
| Symptom | Likely cause | Fix |
|---|---|---|
| Root domain resolves, but the client still asks for the port | SRV record missing or malformed | Recreate _minecraft._tcp.example.com correctly |
| DNS looks right, but the game cannot connect | Game port still blocked | Re-check port 25565 end to end |
| SRV target points to a CNAME | Target record is invalid | Point SRV to a hostname with a direct A or AAAA record |
| Java works, Bedrock still needs a port | Different client behavior | Bedrock 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
Aand optionallyAAAA - one clear public hostname such as
example.comorplay.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
- Still working on first deployment? Read the Hetzner Docker setup guide.
- If players still cannot reach the server, follow the port 25565 troubleshooting runbook.