PING is used to discover whether a remote host is able to respond to network traffic across the path between the source and destination of the ping.
All Platforms
ping <ip address> | PINGs a remote host by IP address. This will always succeed if the network path and the remote host are working and the PINGs are not being blocked. |
ping <host name> | PINGs a host by name. If DNS is working, this will succeed. |
BSD
This is the operating system for which ping was originally developed and all other versions of ping and traceroute are derived from it.Usage
usage: ping [-AaDdfnoQqRrv] [-c count] [-i wait] [-l preload] [-M mask | time]
[-m ttl] [-P policy] [-p pattern] [-S src_addr] [-s packetsize]
[-t timeout] [-z tos] host
ping [-AaDdfLnoQqRrv] [-c count] [-I iface] [-i wait] [-l preload]
[-M mask | time] [-m ttl] [-P policy] [-p pattern] [-S src_addr]
[-s packetsize] [-T ttl] [-t timeout] [-z tos] mcast-group
Results
% ping www.google.comOn a BSD system, the default operation of ping is to send 1 ping per second until it is stopped by pressing control-c.
PING www.google.akadns.net (216.239.41.104): 56 data bytes
64 bytes from 216.239.41.104: icmp_seq=0 ttl=248 time=18.952 ms
64 bytes from 216.239.41.104: icmp_seq=1 ttl=248 time=16.094 ms
64 bytes from 216.239.41.104: icmp_seq=2 ttl=248 time=15.321 ms
64 bytes from 216.239.41.104: icmp_seq=3 ttl=248 time=15.190 ms
64 bytes from 216.239.41.104: icmp_seq=4 ttl=248 time=28.476 ms
64 bytes from 216.239.41.104: icmp_seq=5 ttl=248 time=14.374 ms
^C
--- www.google.akadns.net ping statistics ---
6 packets transmitted, 6 packets received, 0% packet loss
round-trip min/avg/max/stddev = 14.374/18.068/28.476/4.873 ms
Windows
USAGE
Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS] [-r count] [-s count] [[-j host-list] | [-k host-list]] [-w timeout] target_name Options: -t Ping the specified host until stopped. To see statistics and continue - type Control-Break; To stop - type Control-C. -a Resolve addresses to hostnames. -n count Number of echo requests to send. -l size Send buffer size. -f Set Don't Fragment flag in packet. -i TTL Time To Live. -v TOS Type Of Service. -r count Record route for count hops. -s count Timestamp for count hops. -j host-list Loose source route along host-list. -k host-list Strict source route along host-list. -w timeout Timeout in milliseconds to wait for each reply.
A significant difference between Windows ping and ping on other platforms
is that Windows does not offer the option to select the interface from which
to ping other hosts, in other words, Windows choses which interface to use
for a ping, not the user. This makes troubleshooting network problems on a
Windows device with multiple interfaces difficult. You must shut down the
interface you do not wish to use before performing the ping.
Windows also uses ping -a to perform reverse resolution of an address to a name. This utilizes WINS first, then DNS. Windows also defaults to a time to live of 255.
Ping Results
Pinging www.google.akadns.net [216.239.41.104] with 32 bytes of data:
Reply from 216.239.41.104: bytes=32 time=17ms TTL=248 Reply from 216.239.41.104: bytes=32 time=14ms TTL=248 Reply from 216.239.41.104: bytes=32 time=26ms TTL=248 Reply from 216.239.41.104: bytes=32 time=17ms TTL=248
Ping statistics for 216.239.41.104: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 14ms, Maximum = 26ms, Average = 18m
Solaris
Usage
usage: ping host [timeout]
usage: ping -s [-l | U] [adLnRrv] [-A addr_family] [-c traffic_class]
[-g gateway [-g gateway ...]] [-F flow_label] [-I interval]
[-i interface] [-P tos] [-p port] [-t ttl] host [data_size] [npackets]
Results
% ping www.google.com www.google.com is alive
Note that ping on Solaris returns only one result with no data. It differs significantly from the original version developed by Mike Muss for BSD.
Red Hat
Usage
Usage: ping [-LRUbdfnqrvV] [-c count] [-i interval] [-w wait]
[-p pattern] [-s packetsize] [-t ttl] [-I interface address]
[ -T timestamp option ] [ -Q tos ] host
Results
PING www.google.akadns.net (64.233.161.104) from 10.80.2.25 : 56(84) bytes of data. 64 bytes from 64.233.161.104: icmp_seq=0 ttl=243 time=7.683 msec 64 bytes from 64.233.161.104: icmp_seq=1 ttl=243 time=24.886 msec 64 bytes from 64.233.161.104: icmp_seq=2 ttl=243 time=7.705 msec 64 bytes from 64.233.161.104: icmp_seq=3 ttl=243 time=7.578 msec
--- www.google.akadns.net ping statistics --- 4 packets transmitted, 4 packets received, 0% packet loss round-trip min/avg/max/mdev = 7.578/11.963/24.886/7.461 ms