PING – Windows CMD Command

Test a network connection – if successful, ping returns the IP address.

A response of “Request timed out” means there was no response within the default time period.

A successful PING does NOT always return an %errorlevel% of 0Therefore to reliably detect a successful ping, pipe the output into FIND and look for the text “TTL”

Note that “Reply” in the output of PING does not always indicate a positive response.
Example message: Reply from 192.168.1.254: Destination Net Unreachable.

Ping defaults to an ICMP timeout of 4000ms or 4 seconds. When specifying very small numbers (<500) for a timeout with -w, the Ping reply can be received even if timeout milliseconds have elapsed.

Timeout

When pinging a host that doesn’t exist or is offline there will be a delay of some seconds before it is returned as ‘host not found’.

The PING -w and the WMI Get-CIMInstance Win32_PingStatus timeout=NNN options both offer to control the Timeout, but this is the ICMP timeout, not the DNS client timeout.

When successfully contacting a host, the ICMP timeout is used (default typically 4 seconds) but when attempting to PING a non-existent or offline computer it will be a DNS timeout causing the delay, typically around 9 – 10 seconds.

The time to respond as ‘host not found’ is for the first response, once you have pinged a host once, DNS will cache the (non) response and respond much faster to a second PING.

The performance of PING, Get-CIMinstance, PSPING, and Test-Connection (PowerShell) are all comparable, the only difference being that PING and Get-CIMinstance allow modifying the ICMP timeout.

How to test connectivity with ping:

1) Ping the loopback address to verify that TCP/IP is installed and configured correctly on the local computer.
PING 127.0.0.1

2) Ping the IP address of the local computer to verify that it was added to the network correctly.
PING IP_address_of_local_host

3) Ping the IP address of the default gateway to verify that the default gateway is functioning and that you can communicate with a local host on the local network.
PING IP_address_of_default_gateway
4) Ping the IP address of a remote host to verify that you can communicate through a router.
PING IP_address_of_remote_host

Use PING to create a time delay:

Create a delay of 1 or more seconds by pinging the loopback address (127.0.0.1) multiple times.
The delay between each ping is 1 second, so for a delay of 5 seconds ping 6 times:
PING -n 6 127.0.0.1>nul
In tests, this consumes less processor time than Sleep or Timeout – see Clay Calvert’s original newsgroup posting.

Ping response times below 10 milliseconds often have low accuracy. A time of 10 milliseconds is roughly equal to a distance of 1860 Miles, traveling a straight line route at the speed of light, (or a round trip of 2 × 930 miles). From this, you can see that ping response times will give a very very rough estimate of the distance to a remote host.

Network administrators do not appreciate frequent or continual pings to their servers, try not to overdo it!

The IPv6 options are only available on versions of Windows that support IPv6.

The script above can be used to test an Internet connection, just replace example.com with your ISP’s Default Gateway IP address. This represents the first physical device on the ISP’s side of your connection. You can find the Default Gateway on your router status screen.

PING is named after the sound that a sonar makes.

You may also like...

12 Responses

  1. Margart says:

    Having read this I thought it was rather enlightening.
    I appreciate you taking the time and effort to put this
    content together. I once again find myself spending a lot
    of time both reading and commenting. But so what, it was still worth it!

  2. Arlene says:

    Yes! Finally someone writes about website.

  3. rolex replica forum says:

    optimal content, i like it

  4. Terra Ellestad says:

    superb article, i like it

  5. Yoshie Cohens says:

    complete content, i like it

  6. replica.is says:

    fabulous article, i like it

  7. sbobet says:

    I like the valuable information you provide in your articles.
    I will bookmark your weblog and check again here regularly.
    I’m quite sure I will learn plenty of new stuff right here!

    Good luck for the next!

  8. zortilo nrel says:

    I dugg some of you post as I cerebrated they were handy very beneficial

  9. froleprotrem says:

    It’s in point of fact a great and useful piece of information. I am satisfied that you shared this helpful info with us. Please keep us informed like this. Thank you for sharing.

  10. 우리카지노 says:

    Howdy! This post couldn’t be written any better!

    Reading through this post reminds me of my previous room
    mate! He always kept chatting about this.
    I will forward this post to him. Fairly certain he will have a good read.
    Thank you for sharing!

  11. 바카라사이트 says:

    My spouse and I stumbled over here coming from a
    different website and thought I might as well check things out.
    I like what I see so now i’m following you. Look forward to exploring your web page repeatedly.

  12. ปั้มไลค์ says:

    Like!! Thank you for publishing this awesome article.

Leave a Reply

Your email address will not be published. Required fields are marked *