How to Ping a Website From Command Prompt: ping vs tracert for Diagnosing Network Connectivity

Use ping first to check whether a website responds at all, then use tracert when you need to see where the connection slows down or breaks. On Windows, both commands run from Command Prompt and use network replies to expose problems that a browser hides behind vague errors. Microsoft describes ping as a tool that sends ICMP Echo Request messages and waits for replies [source: Microsoft]. That tiny test often tells you, in seconds, whether the issue is your PC, your router, your DNS, your ISP, or the remote server.

TLDR: Open Command Prompt, type ping example.com, and check whether you get replies, packet loss, and reasonable response times. If ping fails or looks slow, run tracert example.com to see each network hop between you and the website. For example, if a small office has 25 users and 80% report that a site feels slow, tracert may show delays starting at hop 3, pointing to the ISP instead of the website. Use ping for a quick yes or no, and tracert for the route story.

How to open Command Prompt

Press Windows + R, type cmd, and press Enter. You can also search for Command Prompt in the Start menu. You do not usually need administrator rights for basic ping or tracert tests.

Once the black terminal window opens, you can test a website by typing:

ping google.com

Replace google.com with the site you care about. You can use a domain name, such as example.com, or an IP address, such as 8.8.8.8.

What ping tells you

ping sends small test packets to a destination and measures how long the reply takes. The result usually includes four useful clues:

  • Reply from: The remote server or device answered.
  • Time: The round trip time in milliseconds.
  • TTL: Time to live, which roughly hints at how many network hops remain.
  • Packet loss: The percentage of packets that never came back.

A clean result may look like this:

Reply from 142.250.190.14: bytes=32 time=18ms TTL=116
Reply from 142.250.190.14: bytes=32 time=20ms TTL=116
Reply from 142.250.190.14: bytes=32 time=17ms TTL=116
Reply from 142.250.190.14: bytes=32 time=19ms TTL=116

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss)

This means the site is reachable from your machine. A response time under 50 ms is usually snappy for nearby servers. Around 100 to 200 ms may still be fine, especially across continents. Above 300 ms, web pages can start to feel sticky. If you see packet loss, even 5%, that can cause video calls, dashboards, and logins to behave badly.

Common ping results and what they mean

  • Request timed out: No reply arrived before the timeout. The site may block ping, or the route may be broken.
  • Destination host unreachable: Your computer or router cannot find a path to the target.
  • Ping request could not find host: DNS failed. The domain name did not resolve.
  • High time values: The server is reachable, but latency is poor.

The annoying part is that ping can fail even when a website loads in your browser. Some servers block ICMP traffic for security or traffic control. So a failed ping does not always mean the website is down. It means the ping test did not get a reply.

Useful ping command options

Windows gives you several switches that make ping more useful:

  • ping example.com -n 10 sends 10 requests instead of the default 4.
  • ping example.com -t keeps pinging until you stop it with Ctrl + C.
  • ping example.com -4 forces IPv4.
  • ping example.com -6 forces IPv6.
  • ping 8.8.8.8 tests an IP address directly and skips domain name lookup.

A smart test sequence is simple. First ping the domain. Then ping a known IP address. If ping google.com fails but ping 8.8.8.8 works, suspect DNS. Honestly, that one small comparison can save 20 minutes of pointless router restarts.

What tracert does differently

tracert, short for trace route, shows the path packets take to reach a website. It lists each hop, usually starting with your router, then your ISP, then backbone networks, then the destination network.

Run it like this:

tracert example.com

A result may look like this:

1     2 ms     1 ms     1 ms  192.168.1.1
2    12 ms    11 ms    13 ms  10.20.0.1
3    28 ms    75 ms    91 ms  isp-gateway.example
4     *        *        *     Request timed out.
5    93 ms    95 ms    94 ms  core-router.example
6   101 ms   104 ms   102 ms  example.com

Each line is one hop. The three time values are three attempts. Asterisks mean no reply for that attempt. One timed out hop is not always bad. Many routers deprioritize or block trace replies while still passing traffic forward.

Ping vs tracert: which should you use?

Use ping when you need a quick health check. Use tracert when you need to locate the rough area of failure.

Task Best command Why
Check if a website responds ping Fast and easy to read
Find packet loss ping -n 50 More samples show patterns
Find where delay begins tracert Shows hop by hop timing
Check DNS issues ping domain and ping IP Compares name lookup with direct IP

A practical troubleshooting flow

When a website refuses to load, try this order:

  1. Ping your router: Run ping 192.168.1.1. If this fails, your local network is the problem.
  2. Ping a public IP: Run ping 8.8.8.8. If this fails, your internet connection may be down.
  3. Ping the domain: Run ping example.com. If the IP works but the domain fails, suspect DNS.
  4. Run tracert: Run tracert example.com. Look for where timeouts or huge delays begin.
  5. Compare another site: Test a second domain. If only one site fails, the issue may be remote.

This method keeps you from guessing. It also helps when you need to send proof to an ISP, hosting provider, or internal IT team.

How to read latency and packet loss

Latency is delay. Packet loss is missing data. They are not the same problem, but they often appear together.

  • 0% packet loss: Good sign. The connection is stable during the test.
  • 1% to 2% loss: Noticeable in calls or gaming, less obvious while browsing.
  • 5% or more loss: Expect glitches, failed uploads, and slow page loads.
  • Spikes from 20 ms to 900 ms: Often points to congestion, Wi Fi issues, or overloaded gear.

If ping to your router spikes, look at Wi Fi signal, cables, or the router itself. If the first hop is clean but later hops spike, the issue is likely outside your machine.

Common mistakes to avoid

  • Do not trust one failed ping. Some websites block ICMP.
  • Do not panic over one tracert timeout. Routers may ignore trace probes.
  • Do not test only over Wi Fi. A bad wireless signal can fake an internet problem.
  • Do not skip DNS. Name lookup failures are common and easy to miss.

The best habit is to compare results. Test a domain, test an IP, test your router, and test another website. ping gives you the quick signal. tracert gives you the path. Together, they turn “the internet is broken” into a much clearer diagnosis.

Share
 
Ava Taylor
I'm Ava Taylor, a freelance web designer and blogger. Discussing web design trends, CSS tricks, and front-end development is my passion.