Top Network CMD Commands for Windows: Complete Troubleshooting & Diagnostic Guide

You are currently viewing Top Network CMD Commands for Windows: Complete Troubleshooting & Diagnostic Guide

When your internet stops working, websites refuse to load, or your network connection becomes unstable, Windows Command Prompt provides some of the most powerful diagnostic tools available.

While many users rely entirely on graphical troubleshooting tools, network administrators and IT professionals often turn to Command Prompt first because it provides detailed information and direct control over Windows networking.

In this guide, we’ll cover the most useful network CMD commands, from basic tools every Windows user should know to advanced diagnostics used by professionals.

Opening Command Prompt

Before getting started:

  1. Click the Windows Search box
  2. Type: cmd
  3. Open Command Prompt

Some commands require administrator privileges, so you may occasionally need to select: Run as administrator

ipconfig: View and Manage Network Configuration

The most fundamental Windows networking command is:

ipconfig

This displays your network configuration, including:

  • IP address
  • Subnet mask
  • Default gateway
  • Network adapter information

The most important values are:

IPv4 Address

Your device’s local network address.

Examples:

192.168.1.100
10.0.0.25

Default Gateway

Usually your router’s IP address.

This is often the address used to access your router’s web interface.

Subnet Mask

Defines your local network range.

Most home networks use:

255.255.255.0

Useful ipconfig Variations

View Complete Information

ipconfig /all

Displays:

  • MAC addresses
  • DNS servers
  • DHCP information
  • Lease expiration times

Release Current IP Address

ipconfig /release

Disconnects your device from the network by releasing its DHCP-assigned IP address.

Request a New IP Address

ipconfig /renew

Requests a fresh IP assignment from your router.

Running Release followed by Renew often fixes network connectivity issues.

Clear DNS Cache

ipconfig /flushdns

Removes cached DNS entries.

This is often the first fix to try when websites stop loading correctly.

ping : Test Connectivity and Latency

Ping is one of the most widely used network troubleshooting tools.

Example:

ping tips4it.com

Ping sends small packets to a destination and measures how long they take to return.

Understanding Ping Results

Successful Response

Reply from x.x.x.x

The destination is reachable.

Timeout

Request timed out

The destination failed to respond.

Latency Guidelines

  • Under 20ms = Excellent
  • Under 50ms = Good
  • 50–100ms = Acceptable
  • Above 100ms = May indicate a problem

Useful Ping Tests

Test Internet Connectivity

ping 8.8.8.8

This tests connectivity using Google’s public DNS server.

Test DNS Resolution

ping google.com

If pinging 8.8.8.8 works but pinging google.com fails, the issue is usually DNS-related.

Continuous Monitoring

ping -t google.com

Runs continuously until you press: Ctrl + C

Useful for monitoring unstable connections.

nslookup: Diagnose DNS Problems

The Name Server Lookup command allows you to query DNS servers directly.

Example:

nslookup google.com

This returns the IP addresses associated with the domain.

Check a Different DNS Server

nslookup google.com 8.8.8.8

Uses Google’s DNS server instead of your default provider.

If this works while your normal lookup fails, your ISP’s DNS servers may be experiencing issues.

Interactive Mode

Simply run:

nslookup

You can then enter multiple domain names one after another.

Type:

exit

to leave interactive mode.

tracert: Trace the Route to a Destination

Trace Route shows every router hop between your PC and the destination.

Example:

tracert google.com

What tracert Reveals

  • Routing path
  • Network bottlenecks
  • ISP issues
  • Latency spikes

Each numbered line represents one router hop.

Faster Trace Route

tracert /d google.com

Skips DNS lookups and displays only IP addresses, making the command faster.

netstat: View Active Network Connections

Netstat displays active connections and listening ports.

Example:

netstat -an

This shows:

  • Local addresses
  • Remote addresses
  • Port numbers
  • Connection states

Display Application Names

netstat -b

Shows which applications own each network connection.

Useful for identifying unknown processes making outbound connections.

Ethernet Statistics

netstat -e

Displays:

  • Packets sent
  • Packets received
  • Errors
  • Discards

View Routing Table

netstat -r

Displays routing information.

arp: View Devices on Your Local Network

ARP manages IP-to-MAC address mappings.

View the ARP cache:

arp -a

This shows devices recently seen on your local network.

Clear the ARP Cache

arp -d

Removes all ARP entries.

Useful when troubleshooting IP conflicts or device communication issues.

netsh: Advanced Network Configuration

Netsh is one of the most powerful networking tools built into Windows.

Reset Winsock

netsh winsock reset

Repairs the Windows socket catalog.

One of the best fixes for mysterious network failures.

Reset TCP/IP

netsh int ip reset

Restores the TCP/IP stack to default settings.

Reset TCP Settings

netsh int tcp reset

Resets transport-layer settings.

Reset Windows Firewall

netsh advfirewall reset

Restores the firewall to factory defaults.

View Saved Wi-Fi Networks

List saved wireless profiles:

netsh wlan show profiles

Display a Saved Wi-Fi Password

netsh wlan show profile name="YourNetworkName" key=clear

Replace: YourNetworkName

with the exact network name.

The Wi-Fi password appears under: Key Content

route: Manage the Routing Table

Display routing information:

route print

This shows how Windows decides where network traffic should go.

Add a Static Route

route add

Used to direct traffic through a specific gateway.

Create a Persistent Route

route -p add

Routes created with the -p flag survive reboots.

Delete a Route

route delete

Removes a route from the table.

pathping: Advanced Network Analysis

Pathping combines Ping and Tracert into a single tool.

Example:

pathping google.com

Unlike Tracert, Pathping also measures packet loss at every hop.

This makes it extremely useful for diagnosing intermittent connectivity issues.

The downside is that it can take several minutes to complete.

Complete Windows Network Reset Sequence

When facing stubborn network issues, run these commands as Administrator:

ipconfig /flushdns
ipconfig /release
ipconfig /renew
netsh winsock reset
netsh int ip reset
netsh int tcp reset
netsh advfirewall reset

After running all commands, restart your PC.

See also: Run these 7 commands when your Internet connection stops working

This sequence resets:

  • DNS cache
  • IP configuration
  • Winsock catalog
  • TCP/IP stack
  • TCP settings
  • Firewall rules

If problems persist after the restart, the issue is likely hardware-related or originates with your ISP.

Final Thoughts

Windows Command Prompt contains some of the most powerful networking tools available. Whether you’re checking your IP address, troubleshooting DNS issues, identifying routing problems, monitoring active connections, or performing a complete network reset, these commands provide information and control that graphical tools often cannot.

Keeping these commands in your troubleshooting toolkit can save hours of frustration the next time your network starts acting up.

This Post Has One Comment

Leave a Reply