Minecraft Connection Troubleshooting

A friend of mine was having trouble connecting to my Minecraft server with a very puzzling error:

Failed to connect to the server
Internal Exception: java.io.IOException: An existing connection was forcibly closed by the remote host

The friend could connect to the server and play just fine while on the university wifi network, but when they were home, they would get this error. We troubleshooted the obvious firewall issues, but that wasn’t the cause.

It dawned on me that this could be a DNS issue. Minecraft supports a DNS record type called SRV. SRV records are a way of declaring both the host of a particular service as well as the port, and I used them because I was running two server, and the vanilla server was on a nonstandard port 25566. To test my theory, I had her do the following:

  1. Open cmd
  2. Type nslookup to start the domain name lookup utility
  3. Type set type=srv to look for SRV records specifically
  4. Type _minecraft._tcp.myserver.example, where myserver.example was replaced with my server name

nslookup returned an error saying no SRV records were found. It should have returned the SRV record for my server, showing the address and port.

I believe her default DNS server at home did not support SRV record. To solve the problem, I had her change her DNS server to use Google’s public DNS server, and the problem resolved itself.

I have written this blog post hoping that someone will be searching the internet like I was for that error and find this helpful.