Skip to content
GEEKnodes

Windows

Windows Network Commands Explained: ipconfig, ping, tracert

What each Windows network command does (ipconfig, ping, tracert, pathping, nslookup, netstat, Test-NetConnection), how to read output and what it solves.

When “the internet is down”, Windows ships seven tools that tell you where the fault is: your PC, the router, DNS or the remote server. This guide explains what each does, how to read its output and in which order to use them, without needing to be a network admin.

In short

  • ipconfig tells you your computer’s IP, gateway and DNS.
  • ping checks whether a device answers and how long it takes.
  • tracert and pathping show the path to a destination and where it gets lost.
  • nslookup checks that DNS translates a name into an IP.
  • netstat and Test-NetConnection check connections and specific ports.

Quick table: which command for which problem

SymptomCommandWhat to look for
Not sure I have an IPipconfigIPv4 address and gateway
I reach nothingping to the routerWhether your local network answers
IP works but names do notnslookupWhether DNS works
Slow or droppingpathpingWhich hop loses packets
A program will not connectTest-NetConnection -PortWhether the port is open
Something is using my connectionnetstat -anoConnections and responsible process

All work in Command Prompt and PowerShell, except Test-NetConnection, which is PowerShell only.

ipconfig: your computer’s configuration

Always the first step. It shows the IP configuration of each adapter.

ipconfig
ipconfig /all

In the output, look at these lines of the adapter you use (Wi-Fi or Ethernet):

LineExampleWhat it means
IPv4 Address192.168.1.34Your PC’s IP on the local network
Subnet Mask255.255.255.0The size of your network
Default Gateway192.168.1.1Usually your router
DNS Servers (only with /all)192.168.1.1Who translates names into IPs

Warning sign: an IP starting with 169.254. means the computer got no IP from the router (DHCP). The problem is between your PC and the router.

Other useful options:

ipconfig /release
ipconfig /renew
ipconfig /flushdns
  • /release and /renew request a new IP from the router.
  • /flushdns empties the local DNS cache; useful if a site changed server.

ping: does the other side answer?

ping sends small packets and measures how long they take to return.

ping 192.168.1.1
ping 8.8.8.8
ping geeknodes.com

A normal reply looks like this:

Reply from 8.8.8.8: bytes=32 time=14ms TTL=117
  • time: latency. On a local network usually under 5 ms; to the internet, 10 to 50 ms is common on fiber.
  • TTL: hops left; no need to read it for diagnosis.

Common error messages:

MessageMeaning
Request timed outNo reply (down, filtered or no route)
Destination host unreachableYour computer or a router does not know how to get there
Ping request could not find hostThe name does not resolve: DNS problem

For continuous ping (stop with Ctrl + C):

ping -t 192.168.1.1

Note: many servers and firewalls block ping. No reply does not always mean it is down.

The order that saves time

Four-step ping sequence: 127.0.0.1, gateway, 8.8.8.8 and a name; the first to fail points to the problem
Ping in this order: the first step that fails tells you where the problem is.
  1. ping 127.0.0.1 → your PC’s network stack works.
  2. ping your gateway → you reach the router.
  3. ping 8.8.8.8 → you reach the internet.
  4. ping a name (ping microsoft.com) → DNS works.

The first step that fails tells you where the problem is.

tracert: the path to the destination

tracert lists each router (hop) your packets pass through.

tracert route over five hops from router 192.168.1.1 to 8.8.8.8; hop 3 with asterisks is not a failure
A hop with asterisks in the middle is not a failure if the route continues.
tracert -d 8.8.8.8

-d skips name resolution and makes it much faster. Sample output:

  1     1 ms     1 ms     1 ms  192.168.1.1
  2     4 ms     3 ms     4 ms  10.20.0.1
  3     *        *        *     Request timed out.
  4    12 ms    11 ms    12 ms  72.14.215.85
  5    13 ms    13 ms    12 ms  8.8.8.8

Each row has three times (three attempts). A hop with asterisks in the middle that then continues is not a failure: that router just does not answer these probes. Worry only if from one hop on everything is asterisks.

pathping: where packets get lost

pathping combines tracert and ping: first it discovers the route, then sends many pings to each hop to compute loss. According to Microsoft, by default it sends 100 queries per hop, so it takes several minutes.

pathping -n 8.8.8.8

At the end it shows a table with two loss columns:

  • Source to Here: cumulative loss from your PC to that hop.
  • This Node/Link: loss at that router or on the link (the line with |).

If a link shows 13% loss and all later hops too, that is the bottleneck. If only an intermediate router loses packets but the final destination is at 0%, that router just gives low priority to replying.

Use it for intermittent drops or freezing video calls.

nslookup: check DNS

Translates a name into an IP and tells you which DNS server answered.

nslookup geeknodes.com
nslookup geeknodes.com 1.1.1.1

The second line queries a specific DNS. If yours fails and 1.1.1.1 works, the problem is your router’s or provider’s DNS.

In the output, “Non-authoritative answer” is normal: the reply comes from a cache, not from the domain’s official server.

netstat: which connections are open

netstat shows active TCP connections and listening ports.

netstat -ano
OptionWhat it does
-aAll connections and listening ports
-nShows IPs and ports as numbers (faster)
-oAdds the process PID
-bShows the executable (needs admin console)
-rRoute table, same as route print

States you will see:

  • LISTENING: a program waits for connections on that port.
  • ESTABLISHED: active connection.
  • TIME_WAIT: recently closed connection; many is normal.
  • CLOSE_WAIT: the other end closed and the local program has not; if they pile up, that program has a problem.

To know which program uses a PID, look it up in Task Manager, Details tab, or with:

tasklist /fi "PID eq 4321"

Test-NetConnection: ping and ports in PowerShell

The most complete tool. Without parameters it pings a Microsoft server; with -Port it tests a specific TCP port.

A server that does not answer ping but has port 443 open: TcpTestSucceeded True
No ping reply does not mean it is down: test the port.
Test-NetConnection geeknodes.com -Port 443
Test-NetConnection 192.168.1.20 -CommonTCPPort RDP
Test-NetConnection 8.8.8.8 -TraceRoute

The key line is TcpTestSucceeded:

  • True: the port is open and accepts connections.
  • False: something blocks it (firewall, stopped service or wrong IP).

-CommonTCPPort accepts HTTP, RDP, SMB and WINRM. With -InformationLevel Detailed you also get the interface used and next hop. Its short alias is tnc.

Ideal when ping is blocked: a web server may not answer ping and still have port 443 open.

Practical example: “I have Wi-Fi but no website loads”

  1. ipconfig → you have 192.168.1.34 and gateway 192.168.1.1. IP is fine.
  2. ping 192.168.1.1 → answers. Local network fine.
  3. ping 8.8.8.8 → answers. Internet reachable.
  4. ping google.com → “could not find host”.
  5. nslookup google.com 1.1.1.1 → answers fine.

Conclusion: the DNS your router gives fails. Fix: reboot the router or set another DNS on the adapter.

Common mistakes

  • Declaring a server down because it does not answer ping. Check the port with Test-NetConnection.
  • Panicking over stray asterisks in tracert. It matters only if no reply comes back.
  • Cancelling pathping early. It needs to finish the statistics.
  • Forgetting -d or -n. Resolving names for every hop makes commands much slower.

Accessibility preferences

Quick profiles

Text and reading

Text size
Default
Line height
Default
Letter spacing
Default
Word spacing
Default

Colour

Motion and orientation

Cursor