Skip to content

Windows Network Stack Reset as a Last Resort

Admin
October 1, 2026
5 min read
Intermediate
πŸ’» Target OS: Windows Server 2025 / 2022

Before you begin

  • Applies to:Windows network troubleshooting when adapter, DNS, route, and application checks have failed.
  • Where to start:Start at the affected PC's local console. Use an elevated terminal if a reset is approved.
  • What you need:Back up interface settings, including any static addresses, DNS servers, and gateways. Have a recovery plan before resetting a remote connection.
Guide tools
Guide tools
0/0 Steps (0%)

Use a Winsock and TCP/IP reset only after checking adapter configuration, DNS, routes, and the failing application or service. The TCP/IP reset rewrites system configuration and can disrupt static addressing, DNS, gateways, and remote access. Back up the current interface settings and have console access or a recovery plan before proceeding.


01

Open PowerShell with Administrator Rights

Prerequisite

Low-level network adapter reconfiguration requires elevated administrative permissions.

  • Press Win + X and select Terminal (Admin) or PowerShell (Admin).
  • Click Yes on the User Account Control (UAC) prompt.
Terminal window
# Verify elevated administrative session
([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(544)
❯ Illustrative Output (Results Vary)

True


02

Flush Resolver Cache & Reset Winsock Catalog

Reset

Save the interface configuration first. The IP reset command must have a log-file name. These operations change local network state; do not run them over the only remote connection to the computer.

Terminal window
# Save interface settings to new, timestamped files before changing network state.
$timestamp = Get-Date -Format 'yyyyMMdd-HHmmss'
$NetworkConfigBackup = Join-Path $env:TEMP "network-before-reset-$timestamp.txt"
$IpResetLog = Join-Path $env:TEMP "ip-reset-$timestamp.log"
if ((Test-Path -LiteralPath $NetworkConfigBackup) -or (Test-Path -LiteralPath $IpResetLog)) {
throw 'A backup or reset log with this timestamp already exists; stop and choose a fresh name.'
}
netsh -c interface dump | Out-File -FilePath $NetworkConfigBackup -Encoding ascii -ErrorAction Stop
$backupExitCode = $LASTEXITCODE
if ($backupExitCode -ne 0) { throw "Could not capture the interface configuration (netsh exit $backupExitCode). Stop." }
if ((Get-Item -LiteralPath $NetworkConfigBackup -ErrorAction Stop).Length -eq 0) {
throw 'The interface configuration backup is empty; do not reset the network stack.'
}
# Flush the local DNS resolver cache
Clear-DnsClientCache -ErrorAction Stop
# Reset the Winsock catalog
netsh winsock reset
if ($LASTEXITCODE -ne 0) { throw "Winsock reset failed with exit code $LASTEXITCODE; stop and review the output." }
# Reset TCP/IP and write the reset log
netsh int ip reset "$IpResetLog"
if ($LASTEXITCODE -ne 0) { throw "TCP/IP reset failed with exit code $LASTEXITCODE; review the output and log." }
if (-not (Test-Path -LiteralPath $IpResetLog -PathType Leaf)) { throw 'The TCP/IP reset log was not created.' }
Get-Item -LiteralPath $NetworkConfigBackup, $IpResetLog -ErrorAction Stop |
Select-Object FullName, Length
❯ Illustrative Output (Results Vary)

Successfully reset the Winsock Catalog.
You must restart the computer in order to complete the reset.
Resetting Global, completed!
Resetting Interface, completed!
Restart the computer to complete this action. Review the reset log and saved interface configuration first.


03

Reboot Windows System

Finalize

Save open work and restart only when you have local or out-of-band access. After startup, verify the adapter address, DNS servers, gateway, routes, and application connectivity. Restore the saved interface configuration if required; interface names must still match the backup.

Terminal window
# Run only after confirming the maintenance window and recovery access.
Restart-Computer
❯ Illustrative Output (Results Vary)

Windows restarts. The remote session will disconnect during reboot.

Comments