# Minecraft Connection Refused getsockopt Fix (and Timed Out)

Fix "Connection refused: getsockopt" and "Connection timed out: getsockopt" in Minecraft. What each error means and the checks that solve it, in order.

Updated 2026-09-30. https://gamezservers.com/guides/minecraft-connection-refused-getsockopt

"Connection refused: getsockopt" in Minecraft means your game reached the address you typed, but nothing on that port answered: the server is offline, the port is wrong, or you are pointing at the wrong machine. "Connection timed out: getsockopt" is different: your connection never got an answer at all, which usually means a firewall, missing port forwarding or a wrong IP. This guide explains both and walks through the fixes in the order that solves them fastest.

## What the error looks like

After clicking your server, Minecraft shows **Failed to connect to the server** with one of these lines underneath:

```
io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: getsockopt
```

```
io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection timed out: getsockopt
```

You might also see `Connection refused: no further information`. That is the same error as the first one, printed by older Java versions. The `getsockopt` part is just the name of the network call that failed, so you can ignore it. What matters is **refused** versus **timed out**.

| Error | What happened | Usual cause |
| --- | --- | --- |
| Connection refused | A computer answered and said no | Server offline, wrong port, server still starting |
| Connection timed out | Nobody answered at all | Wrong IP, firewall, port not forwarded, CGNAT |

## Quick fix

Work down this list and try to join after each step:

1. **Is the server running?** Check it shows **Online** and the console says `Done`.
2. **Did you include the port?** Paste the full address, for example `123.45.67.89:25601`. Without a port Minecraft tries 25565.
3. **Is the address exact?** No typos, no spaces, no `localhost` or `127.0.0.1` unless the server runs on the same PC.
4. **Is Java allowed through your firewall?** On Windows, allow **Java(TM) Platform SE binary** for private and public networks.
5. **Self hosting?** Check port forwarding and that friends use your public IP, not `192.168.x.x`.

Most people are fixed by step 1 or 2.

## Fix 1: Make sure the server is actually online

"Connection refused" most often means there was nothing to connect to.

- **Hosted server:** open your dashboard and check the status. GamezServers servers with **Sleep when empty** turned on stop after 4 days with nobody online. Anyone with access can press **Start**, wait for the console to print `Done`, and join.
- **Home server:** look at the server window. If it closed, crashed or is still loading the world, you get refused. Wait for `Done (12.345s)! For help, type "help"` before joining.
- **Just changed something?** A bad plugin, mod or Java version can crash the server on start. Read the last lines of the console or `logs/latest.log` for the real error.

## Fix 2: Use the right address and port

Every server has an IP and a port. The default Minecraft port is `25565`, but hosted servers and anyone running several servers use other ports.

- Paste the whole address including the colon and the number after it.
- In **Multiplayer**, click the server, then **Edit**, and check the address for typos and trailing spaces.
- If the server moved, delete the old entry and add it again. Old entries are a common cause after a host change.
- If you use a domain name, it must point at the right IP. A domain that does not resolve gives a different error, "Can't resolve hostname".

## Fix 3: Check the firewall on your PC

Windows Defender Firewall and third party antivirus can block Java, which stops you joining any server.

1. Open **Windows Security**, then **Firewall and network protection**, then **Allow an app through firewall**.
2. Click **Change settings** and find every **Java(TM) Platform SE binary** entry.
3. Tick both **Private** and **Public**, then click **OK**.

If you use antivirus with its own firewall, such as Norton or McAfee, add the same exception there. Also try a different network, such as your phone's hotspot. If it works there, your home network or school network is blocking Minecraft.

## Fix 4: Self hosting? Check port forwarding

If you host the server on your own PC and friends get **timed out** while you can join, the router is dropping their connections.

1. Find the server PC's local IP with `ipconfig` on Windows, for example `192.168.1.20`.
2. Forward **TCP 25565** (or your chosen `server-port`) on your router to that IP.
3. Allow Java through the firewall on the server PC, as above.
4. Give friends your **public** IP, found by searching "what is my IP". Your `192.168.x.x` address only works inside your home.

Our [port forwarding guide](https://gamezservers.com/guides/how-to-port-forward-a-game-server) walks through the router side. If forwarding looks right and still fails, your internet provider may use CGNAT, which shares one public IP between many homes and makes forwarding impossible without calling them. This is exactly the problem a hosted server avoids: it has its own public address, so there is nothing to forward.

Two more self hosting traps:

- **`server-ip` in `server.properties`:** leave it empty. Setting it to the wrong address makes the server listen where nobody connects.
- **Testing from inside your own network:** many routers cannot connect to their own public IP. Test from a phone on mobile data, or join yourself with `localhost`.

## Fix 5: Check the version and the account

Version problems usually show their own message ("Outdated client", "Incompatible client"), but it is worth ruling out:

- Make sure you use Minecraft: Java Edition. Bedrock cannot join a Java server unless the owner installed Geyser, and then Bedrock players connect to its own port.
- Match the server version. See [how to fix outdated server and client errors](https://gamezservers.com/guides/minecraft-outdated-server-outdated-client).

## Fix 6: Reset your network

When one PC cannot join anything while others on the same Wi-Fi can:

1. Restart your router and PC.
2. Open Command Prompt as administrator and run:

```
ipconfig /flushdns
netsh winsock reset
```

3. Restart the PC again.
4. Turn off any VPN or proxy and try again.

## Still not working?

- **You can join, friends cannot:** port forwarding, CGNAT, or they are using your local IP.
- **Friends can join, you cannot:** your firewall, antivirus, VPN or network.
- **Nobody can join:** the server is offline, crashed or on a different port than you think. Check the console.

## The easy way

Most "getsockopt" errors on home servers come down to port forwarding, firewalls and a PC that went to sleep. A hosted server removes all three: it runs in a data center with its own address and port, there is nothing to forward, and it stays online when you log off. See [Minecraft server hosting](https://gamezservers.com/games/minecraft), or follow [how to host a Minecraft server](https://gamezservers.com/guides/how-to-host-a-minecraft-server) for the step by step.

## FAQ

### What does getsockopt mean in Minecraft?

It is the name of the low level network call Java uses to check a connection. It shows up in the error text but tells you nothing about the cause. Look at whether the message says refused or timed out.

### Is "Connection refused: no further information" the same error?

Yes. Older Java versions print "no further information", newer ones print "getsockopt". The fixes are the same.

### Why can I join my own server but my friends cannot?

You are joining over your home network. Your friends come in from the internet, which needs port forwarding and your public IP. On a hosted server everyone uses the same address.

### Can a VPN cause getsockopt errors?

Yes. Some VPNs block game ports or route you somewhere that cannot reach the server. Turn it off and try again.
