Useful Network Commands in the Windows Command Prompt
The 4 network commands you genuinely need on Windows: ipconfig, ping, tracert and flushing the DNS cache.
There are dozens of network commands on Windows, but for normal home use, 4 cover practically everything you'll need. Here they are, explained with real examples, without the endless list of advanced commands you'll rarely need.
| Command | What it's for |
|---|---|
ipconfig | See your IP address, your router's, and more |
ping | Check whether there's a connection to a device or website |
tracert | See what path your connection takes to reach a destination |
ipconfig /flushdns | Clear the domain name cache |
ipconfig: your IP address and more
ipconfig
Shows your local IP address, the subnet mask, and the default gateway (your router's IP). For more detail, including each adapter's MAC address:
ipconfig /all
ping: is there a connection or not?
ping google.com
Sends small test packets and waits for a reply. If it replies, there's a connection through to that destination. If it doesn't reply, there might be no connection — although it can also simply mean that destination has ping replies blocked, so "no reply" doesn't always mean "no internet".
Tip: ping your own router first (usually
ping 192.168.1.1). If it replies, your local network is
working fine and the problem is further out than the router. If it
doesn't reply, the problem is between your PC and the router.
tracert: the path your connection takes
tracert google.com
Shows each "stop" (intermediate router) your connection passes through before reaching the destination, with how long each one takes. Useful for seeing exactly at which point a connection slows down or drops, rather than just knowing "something's wrong".
Note: seeing asterisks (*) at some
tracert hops doesn't always mean a problem — sometimes
that router is simply configured not to respond to this kind of
request, even though it keeps working normally for the rest of the
traffic.
Clearing the DNS cache
ipconfig /flushdns
Deletes the temporary record of which IP address corresponds to each website. Useful after changing DNS, or if a website recently changed servers and your PC keeps trying to connect to the old address.
If these commands confirm a problem but don't fully fix it, our guide on how to reset network settings covers the next level, with more commands and progressive options.
Frequently asked questions
Do I need administrator permissions for these commands?
Not for the ones in this guide (ipconfig, ping, tracert) — they work from a normal command prompt window, with no need to 'Run as administrator'.
Why does ping sometimes not reply even though I have internet?
Many servers and firewalls deliberately block ping replies for security reasons, without that meaning any real connection problem. Don't rely solely on a failed ping to diagnose a problem.
Do these commands work the same on Windows 10 and 11?
Yes, they are very old and stable commands that work the same on both versions, and even on considerably earlier Windows versions.