Ping a Specific Port

Solution 1:

You can't ping ports, as Ping is using ICMP which doesn't have the concept of ports. Ports belong to the transport layer protocols like TCP and UDP. However, you could use nmap to see whether ports are open or not

nmap -p 80 example.com

Edit: As flokra mentioned, nmap is more than just a ping-for-ports-thingy. It's the security auditers and hackers best friend and comes with tons of cool options. Check the doc for all possible flags.

Solution 2:

Open a telnet session to the specific port, for example:

# telnet google.com 80
Trying 74.125.226.48...
Connected to google.com.
Escape character is '^]'.

To close your session, hit Ctrl+].


Solution 3:

If you're on a windows installation with powershell v4 or newer, you can use the test-netconnection powershell module:

Test-NetConnection <host> -port <port>

Example: Test-NetConnection example.com -port 80

This cmdlet also has the alias tnc. Eg tnc example.com -port 80


Solution 4:

$ nc -vz google.com 80
Connection to google.com 80 port [tcp/http] succeeded!

Solution 5:

You can use PaPing:

http://code.google.com/p/paping

C:\>paping.exe www.google.com -p 80 -c 4
paping v1.5.1 - Copyright (c) 2010 Mike Lovell

Connecting to www.l.google.com [209.85.225.147] on TCP 80:

Connected to 209.85.225.147: time=24.00ms protocol=TCP port=80
Connected to 209.85.225.147: time=25.00ms protocol=TCP port=80
Connected to 209.85.225.147: time=24.00ms protocol=TCP port=80
Connected to 209.85.225.147: time=24.00ms protocol=TCP port=80

Connection statistics:
        Attempted = 4, Connected = 4, Failed = 0 (0.00%)
Approximate connection times:
        Minimum = 24.00ms, Maximum = 25.00ms, Average = 24.25ms

Tags:

Ping