The netsh Command: Windows Network Reset and Diagnostics

Run a Speed Test

netsh is the old but still useful Windows network shell. It can inspect and change networking state, which makes it powerful enough to fix problems and powerful enough to create new ones.

What netsh Can Do

netsh (Network Shell) is a built-in Windows command-line tool for inspecting and configuring network settings. It covers several distinct subsystems through different contexts:

ContextWhat It ManagesCommon Use
netsh winsockWindows Sockets API layerReset after VPN/proxy software corrupts networking stack
netsh int ipTCP/IP stack configurationReset IP configuration after malware, bad drivers, or static IP issues
netsh wlanWi-Fi adapter and profilesView saved networks, retrieve stored passwords, generate wireless diagnostic report
netsh advfirewallWindows Firewall rulesList, add, delete firewall rules; reset to defaults
netsh interfaceNetwork adapter configurationView adapter settings, set static IP/DNS, check interface status
netsh httpHTTP kernel driver (HTTP.sys)Fix port reservation conflicts; inspect URL reservations

Essential Commands by Category

# --- RESET COMMANDS (run as Administrator; restart after) ---

# Reset Winsock — fixes: "connected but apps can't reach internet"
netsh winsock reset

# Reset TCP/IP stack — fixes: corrupted IP configuration
netsh int ip reset

# Flush DNS cache — fixes: stale DNS entries causing wrong site resolution
ipconfig /flushdns

# --- DIAGNOSTIC: NETWORK ADAPTERS ---

# Show current IP/DNS configuration for all adapters
netsh interface ip show config

# Show all adapter names and states
netsh interface show interface

# --- DIAGNOSTIC: WI-FI ---

# List all saved Wi-Fi profiles
netsh wlan show profiles

# Show password for a specific saved network (look for "Key Content")
netsh wlan show profile name="NetworkName" key=clear

# Generate detailed wireless diagnostic report (HTML saved to disk)
netsh wlan show wlanreport

# Show current Wi-Fi connection details (signal, channel, rate)
netsh wlan show interfaces

# --- FIREWALL ---

# Show all active firewall rules
netsh advfirewall firewall show rule name=all

# Allow a specific port through the firewall (inbound TCP)
netsh advfirewall firewall add rule name="MyApp Port 8080" dir=in action=allow protocol=TCP localport=8080

# Reset Windows Firewall to factory defaults
netsh advfirewall reset

Step-by-Step: Fix "Connected but No Internet"

This is the most common reason to run netsh. Windows shows Wi-Fi or Ethernet connected but browsers and apps cannot reach anything:

  1. Open Command Prompt as Administrator (right-click Start → "Command Prompt (Admin)" or "Windows Terminal (Admin)")
  2. Before any resets, capture current settings: netsh interface ip show config — save the output if the machine uses a static IP or custom DNS
  3. Run: netsh winsock reset
  4. Run: netsh int ip reset
  5. Run: ipconfig /flushdns
  6. Restart the computer — the resets take effect on reboot, not immediately
  7. After reboot, test connectivity. If static IP or custom DNS were in place, reconfigure them

Retrieving Stored Wi-Fi Passwords

netsh can show the plaintext password for any saved Wi-Fi profile (admin required):

# Step 1: list all saved profiles
netsh wlan show profiles

# Step 2: show details including password for one profile
netsh wlan show profile name="YourNetworkName" key=clear

Look for Key Content under the Security settings section of the output. This is useful when connecting a new device and you do not remember the password.

Wireless Diagnostic Report

netsh wlan show wlanreport generates a detailed HTML report of Wi-Fi events, saved to C:\ProgramData\Microsoft\Windows\WlanReport\wlan-report-latest.html. The report shows a timeline of connection events, disconnections with error codes, and signal strength history — essential for diagnosing intermittent Wi-Fi drops that are not happening right now but have been recurring throughout the day.

netsh vs PowerShell Equivalents

Tasknetsh CommandPowerShell Equivalent
Show network adaptersnetsh interface show interfaceGet-NetAdapter
Show IP addressesnetsh int ip show configGet-NetIPAddress
Set DNS servernetsh interface ip set dns "Wi-Fi" static 1.1.1.1Set-DnsClientServerAddress
Show firewall profilesnetsh advfirewall show allprofilesGet-NetFirewallProfile
Flush DNS cacheipconfig /flushdnsClear-DnsClientCache

Frequently Asked Questions

Do I need administrator rights for netsh?

For all reset and configuration commands, yes — open Command Prompt as Administrator. Read-only display commands like netsh wlan show networks work without elevation, but anything that modifies system state requires admin rights. Right-click the Command Prompt icon and select "Run as administrator" or use runas /user:Administrator cmd.

Is netsh deprecated?

Parts of it are gradually being replaced by PowerShell cmdlets (Get-NetAdapter, Set-DnsClientServerAddress, etc.). However, netsh still ships with every Windows 10 and 11 edition, works in all environments, and remains the fastest way to reset Winsock and the TCP/IP stack — which have no direct single-command PowerShell equivalents. It is safe to use and unlikely to disappear soon.

Will netsh winsock reset delete my Wi-Fi passwords?

No. Winsock and TCP/IP resets do not touch saved Wi-Fi profiles or credentials, which are stored separately by the WLAN service. The risk is to static IP addresses, custom DNS servers, and enterprise VPN client configurations — these may be cleared by the IP stack reset and need to be reconfigured manually after reboot. Always capture netsh interface ip show config output before running resets on machines with non-default network settings.

How do I undo a netsh reset?

Winsock and IP resets cannot be reversed — they reset to Windows defaults. To restore previous settings, manually reenter any static IP addresses, custom DNS servers, or proxy settings that were in place before the reset. On domain-joined machines, Group Policy will usually reapply enterprise network settings after the next login or policy refresh cycle (gpupdate /force).

Related Guides

More From This Section