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

How do I check if a port is consistently alive? For example, I could use

ping -t > results.txt

This will ping continuously so that I could monitor it.
Is there an equivalent tool or command that I could use for this?

Currently I use telnet but sometimes the host disconnects it. I need a Windows solution.

share|improve this question
Is it a specific port you need to check e.g. port 80 for http or port 21 for ftp, or is it a specific IP address you need to check i.e. to test if the host is reachable. The latter is what your above example is doing. – Chris Feb 8 '11 at 13:16
i'm wanting to check a specific port if it is open. – grassbl8d Feb 8 '11 at 13:29

You could use netcat if there is a Windows version - on Linux I use:

nc -z <host> <port>

This returns 0 if the port is open. Run this in a loop for make it continuous.

If Powershell is available, see for an example.

share|improve this answer
ping every second a host on a port and return 0 if successfully so, 1 else: while (:); do nc -z HOSTNAME_HERE PORT_HERE; echo $?; sleep 1; done – sjas Jun 8 '15 at 14:59

Or use nmap from , there is a windows version available.

nmap -p port host

or, for hosts not responding to ICMP requests,

nmap -P0 -p port host

share|improve this answer

You could use nping from nmap like:

C:\>nping --tcp -p 80

where -p specifies the port to scan (here: 80). Furthermore you can use -H for hiding sent packets, in favor of showing only replies.

share|improve this answer

telnet <host> <port> will check remote <host> for a TCP listener on <port>.

share|improve this answer

If you want to go with stock command line utils, then TELNET will connect to a port for you. On the flip side, if there is service responding, then TELNET may 'hang' while waiting for you to supply the escape command sequence.

If you're open to installing new command line utils, then PaPing works as you want. It's cross platform, and there is a Windows installer available.

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.