Questions tagged [ping]

Ping is a computer network administration utility used to test the reachability of a host on an Internet Protocol (IP) network and to measure the round-trip time for messages sent from the originating host to a destination computer.

Ping is a computer network administration utility used to test the reachability of a host on an Internet Protocol (IP) network and to measure the round-trip time for messages sent from the originating host to a destination computer. The ping utility uses the network protocol, which is often filtered by firewalls, so its usefulness is usually limited in corporate environments.

Examples

ping -n 5 www.example.com #pings 5 times the server named www.example.com

A domain name or IP address can be used.

See also

References

2853 questions
654
votes
8 answers

Docker - Ubuntu - bash: ping: command not found

I've got a Docker container running Ubuntu which I did as follows: docker run -it ubuntu /bin/bash however it doesn't seem to have ping. E.g. bash: ping: command not found Do I need to install that? Seems a pretty basic command to be missing. I…
Snowcrash
  • 80,579
  • 89
  • 266
  • 376
522
votes
13 answers

How do I determine if a port is open on a Windows server?

I'm trying to install a site under an alternative port on a server, but the port may be closed by a firewall. Is there a way to ping out or in, on a specific port, to see if it is open?
Jason
  • 16,739
  • 23
  • 87
  • 137
261
votes
33 answers

Pinging servers in Python

In Python, is there a way to ping a server through ICMP and return TRUE if the server responds, or FALSE if there is no response?
Kudu
  • 6,570
  • 8
  • 27
  • 27
180
votes
5 answers

ping response "Request timed out." vs "Destination Host unreachable"

When I ping an IP address, what is the difference between Request timed out and Destination host unreachable returned from the command?
Suresh Kumar Veluswamy
  • 4,193
  • 2
  • 20
  • 35
172
votes
6 answers

Preferred Java way to ping an HTTP URL for availability

I need a monitor class that regularly checks whether a given HTTP URL is available. I can take care of the "regularly" part using the Spring TaskExecutor abstraction, so that's not the topic here. The question is: What is the preferred way to ping a…
Sean Patrick Floyd
  • 292,901
  • 67
  • 465
  • 588
140
votes
22 answers

How to test an Internet connection with bash?

How can an internet connection be tested without pinging some website? I mean, what if there is a connection but the site is down? Is there a check for a connection with the world?
lauriys
  • 4,652
  • 7
  • 32
  • 40
119
votes
5 answers

Using ping in c#

When I Ping a remote system with windows it says there is no reply, but when I ping with c# it says success. Windows is correct, the device is not connected. Why is my code able to successfully ping when Windows is not? Here is my code : Ping p1 =…
Black Star
  • 1,201
  • 2
  • 9
  • 6
114
votes
18 answers

Ping with timestamp on Windows CLI

On the Windows command prompt cmd, I use ping -t to 10.21.11.81 Reply from 10.21.11.81: bytes=32 time=3889ms TTL=238 Reply from 10.21.11.81: bytes=32 time=3738ms TTL=238 Reply from 10.21.11.81: bytes=32 time=3379ms TTL=238 Are there any…
SuicideSheep
  • 5,260
  • 19
  • 64
  • 117
102
votes
13 answers

Leave only two decimal places after the dot

public void LoadAveragePingTime() { try { PingReply pingReply = pingClass.Send("logon.chronic-domination.com"); double AveragePing = (pingReply.RoundtripTime / 1.75); label4.Text = (AveragePing.ToString() + "ms"); …
Sergio Tapia
  • 40,006
  • 76
  • 183
  • 254
102
votes
16 answers

How do I timestamp every ping result?

Ping returns this by default: 64 bytes from 203.173.50.132: icmp_seq=0 ttl=244 time=57.746 ms Is there some way I can get it to add the timestamp? For example, Mon 21 May 2012 15:15:37 EST | 64 bytes from 203.173.50.132: icmp_seq=0 ttl=244…
John Mee
  • 50,179
  • 34
  • 152
  • 186
96
votes
11 answers

Checking host availability by using ping in bash scripts

I want to write a script, that would keep checking if any of the devices in network, that should be online all day long, are really online. I tried to use ping, but if [ "`ping -c 1 some_ip_here`" ] then echo 1 else echo 0 fi gives 1 no matter…
burtek
  • 2,576
  • 7
  • 29
  • 37
93
votes
18 answers

Ping a site in Python?

How do I ping a website or IP address with Python?
user40572
  • 947
  • 1
  • 7
  • 3
93
votes
17 answers

How to ping an IP address

I am using this part of code to ping an ip address in java but only pinging localhost is successful and for the other hosts the program says the host is unreachable. I disabled my firewall but still having this problem public static void…
Mehdi
  • 1,001
  • 1
  • 8
  • 7
77
votes
2 answers

PHP: Why isn't exec() returning output?

I'm writing a PHP script to be used to check for network connections with Linux shell command ping calling it with PHP's exec():
Edward
  • 9,430
  • 19
  • 48
  • 71
72
votes
3 answers

How to ping ubuntu guest on VirtualBox

I have an VM (VirtualBox) with Ubuntu. Host machine is Windows 7. How can I ping my Ubuntu from host and vice versa? Trying to set "Bridged" connection type in VM settings but there is no effect, I only lose my internet connection in Ubuntu.
Rusty
  • 1,341
  • 4
  • 14
  • 16
1
2 3
99 100