Resetting the Windows network stack

Reference note

dnstcp-ipreference

A reference for the case where the adapter shows connected, the switch port shows up, and nothing resolves or routes. Run these from an elevated prompt, least disruptive first, and stop as soon as it works. Reaching straight for the full reset is how you lose a static IP configuration nobody wrote down.

In order

Flush the resolver cache. Fixes stale records after a DNS change, and nothing else.

ipconfig /flushdns

Release and renew the DHCP lease. Worth doing before anything destructive, because a stale lease from a previous VLAN looks exactly like a broken stack.

ipconfig /release
ipconfig /renew

Reset the Winsock catalogue. This is what clears out layered service providers left behind by uninstalled VPN clients and security software.

netsh winsock reset

Reset the TCP/IP stack itself. Reboot required, and this is the one that discards manual IP and DNS settings on every adapter.

netsh int ip reset

Re-register the machine in DNS, which matters on a domain where the record went stale or got scavenged.

ipconfig /registerdns

Before the full reset

Two things to capture first, because netsh int ip reset will throw them away and you will not remember what they were:

ipconfig /all > %USERPROFILE%\Desktop\ipconfig-before.txt
netsh int ip show config >> %USERPROFILE%\Desktop\ipconfig-before.txt

If the machine is remote, note that netsh winsock reset can drop the RDP session, and netsh int ip reset will definitely require someone with physical or out-of-band access. Do not run either one on a server you cannot reach another way.

What this does not fix

If name resolution fails only for internal names, the problem is almost always the DNS server the client was handed rather than the client itself. Check what it is actually using before resetting anything:

nslookup fileserver.corp.internal

An answer from a public resolver instead of a domain controller means the DHCP scope options are wrong, and no amount of flushing on the client will change that.