Port forwarding vs hosting, and custom domains with SRV
Updated September 2026 · Port forwarding opens your home to the internet. A host skips it. An SRV record makes either one reachable with a short name.
Why friends cannot just join your home server
Your router hides every device at home behind one public IP address. When a friend connects to that address, the router does not know which device should get the connection, so it drops it. Port forwarding is a rule that says: traffic on port 25565 goes to this PC.
Port forwarding, step by step
-
Give your server PC a fixed local IP. In your router, reserve the current IP for that PC (often called DHCP reservation). Otherwise the rule breaks when the IP changes.
-
Open the router settings. Usually
192.168.0.1or192.168.1.1in a browser; the address is often printed on the router. -
Find the port forwarding section. Routers name it differently: port forwarding, port sharing, virtual server, NAT.
-
Add the rules:
Edition Port Protocol Java 25565 TCP Bedrock or Geyser 19132 UDP -
Allow Java through the PC’s firewall when Windows asks, or add a rule for the port.
-
Find your public IP (search “what is my IP”) and give it to friends.
-
Test from outside, for example with a phone on mobile data, not your Wi-Fi.
When port forwarding does not work
- CGNAT. Many providers, especially mobile and fibre, share one public IP between several customers. You cannot forward ports then. Sign: the WAN IP in your router differs from what “what is my IP” shows. Some providers switch you to a public IP on request.
- Double router. A provider modem plus your own router means forwarding on both, or putting one in bridge mode.
- Dynamic IP. Your public IP changes from time to time, and the address you shared stops working. A dynamic DNS service helps.
- Joining from inside your own network with the public IP may fail on some routers. Use the local IP at home.
The risks
- Everyone who has your address knows your home IP.
- Anyone scanning the internet can find the open port. Keep the whitelist on and
online-mode=true. - A DDoS on your server hits your whole home connection.
The alternative: a hosted server
A hosted server already has a public address. No router, no firewall rules, no CGNAT, and your home IP stays private. That is why hosted servers need no port forwarding at all. If you want a quick comparison of the options, how to host a Minecraft server for friends lays them side by side.
Custom domain: play.yourname.com
An IP like 203.0.113.10:25612 is hard to remember. With a domain you own, friends type play.yourname.com instead. You set this up in your domain’s DNS settings (at the registrar or a DNS provider like Cloudflare).
Case 1: the server uses port 25565
A simple A record is enough:
| Type | Name | Value |
|---|---|---|
| A | play | your server’s IP |
Java uses 25565 by default, so play.yourname.com works as it is.
Case 2: the server uses another port
Hosted servers on a shared IP often have a port other than 25565. Then you need an A record and an SRV record:
| Type | Name | Value |
|---|---|---|
| A | mc | your server’s IP |
| SRV | _minecraft._tcp.play |
priority 0, weight 5, port 25612, target mc.yourname.com |
Now play.yourname.com points to mc.yourname.com on port 25612. Players type the short name without a port.
Rules that trip people up:
- The SRV target must be a hostname with an A record, not an IP address.
- Some DNS panels want service
_minecraftand protocol_tcpin separate fields, and add your domain automatically. Then the name is justplay. - On Cloudflare, the A record must be DNS only (grey cloud). The orange proxy does not pass Minecraft traffic.
- DNS changes can take from minutes to a few hours to reach everyone.
Bedrock and SRV
Bedrock does not read SRV records. Bedrock players need an A record plus the port, or a server on 19132. A server with its own IP address can usually run on the default ports, so neither edition needs a port in the address.
Checking it works
- Add the domain in your multiplayer list and refresh.
- If it fails but the IP and port work, the DNS is the problem: check spelling of
_minecraft._tcp, the target, and wait a bit. - Still stuck? Go through server not showing up: fixes. For moving to a new server, update the A record and migrate your world.