How to Repair TCP/IP and Winsock in Windows
In this article
If your internet connection is broken, showing errors like "DNS server not responding" or "The requested name is valid, but no data of the requested type was found," the TCP/IP stack or Winsock catalog may be corrupted. Resetting them restores the network protocols to their default state, which fixes many connectivity issues. You can do this with built-in Windows commands—no extra software needed. The process takes about five minutes and works on Windows 10 and 11.
What You'll Need
- A Windows PC (desktop or laptop) with administrator access.
- The ability to open Command Prompt as Administrator.
- Your Wi-Fi or Ethernet connection may drop temporarily during the reset—this is normal.
Step-by-Step
- Close all open programs that use the internet (browsers, email clients, games, etc.). This prevents conflicts during the reset.
- Open Command Prompt as Administrator. Click the Start button, type
cmd, right-click on "Command Prompt" and select "Run as administrator." If prompted by User Account Control, click "Yes." - Reset Winsock. In the Command Prompt window, type the following command and press Enter:
netsh winsock reset
You should see the message "Successfully reset the Winsock Catalog." - Reset TCP/IP stack. Type the next command and press Enter:
netsh int ip reset
This command resets the TCP/IP stack to its default configuration. It may take a few seconds to complete. - Flush DNS cache. Type
ipconfig /flushdnsand press Enter. This clears the DNS resolver cache, which can hold corrupted entries. - Renew IP configuration. Type
ipconfig /releaseand press Enter, then typeipconfig /renewand press Enter. This forces your PC to obtain a fresh IP address from your router. - Restart your computer. After the commands complete, close Command Prompt and restart your PC. The changes take effect after a reboot.
Common Mistakes
- Not running as Administrator: The commands will fail with "Access denied" if you don't open Command Prompt with admin rights. Always right-click and select "Run as administrator."
- Skipping the reboot: The reset doesn't fully apply until you restart Windows. Rebooting is a required step.
- Using the wrong command syntax: Typos like
netsh winsock resetvsnetsh winsock reset all—stick to the exact commands above. Adding extra parameters can cause errors. - Running the commands from PowerShell: While PowerShell can run netsh, the output and behavior may differ. Use the classic Command Prompt for consistency.
Tips
- After the reset, if you use a VPN or proxy, you may need to reconfigure those settings because the reset clears some network adapters' custom settings.
- If you have multiple network adapters (e.g., Wi-Fi and Ethernet), the reset applies to all of them. Reconnect to your network after reboot.
- Consider creating a system restore point before running the commands, just in case. You can do this by searching "Create a restore point" and following the prompts.
- If you're on a corporate network or use static IP settings, note them down before the reset—you may need to re-enter them.
Troubleshooting
If the reset commands complete but your internet still doesn't work, try these steps in order:
- Restart your router/modem: Unplug it for 30 seconds, plug it back in, and wait for the lights to stabilize. This clears the router's own network state.
- Check if other devices work: If your phone connects to the internet via the same Wi-Fi, the problem is likely on your PC. If not, it's your internet service or router.
- Update network drivers: Open Device Manager (right-click Start > Device Manager), expand "Network adapters," right-click your adapter, and select "Update driver." Choose "Search automatically for drivers."
- Disable and re-enable the network adapter: In Device Manager, right-click your adapter and select "Disable device," then right-click again and select "Enable device."
- Run the Windows Network Troubleshooter: Go to Settings > System > Troubleshoot > Other troubleshooters (Windows 11) or Settings > Update & Security > Troubleshoot (Windows 10), and run the "Internet Connections" troubleshooter.
- If nothing works, try a system restore: If you created a restore point, you can revert to a previous state. Search "Recovery" in the Start menu, open "Recovery options," and use "Open System Restore." This won't delete personal files.
Frequently Asked Questions
Will resetting Winsock delete my files or programs?
No. The reset only affects network settings. Your documents, photos, and installed apps remain untouched.
Do I need to run these commands as an administrator?
Yes, the netsh commands require elevated privileges. If you don't run Command Prompt as administrator, you'll get an "Access denied" error.
How often should I repair TCP/IP and Winsock?
Only when you have network issues that other troubleshooting (like restarting your router) didn't fix. There's no need to do it regularly.
Will this fix my Wi-Fi password or network name?
No. The reset doesn't change your saved Wi-Fi profiles or passwords. You'll still connect to your networks as before.
Can I use these commands on Windows 7 or 8?
Yes, the same commands work on Windows 7, 8, and 10. The steps to open Command Prompt as administrator are slightly different, but the netsh commands are identical.
What if the reset succeeds but my internet is still slow?
That suggests the problem isn't the TCP/IP stack. Check your router placement, run a speed test, and contact your ISP if speeds are consistently low.