Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I telnet one port of my server, it give me an error: "Connection closed by foreign host", anyone can tell the reason ? thanks!

share|improve this question
sorry ! the problem is gone ! – larry Jan 19 '11 at 2:13
You have provided next to no information and are expecting an answer?? – Sameer Jan 19 '11 at 2:28
up vote 0 down vote accepted

Given only the informational message from telnet, most likely, the application that accepted your tcp connection either closed the connection on it's own accord or the application crashed/died.

The reason is that all "Connection closed by foreign host." by itself indicates is that the telnet application is of the opinion that the connection was shut down cleanly and the remote end initiated the shutdown. (And the OS/IP-stack (at least on my linux) will do a tcp-teardown if the application suddenly disappears, kill -9). To find out exactly why, your best bet would be if the application that listens to the port you telneted to logs somewhere and looking there for clues.

If this were to be network related you'd be far more likely to see something along the lines of timeout (or nothing happening at all) or connection reset by peer. If this somehow were caused by something along the network, that something would have to sort-of hijack your tcp-session to do the teardown handshake.

share|improve this answer

The packets weren't reaching the server for one reason or another. It could have been transient network problems, a loop somewhere between you and the server, a mis-configured firewall... with this little information it's impossible to tell.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.