If the internet is not working on a Windows PC where everything related to networking is properly configured, the command netsh winsock reset might save your day. Furthermore, this command will also help you fix the Windows Sockets registry entries required for network connectivity are missing error that is shown when you run Windows network diagnostics.
Avatar
Latest posts by Surender Kumar (see all)

If you already know about the netsh winsock reset command but still wonder what it actually does, this post will help you understand it.

Windows Sockets registry entries required for network connectivity are missing

Windows Sockets registry entries required for network connectivity are missing


Understanding Winsock

Winsock (Windows Sockets) is an API that defines how network applications in Windows can access network services, such as TCP/IP. Basically, Windows stores information related to Winsock in a database known as the Winsock Catalog. When this catalog becomes corrupt, you will start seeing weird network or internet connectivity problems. The following registry key holds the information about the Winsock catalog:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinSock2\Parameters\Protocol_Catalog9

When you run the netsh winsock reset command, the existing Protocol_Catalog9 registry key is saved to Protocol_Catalog_Before_Reset and a new registry key is created with default parameters. The full path to the backup key is:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinSock2\Parameters\Protocol_Catalog_Before_Reset

Viewing the registry keys related to the Winsock Catalog

Viewing the registry keys related to the Winsock Catalog

Remember that the aforementioned registry keys hold the Winsock parameters in binary format, which is difficult to understand. Later in this guide, I will show you a way to export the Winsock Catalog parameters to a text file that you can easily read and understand.

Why a Winsock reset is required

Before actually resetting the Winsock Catalog, let's first understand why you would need to do it. The Winsock Catalog could become corrupt for various reasons, such as:

Malware or adware infection—Cleaning up malware from a PC can corrupt the Winsock Catalog.

Incorrect network device installation or removal—When you install (or remove) a network device or VPN software incorrectly, it could lead to a corrupt Winsock Catalog.

Registry cleaning or optimization utility—Sometimes, a registry cleaner or optimization tool can mess up the registry, which in turn could cause the Winsock Catalog to become corrupt.

There may be other reasons in addition to these. No matter how the Winsock Catalog becomes corrupt, you need to reset it to fix the issue.

How to reset the Winsock Catalog

Now that you understand the Winsock Catalog and its importance in Windows, let's discuss how to reset it. To reset the Winsock:

Launch an elevated command prompt or PowerShell console (run cmd or PowerShell as administrator).

[Optional] If you want to view the Winsock parameters, use the following command (as discussed earlier, the Winsock parameters are stored in the registry in binary format, which is hard to read and understand):

netsh winsock show catalog
Viewing the Winsock Catalog using the netsh command

Viewing the Winsock Catalog using the netsh command

This command displays all the parameters, and the command output can be overwhelming. So, you might want to store the output in a file using netsh winsock show catalog > d:\winsock-before.txt command, as shown in the following screenshot:

Saving the Winsock Catalog parameters to a text file and reading them when needed

Saving the Winsock Catalog parameters to a text file and reading them when needed

This command stores the output in a text file that you can read and even compare later on after the Winsock reset.

Now, use the following command to reset the Winsock catalog:

netsh winsock reset
Running the netsh winsock reset command to reset the Winsock Catalog in Windows

Running the netsh winsock reset command to reset the Winsock Catalog in Windows

You need to restart your computer to complete the reset process.

To restart the computer, use the following PowerShell command:

restart-computer -force

When the PC reboots, your network problem should go away. If you still experience the problem, launch the elevated command prompt (or PowerShell) again, and follow the remaining steps.

If the problem persists, you might need to perform a TCP/IP reset on your PC. Note that this will completely remove the custom TCP/IP configurations from your network adapters. So, if you're using a manually configured IP address, gateway, and DNS settings, you might want to run the following command:

netsh int ip show config > d:\net_config.txt
Saving the current IP configuration for all network adapters to a text file using the netsh command

Saving the current IP configuration for all network adapters to a text file using the netsh command

This command saves all the IP configurations to a text file that you can refer to later on to manually configure the network adapters after reset.

Now use the following command to reset the TCP/IP protocol stack on your PC:

netsh int ip reset
Resetting the TCP IP protocol stack using the netsh command

Resetting the TCP IP protocol stack using the netsh command

This command overwrites the following two registry keys:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DHCP\Parameters

These registry keys are used by the TCP/IP protocol stack; running the netsh int ip reset command is essentially equivalent to removing and reinstalling the TCP/IP stack. By the way, you could save the output of the reset command to a file using the netsh int ip reset > d:\ip_reset_log.txt command.

Once this command is finished, you need to restart the computer and then reconfigure the TCP/IP settings for your network adapters. The backup of configuration settings comes in handy here if you don't remember them. If you use a DHCP server, your PC will automatically obtain the dynamic IP configuration. If it still doesn't pull the settings, use the ipconfig /renew command.

Conclusion

I hope this guide helps you fix the network or internet connectivity problems that are caused by a corrupt Winsock Catalog or a broken TCP/IP protocol stack.

avatar
5 Comments
  1. Avatar
    bgavin 1 year ago

    Nicely done and well written. Kudos.
    This also works properly under Windows 7.
    Powershell is not required; it works correctly from a CMD prompt.

    • Avatar Author

      Of course it works in command prompt and even in Windows XP too. But since Windows 7 and XP is now long gone, they no longer recommended for a continued use.

      avatar
      • Avatar
        bgavin 1 year ago

        Of course Windows 7 is now long gone because Microsoft is pushing Windows 11. It offers more complexity, more fragility, is more invasive and generates more profits.

        However, point-of-sale terminals in the US still run on WinXP, and some commercial applications are forever tied to WinXP.

        Of course, there is a time when the complexity of Powershell, and its endless layers of C# runtime libraries are required or desired. Executing Netsh is not one of them.

        Articles published here are not for simpletons or children.
        You should keep that in mind with your answers in the future.

  2. Avatar
    Mike O Donovan 1 year ago

    Great stuff! I can’t believe how much of my life I have wasted navigating GUI’s to get basic networking info. This is a huge timesaver. I like the backup process as well before getting into heavy duty diagnostics.
    Your writing is great. I always read your articles even when I think I already know/understand the content because you always have a new wrinkle. Keep up the great work!

    avatar

Leave a reply

Please enclose code in pre tags: <pre></pre>

Your email address will not be published. Required fields are marked *

*

© 4sysops 2006 - 2023

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account