Command referencetracert
tracert command (Windows / CMD)
What it does
Trace routers traversed on the way to an IP destination. Searches for the tracert command cmd usually need CMD syntax, practical switches, and notes on how it compares with PowerShell or Linux alternatives. This page covers syntax, common options, and copyable examples for Command Prompt.
Trace routers traversed on the way to an IP destination.
Syntax
tracert [/d] [/h maximum_hops] [/w timeout] target_name
Common options
| Flag / option | Meaning |
|---|---|
| /d | Skip DNS name resolution. |
| /h hops | Set maximum hop count. |
| /w timeout | Set reply timeout in milliseconds. |
| /4 | Force IPv4. |
Practical examples
Trace host
tracert example.com
Shows responding hops toward the host.
Fast numeric trace
tracert /d 8.8.8.8
Avoids DNS lookup delays.
Limit hops
tracert /h 12 example.com
Stops after at most twelve hops.
Linux ↔ Windows equivalent
Closest match: traceroute (Linux / bash / sh / zsh). Trace the network hops taken toward a destination.
Common mistakes
- Assuming timeout stars always indicate end-to-end packet loss.
- Expecting the forward trace to describe the return route.
Related commands
- pingTest reachability and measure response time with ICMP echo requests.
- netstatDisplay active connections, listening ports, routing data, and protocol statistics.
- tracerouteTrace the network hops taken toward a destination.
- ipconfigDisplay and manage Windows IP configuration and DNS client state.
- curlTransfer data to or from URLs using many network protocols.
- sshOpen a secure remote shell or run a command over SSH.
- pingTest IP reachability and measure round-trip response time.
- Invoke-WebRequestSend HTTP and HTTPS requests and return response metadata and content.
FAQ
What does tracert do in Command Prompt?
Trace routers traversed on the way to an IP destination.
How do I run tracert in CMD?
Open Command Prompt and follow `tracert [/d] [/h maximum_hops] [/w timeout] target_name`; quote paths containing spaces.
What is a practical tracert example in CMD?
Try `tracert example.com` — Shows responding hops toward the host.
Can tracert be used in a batch file?
Yes. Check its exit code and escape CMD metacharacters when input is variable.
Browse the full Linux and Windows command reference to search more bash, CMD, PowerShell, Conda, and GitHub CLI commands.