No More Ping! How to Test Connection with Specified Port Number

Ping command that is often used to test connection is a program with ICMP protocol.

But ping doesn’t have the concept of ports.

That is why you can not vefiry network connection with ping, if a server does not allow ICMP protocol connection or you want to check a specified port connection.

So if you want to specify a certain port, you should use other commands such as netcat and curl which are frequently used in Linux.

nc(netcat)

How to Use

nc -vz [ip or domain] [port]

-v : show more precisely information.

-z : scan only port scan.

Exapmle

nc -vz www.google.com 80

curl

How to Use

curl -I [ip or domain]:[port]

-I : show only information of response header.

Exapmle

curl -I www.google.com:80

Related Posts