🌐
VPS

When you launch a Minecraft Java Edition server, the default port is 25565, so players can join by typing just the domain name. But if you run on a non-default port (multiple servers on one machine, or a VPS assigning ports), players must type play.example.com:25577, which is hard to remember and looks unpolished. The cleanest fix is a DNS SRV record, which tells the Minecraft client automatically which host and port to connect to, so players only ever type play.example.com.

What an SRV record is and how it works

An SRV (Service) record is a standard DNS record defined in RFC 2782 that specifies where a given "service" runs, in terms of host and port, rather than pointing only at an IP like an ordinary A record. An SRV record carries priority, weight, port and target. The Minecraft Java client always looks up an SRV record named _minecraft._tcp.<name-the-player-typed> first; if found, it connects to the specified port without the player ever needing to know it.

The key detail is that an SRV record does not point at an IP directly. It points at a hostname (the target), which must in turn resolve through an A record (or AAAA for IPv6). That is why setup always has two steps.

Step 1: Create an A record for the host first

First you need a hostname that points to the server's IP, for example a subdomain mc.example.com pointing at the real IP.

; A record — point the hostname at the server IP
mc.example.com.        3600  IN  A     203.0.113.45

; add AAAA if you have IPv6
mc.example.com.        3600  IN  AAAA  2001:db8::45

This mc.example.com name is used as the SRV record's target in the next step. Remember: the target must be a hostname only. Never put an IP address there directly.

Step 2: Create the SRV record for Java Edition

The Minecraft Java SRV record has these parts: the service is _minecraft, the protocol is _tcp, followed by the subdomain players will type (for example play). Here is the BIND-style zone line:

; SRV record — priority weight port target
; full name: _minecraft._tcp.play.example.com
_minecraft._tcp.play   IN  SRV  0 5 25577 mc.example.com.

This line reads: when a player types play.example.com, the client should connect to host mc.example.com on port 25577, with priority 0 and weight 5. Note the target always ends in a dot (.) to mark it as a fully qualified name (FQDN).

What each field in the SRV record means

FieldExample valueMeaning
Service_minecraftService name, always prefixed with an underscore; fixed for Minecraft
Proto_tcpProtocol; Java uses _tcp (Bedrock uses _udp)
NameplayThe subdomain players type; leave blank or use @ for the root domain
TTL3600Cache time in seconds; lower updates faster but queries more often
Priority0Lower value is preferred; orders multiple servers; usually 0
Weight5Balances load when priorities are equal; usually 5
Port25577The real port your server listens on
Targetmc.example.com.Destination hostname; must have an A/AAAA record and end in a dot

The golden rule of a Minecraft SRV record: Service = _minecraft, Proto = _tcp (Java), Target = a resolvable hostname, not an IP. Remember just those three and the rest is only the quirks of each DNS panel.

How to enter it in DirectAdmin, Cloudflare and registrars

Every DNS panel presents SRV fields differently: some split them into separate boxes, some combine them into one line. That is where people most often get it wrong.

DirectAdmin

In DirectAdmin, go to DNS Management and choose record type SRV. Typically you enter _minecraft._tcp.play in the Name box and 0 5 25577 mc.example.com. (priority weight port target) in the Value box. Some versions break out a separate Priority field, in which case enter only 5 25577 mc.example.com. in Value.

Cloudflare

Cloudflare splits the fields clearly, with separate boxes for Service (_minecraft), Protocol (TCP), Name (play or @), TTL, Priority, Weight, Port and Target. Fill each box directly, and set the record to DNS only (grey cloud), because the Cloudflare proxy does not support the Minecraft port.

Domain providers / registrars

Many registrars combine everything into a single line, or ask for the full Name; some auto-fill the service/proto when you pick record type SRV. Read each panel's example and do not repeat _minecraft._tcp if the system already adds it.

At AsiaGB we manage DNS through DirectAdmin and we do not force Cloudflare, so you can add an SRV record yourself straight from DNS Management. Linux VPS plans start at 500 THB/month, run on SSD, and are backed by a 99% uptime guarantee.

Verify the SRV record with dig or nslookup

After configuring, do not assume it works — always query to confirm. On Linux/macOS use dig:

$ dig SRV _minecraft._tcp.play.example.com +short
0 5 25577 mc.example.com.

# or the full output
$ dig SRV _minecraft._tcp.play.example.com

# on Windows use nslookup
> nslookup -type=srv _minecraft._tcp.play.example.com

If the result shows priority, weight, port and target exactly as you set them, the SRV record has been published. Then run dig A mc.example.com to confirm the target resolves to the correct IP as well.

DNS propagation and TTL

New or edited records take time to spread worldwide, depending on the TTL — anywhere from a few minutes up to 48 hours. If you expect frequent changes, set a low TTL (say 300 seconds) at first and raise it once things are stable. While you wait, if dig still does not see the record, query a public resolver directly, e.g. dig SRV _minecraft._tcp.play.example.com @1.1.1.1.

How Bedrock Edition differs from Java

Bedrock Edition also supports SRV records, but it uses the _udp protocol and default port 19132, so the form is _minecraft._udp.play. However, to be honest, many Bedrock clients ignore SRV records, especially on consoles and mobile, making behavior inconsistent. The more reliable option is to have Bedrock players enter the port in the Port field on the add-server screen directly.

; example SRV for Bedrock (not honored by every client)
_minecraft._udp.play   IN  SRV  0 5 19133 mc.example.com.

Pitfalls and common misconceptions

An SRV record does not hide your server's IP. Anyone who queries DNS sees the target and can immediately resolve it to the real IP, so SRV is not DDoS protection. Hiding the real IP requires a separate proxy/anti-DDoS service — a different topic entirely.

Quick summary of the steps

  1. Create an A record so mc.example.com points at the server's IP.
  2. Create an SRV record _minecraft._tcp.play pointing at target mc.example.com. with the real port.
  3. Verify with dig SRV or nslookup -type=srv.
  4. Wait for propagation per the TTL, then players type just play.example.com.

That is all it takes for players to reach your Java Edition server by a short domain name, without ever memorizing a port number again.

Frequently Asked Questions

Do I need to create an A record before the SRV record?

Yes, always create it first, because an SRV record points at a hostname (the target), not an IP directly. That hostname, for example mc.example.com, must have an A record (or AAAA for IPv6) that resolves to the real IP; otherwise clients cannot connect even if the SRV record is perfectly correct.

Why do players still have to type a port after I set up the SRV record?

The usual causes are putting an IP in the target instead of a hostname, forgetting the trailing dot on the target in a zone file, repeating the service/proto, or DNS not having propagated yet. Check with dig SRV _minecraft._tcp.play.example.com first; if you do not see the record, wait for the TTL or query 1.1.1.1 directly.

Does an SRV record hide my IP to protect against DDoS?

No. An SRV record exposes the target, which resolves to the real IP through an ordinary DNS query, so it is not DDoS protection. To hide the real IP you need a separate proxy or anti-DDoS service, which is a completely different mechanism from SRV records.

Can Bedrock Edition use SRV records the same way Java does?

Bedrock supports them in theory using _minecraft._udp and default port 19132, but many Bedrock clients, especially on consoles and mobile, ignore SRV records, so it is unreliable. The safer approach is to have Bedrock players enter the port number in the Port field when adding the server themselves.

Ready to launch your Minecraft server?

AsiaGB Linux VPS (SSD, DirectAdmin, 99% uptime) from 500 THB/month — Thailand & Singapore datacenters for low ping, perfect for Minecraft servers of any size.

View VPS Plans

View all affordable VPS Thailand plans →