Minecraft server addresses, ports and SRV records explained
How the game turns an address into a connection, what port 25565 is, how SRV records hide a port, and why home hosting needs port forwarding.
When you type a server address into Minecraft and press Join, a few things happen in a fraction of a second. Knowing what they are explains most connection problems — and why some addresses need a port on the end while others do not.
From address to connection
- DNS lookup. The game asks the internet’s phone book (DNS) which IP address the name points to —
play.example.combecomes something like203.0.113.25. - SRV check. If you did not type a port, Java Edition first asks DNS whether the name has an SRV record that names a different host or port.
- Connect. The game opens a TCP connection to that IP on the port — 25565 unless something says otherwise.
- Handshake. The first thing the game sends is a short “handshake” containing your Minecraft version and the address you typed. Then it either asks for the server’s status (for the server list) or starts logging in.
Port 25565
A port is like a door number on a machine: one IP address can run many services, each listening on its own port. Java Edition servers listen on 25565 by default, which is why play.example.com and play.example.com:25565 mean the same thing.
A server on a different port must be typed with it: play.example.com:25570. Getting the port wrong gives “Connection refused” or a timeout, because nothing is listening at that door.
Bedrock Edition is different: it uses UDP on port 19132 by default. That is part of why the two editions cannot join each other’s servers directly — see Can Bedrock players join a Java server?.
SRV records: hiding the port
If a server runs on an unusual port, an SRV record lets players connect without typing it. It is a DNS entry on your domain that says “Minecraft for this name lives at this host and port”:
_minecraft._tcp.play.example.com → priority 0, weight 5, port 25570, target node1.example.com
Now play.example.com alone takes players to port 25570. You create it in your domain’s DNS settings, where you would add any other record. Two things to know: only Java Edition reads SRV records, and the target must be a name, not a bare IP — point it at a name with its own A record.
Why the name matters
Because the handshake carries the address the player typed, one IP and one port can serve many different servers — the server at the other end reads the name and routes the player to the right one, the way a web server hosts many websites on one IP.
That is how Cobbly works: every free server is reached through the same entry point, and the name — yourname.cobbly.net — is what tells it which server you want, and whether to wake it. Always connect with the name. An IP address on its own does not say which server you meant. How to connect to your server covers the errors you might see.
Hosting at home: port forwarding
If you run a server on your own PC, other people cannot reach it just by knowing your address. Your router stands between your PC and the internet, and by default it refuses connections that start from outside. You need to:
- Give your PC a fixed local IP in the router’s settings, so it does not change.
- Add a port forward in the router: TCP port 25565 to that PC’s local IP.
- Allow Java through your PC’s firewall when it asks.
- Give friends your public IP — what “what is my IP” websites show — not the 192.168… one.
Two things commonly stop this working:
- CGNAT. Many internet providers, especially mobile and some fibre ones, share one public IP between many customers. Port forwarding is then impossible, whatever you set in the router. If the WAN IP your router shows is different from what websites say your IP is, you are behind CGNAT.
- A changing IP. Home IPs change from time to time, and the address you gave your friends stops working. A dynamic DNS service gives you a name that follows your IP.
This is the main reason people use a host instead: the address is fixed, there is nothing to forward, and your home IP is never shared with players.
Quick fixes
- Unknown host — the name does not exist in DNS. Check the spelling.
- Connection refused — the address is right but nothing is listening on that port. Wrong port, or the server is not running.
- Timed out — something between you and the server is silently dropping the connection: a firewall, a missing port forward, or a network that blocks games (school and work networks often do).