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

  1. Choose a hostname such as play.example.com and create an A or AAAA record pointing to the reachable proxy or server.
  2. Create the Java Minecraft SRV record using service _minecraft, protocol _tcp, target play.example.com and the actual Java listening port.
  3. For example.com as the connection name, the complete owner is _minecraft._tcp.example.com; for mc.example.com, it is _minecraft._tcp.mc.example.com.
  4. 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.
  5. Wait for DNS caching to expire and confirm the host and port with nslookup -type=SRV _minecraft._tcp.example.com or dig 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.

Was this article helpful?
Help us improve this article

Tell us what is missing, unclear, outdated, or incorrect. You can also suggest something we should add.

What could we improve?
Do not include passwords, server IPs, or other private information.0 / 1000