Skip to content
Minecraft Minecraft: Bedrock Edition Rust Counter-Strike 2 Palworld Valheim Satisfactory Enshrouded
Configure server Sign in
DE EN

Set Up a Minecraft Domain with an SRV Record

An SRV record can let players use a Minecraft Java hostname when the server listens on a different port. Check the target host and port, publish the matching address records, and confirm the DNS response; DNS does not open a port or prove the server is reachable.


The examined Mojang Java client 26.3 can connect to a Minecraft Java server through an SRV record. This lets players enter, for example, play.example.com even when the server listens on a port other than 25565. DNS does not open a port or check whether the server is reachable. The client code uses the service identifier _minecraft._tcp.. This guide is limited to Minecraft Java. (Mojang Client 26.3)

Before creating the record: know the target host and port

You need access to your domain's DNS zone and the actual connection details for your server. Use the hostname and game port from the server configuration or from the responsible provider. The port must be the one on which the server accepts connections. A web port, management port, or port from an example is not automatically suitable.

Create at least the matching address record for the target host. An A record contains an IPv4 address; an AAAA record contains an IPv6 address. Publish an AAAA address only if the server is reachable through that exact IPv6 route. The example addresses below come from documentation ranges and are not associated with a game server. (RFC 1035, RFC 3596, IANA: Special-Use Domain Names, IANA: Example Domains)

node.example.net. 300 IN A     192.0.2.40
node.example.net. 300 IN AAAA  2001:db8::40

example.com and example.net are reserved for documentation examples. 192.0.2.0/24 and 2001:db8::/32 are also documentation ranges. Replace these values with your own hostname and the actual server addresses confirmed by your provider; do not copy the example addresses into a production zone. (IANA: Example Domains, IANA: IPv4 Address Space, IANA: IPv6 Special-Purpose Address Space)

Create an SRV record for the name

If players should enter play.example.com, the full SRV query name is _minecraft._tcp.play.example.com. For the root domain example.com, it would be _minecraft._tcp.example.com. The DNS standard places the service before the protocol and the name to which the record applies. In a provider form, the Name field may be relative to the zone; read back the fully assembled name after saving. (RFC 2782, Cloudflare: DNS record types)

For the example service on port 25570, the record looks like this:

Name:      _minecraft._tcp.play
Typ:       SRV
Priorität: 0
Gewicht:   0
Port:      25570
Ziel:      node.example.net.

As a complete resource record, the same example entry is:

_minecraft._tcp.play.example.com. 300 IN SRV 0 0 25570 node.example.net.

The target host must have its own A or AAAA records and, under RFC 2782, must not be an alias. If the target points to a CNAME, use the final hostname with an address record instead. The lower number is tried first for priority. Weight affects ordering only among records with the same priority; a higher weight is a relative selection chance, not a guarantee of a particular distribution. With only one SRV record, weight does not provide load balancing. (RFC 2782)

Check the DNS response and connect with Java

Check the SRV record first, then the target's address. dig +noall +answer displays the name, TTL, type, and answer compactly; this is the documented BIND form for a short response. Replace the example names with your own zone. (BIND 9: dig)

dig +noall +answer _minecraft._tcp.play.example.com SRV
dig +noall +answer node.example.net A
dig +noall +answer node.example.net AAAA

The SRV response should contain the port and target, and the target host response should return the configured A and, where applicable, AAAA values. An example response structure is:

_minecraft._tcp.play.example.com. 300 IN SRV 0 0 25570 node.example.net.
node.example.net. 300 IN A 192.0.2.40
node.example.net. 300 IN AAAA 2001:db8::40

These values are documentation examples only and have not been checked live. An empty SRV result may indicate a name assembled incorrectly or a different active DNS zone. If only the AAAA value is wrong, players with IPv6 may receive a different or unreachable endpoint.

In the examined Mojang Java client 26.3, _minecraft._tcp is queried only when the parsed port is 25565. If no port is specified, the client uses this default; :25565 also meets the condition. An explicitly different port such as :25570 skips the SRV query (Mojang Java Client 26.3). For this client, enter only play.example.com if you want to use the SRV port. This code evidence applies to Mojang Java 26.3 and says nothing about Bedrock or other client versions.

Then check the connection with a Java client after the DNS response shows the expected port. The query confirms only the published data, not the firewall, port mapping, or server startup. If DNS looks correct but the connection fails with Connection refused or a timeout, follow the separate steps for connection errors. For a DNS change shortly before a move, also see the TTL and transition plan. For device and edition selection, see Minecraft Java or Bedrock.

Common errors

  • The SRV record is missing from the query: Check _minecraft._tcp and the requested name. Some forms append the zone automatically; if so, do not append it in full again.
  • SRV responds, but the target host does not resolve: Add the matching A or AAAA address and check the target name. The final dot marks the fully qualified hostname in a zone file; in a user interface, behavior depends on the provider.
  • The response contains the wrong port: Compare the SRV port with the actual game port. A DNS address alone does not replace this mapping when the port differs.
  • The query is correct, but the client still cannot reach the server: Check the actual port forwarding, the running server, and the network path in use. An SRV record is not a proxy and does not open a firewall.

Sources

Did this guide help? We are happy to help personally.