How to Run the traceroute and ping Commands
Last modified: 2025 February 13
Overview
This document describes how to run the traceroute and ping utilities on different operating systems. The traceroute utility determines the route that a network packet travels from your local machine to reach the target destination. The ping command allows you to test the latency between your local machine and the target IP address.
For more information about the ping and traceroute utilities, read the following documentation:
- Wikipedia’s Ping (network utility) article.
- Wikipedia’s Traceroute article.
Traceroute
macOS or Linux
traceroute command. If so, connect to the server via SSH as a privileged user, such as the root user.
To run the traceroute utility on a macOS® or Linux® server, perform the following steps:
-
Log in to the server via SSH.
-
Run the
traceroute example.comcommand, whereexample.comrepresents the target host to test. Successful output will resemble the following example:1 2 3 4traceroute to example.com (192.168.0.20), 30 hops max, 60 byte packets 1 gateway (192.168.0.20) 0.868 ms 0.856 ms 0.728 ms 2 10.1.0.1 (192.168.0.20) 0.664 ms 0.629 ms 0.595 ms 3 vl118.ss-core.example.com (192.168.0.20) 1.041 ms 1.011 ms 0.974 ms
Microsoft Windows
tracert command to run the traceroute utility on a Microsoft Windows® server.
To run the tracert command on a Microsoft Windows server, perform the following steps:
- From the Windows Start menu, enter
cmdin the Search text box. - Double-click Command Prompt in the list that appears. The Windows command prompt will appear.
- Run the
tracert example.comcommand, whereexample.comrepresents the target host to test. Successful output will resemble the following example:1 2 3 4Tracing route to example.com [192.168.0.20] 1 2ms 1ms 1ms 192.168.0.20 2 7ms 7ms 9ms 192.168.0.20 gateway (192.168.0.20) 0.868 ms 0.856 ms 0.728 ms 3 11ms 11ms 11ms 192.168.0.20
Ping
macOS or Linux
To run the ping utility on a macOS or Linux server, perform the following steps:
-
Log in to the server via SSH.
-
Run the
ping example.comcommand, whereexample.comrepresents the target host to test. Successful output will resemble the following example:1 2 3 4PING example.com (192.168.0.20): 56 data bytes 64 bytes from 192.168.0.20: icmp_seq=0 ttl=45 time=22.122 ms 64 bytes from 192.168.0.20: icmp_seq=1 ttl=45 time=21.327 ms 64 bytes from 192.168.0.20: icmp_seq=2 ttl=45 time=24.583 ms
Microsoft Windows
To run the ping utility on a Microsoft Windows server, perform the following steps:
- From the Windows Start menu, enter cmd in the Search text box.
- Double-click Command Prompt in the list that appears.
- Run the
ping example.comcommand, whereexample.comrepresents the target host to test. Successful output will resemble the following example:1 2 3 4PING example.com (192.168.0.20) with 56 bytes of data: Reply from 192.168.0.20: bytes=64 ttl=45 time=22.921 ms Reply from 192.168.0.20: bytes=64 ttl=45 time=22.921 ms Reply from 192.168.0.20: bytes=64 ttl=45 time=22.921 ms