Direct answer
A DNS SRV record can let Java Edition players connect with a clean hostname when the server uses a non-default port. The hostname still needs an A or AAAA record pointing at the correct public address.
Recommended procedure
- Choose a hostname such as
play.example.comand create an A or AAAA record pointing to the reachable proxy or server. - Create the Java Minecraft SRV record using service
_minecraft, protocol_tcp, targetplay.example.comand the actual Java listening port. - For
example.comas the connection name, the complete owner is_minecraft._tcp.example.com; formc.example.com, it is_minecraft._tcp.mc.example.com. - Ensure your DNS provider expects the record fields in the chosen format; do not paste the full owner into a field that automatically appends the zone.
- Wait for DNS caching to expire and confirm the host and port with
nslookup -type=SRV _minecraft._tcp.example.comordig SRV _minecraft._tcp.example.com.
Why this matters
An SRV record tells compatible Java clients which TCP port to use. It does not open a router port, bypass CGNAT or create a server. Bedrock Edition uses different connection behavior and should not be assumed to honor Java SRV records.
Practical example: Example: if Minecraft listens on 25566, an SRV record can advertise port 25566 while players type mc.example.com. The A/AAAA record for the SRV target must still resolve, and TCP 25566 must actually be reachable. A successful dig SRV result with a connection timeout means DNS discovery worked but the transport path did not.
How to verify the result
- Query both the SRV owner and its A/AAAA target.
- Connect from outside your network using the intended hostname without an explicit port.
- If lookup succeeds but joining fails, test the target IP and port directly to isolate DNS from networking.
Version and compatibility notes
- Keep the SRV target as a hostname, not an IP literal.
- Your record can be correct while unreachable because the backend or proxy port is closed.
Official references
These sources were checked for the current MSH revision. Version-sensitive details should always be confirmed against the project documentation for the release you run.
Related guides
Help us improve this article
Tell us what is missing, unclear, outdated, or incorrect. You can also suggest something we should add.