Guide
10 min readAug 20, 2026

How to Fix the Getsockopt Minecraft Error

Read the words before getsockopt, then follow the exact fix for a timed-out, refused, or unreachable Minecraft Java connection.

Start with the full error

Which getsockopt message do you see?

Match the words before getsockopt to one of the errors below: timed out means no reply, refused means the port rejected the connection, and network is unreachable means this PC has no working route.

Fix Connection timed out: getsockopt

Minecraft sent a connection request but received no reply before the deadline. Choose your setup and run its checks in order.

If you are joining someone else's Minecraft server

Use the same Minecraft version and server address for all three checks.

  1. 1

    Can anyone else join the same server?

    Ask another player to join now, or check the server's live status page or Discord. If nobody can join, send the owner your complete error. If another player connects, continue to the address check.

  2. 2

    Copy the current address and port

    Copy the address from the owner or host panel. Include any number after the colon, such as play.example.net:25570. If the owner provides a direct IP and port, try it once; a working direct IP points to a domain or SRV record problem.

  3. 3

    Retry the same address through a phone hotspot

    On the same PC, keep the Minecraft version and address unchanged. Connect through a phone hotspot and join again.

What the result means

  • Nobody can join: the server owner or hosting provider needs to restore the server or correct its address.
  • The hotspot also fails: try one known-working public server. If that works, the original server or address is the problem. If every server fails on both networks, reconnect Minecraft and check the Java or security-app permission on this PC.
  • The same server works on the hotspot: your usual network path is the difference. Use the route option directly below.

The hotspot works: replace the failing route

Connect Proton VPN to a nearby location, enable Moderate NAT on a paid plan, and retry the same Minecraft address. The tunnel replaces the Wi-Fi or ISP route that timed out.

Proton VPN

For players whose usual Wi-Fi times out while the same server works through a phone hotspot.
  • Nearby VPN route with paid Moderate NAT for multiplayer compatibility
  • 30-day money-back guarantee.

If you are joining a Minecraft LAN world

Work from the computer hosting the world, then retry Direct Connection from the second computer after every step.

  1. 1

    Reload the world and open it to LAN again

    On the host, choose Save and Quit to Title, reload the world, select Open to LAN, and note the port printed in chat. Use this new port; it can change each time the world is reopened.

  2. 2

    Use the host's IPv4 address and current LAN port

    On the host, run ipconfig and copy the IPv4 Address under the active Wi-Fi or Ethernet adapter. On the second PC, choose Direct Connection and enter IPv4:port, for example 192.168.1.50:52143.

  3. 3

    Put both computers on the same home network

    Use the same router and avoid guest Wi-Fi. On a Windows host, mark this trusted home connection as Private. If the router has client or AP isolation enabled, turn it off for the home network.

  4. 4

    Allow the current Java app on the host

    In Windows Security, open Firewall & network protection, then Allow an app through firewall. Allow the Java or OpenJDK executable Minecraft is currently using on Private networks. On a macOS or Linux host, allow the same incoming Java process or LAN port in that host's firewall.

Still timing out? Check the host firewall log and the router's client-isolation setting, then retry the latest IPv4:port.

If friends cannot join your self-hosted Minecraft server

Keep the Java server online. Test the three addresses in order, fix the first failed test, and then continue.

  1. 1

    On the server PC, join localhost:port

    Use the port in server.properties. If localhost fails, wait until the console says Done, confirm server-port, and leave server-ip blank. When localhost connects, continue to the LAN test.

  2. 2

    From another home device, join private-IP:port

    Use the server PC's current private IPv4 address. If this fails while localhost works, allow the Java server or its TCP port through the host firewall, confirm the server is listening beyond localhost, and reserve that private IP in the router.

  3. 3

    From mobile data, join public-IP:port

    Disconnect the test device from home Wi-Fi or ask a friend outside your network. If localhost and LAN work but this test times out, the failure is now limited to the public inbound path.

Configure Minecraft port forwarding

Forward the server's configured TCP port to its reserved private IPv4 address, keep the host firewall rule enabled, and test again from outside the home network while the server is online.

Set up Minecraft TCP port forwarding

After forwarding, check upstream NAT

Compare the router's WAN IPv4 address with your current public IPv4 address.

  • They match: repair the forwarding target, TCP port, or host firewall rule, then retest.
  • They differ, or the WAN address is private or in 100.64.0.0/10: an upstream router or CGNAT is likely. Configure both routers, ask the ISP for public IPv4, or use an incoming VPN port below.

Need an incoming port through CGNAT or an upstream router?

Run the VPN on the Minecraft server PC and choose the port behavior that fits your server.

Proton VPN

Best when one assigned Minecraft port is enough and you can update it after reconnecting.
  • Paid Port Forwarding supplies one active port on supported P2P servers
  • Set server-port to the assigned port, restart the Minecraft server, and allow that TCP port
  • 30-day money-back guarantee.

PureVPN

Best when you want TCP 25565 or another selected Minecraft port.
  • Paid Port Forwarding add-on on supported VPN locations
  • Open the same TCP port used by Minecraft and allow it in the host firewall
  • 31-day money-back guarantee.

Keep the server online. After router forwarding, test public-IP:port from mobile data. For VPN forwarding, test and share VPN-IP:port.

Fix Connection refused: getsockopt

A refusal usually appears quickly. The address responded, but Minecraft was not accepting connections on that port. Check the server status and exact port.

If you are joining a server or LAN world

Copy the current address and port again and ask whether the server is fully online. For a LAN world, the host should save and reload the world, open it to LAN again, and give you the new port. If every player gets refused, the owner needs to fix the server.

If you run the server

Wait for Done in the console, then join localhost:server-port. Confirm server-port and leave server-ip blank. If localhost is refused, check the startup log and listening port, then retry.

After localhost works, repeat the private LAN test and then the external test. An external-address refusal points to the router rule; make it use the same private IP and TCP port as Minecraft.

Fix Network is unreachable: getsockopt

The computer trying to join has no usable route to the destination. Restore its network connection.

  1. 1

    Check that ordinary websites open

    Reconnect Wi-Fi or Ethernet, confirm the correct adapter and network are active, and open a website. Then retry Minecraft.

  2. 2

    Reset the route you are currently using

    Disconnect and reconnect any existing VPN, proxy, Hamachi, Radmin, or other virtual adapter. A stale virtual route can send Minecraft toward a network that is no longer available.

  3. 3

    For LAN, reconnect to the host's local network

    Join the same non-guest home network as the host and use the host's local IPv4 address plus the current Open to LAN port.

  4. 4

    Retry the exact address and read the new message

    If the error changes to timed out, follow the matching public-server or LAN path above. If it changes to refused, verify that the server is online and listening on the port you entered.

Aternos, virtual LANs, Docker, and mods

Open the item that matches your setup.

Minecraft getsockopt FAQ

Official references

Error meanings and configuration details were checked against the platform and provider documentation below.

Share this article