Skip to main content

Command referencetracert

tracert command (Windows / CMD)

WindowsCMDnetworkbeginner

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 / optionMeaning
/dSkip DNS name resolution.
/h hopsSet maximum hop count.
/w timeoutSet reply timeout in milliseconds.
/4Force 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.

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.