Resetting TCP/IP in Windows XP & Windows Server 2003
In earlier versions of Windows, TCP/IP was a separate optional component that could be removed or added like any other protocol. In Windows XP/2003, TCP/IP is a core component of the operating system that cannot be removed. Especially on a Windows Server 2003, TCP/IP functionally is critical for network operations and Active Directory domain environment. The entire Active Directory architecture is based on DNS hierarchy, which relies on TCP/IP.
There are situations where one may encounter a corrupt TCP/IP stack. Although rare, this situation causes a major problem because you can’t remove and reinstall TCP/IP anymore. So what’s the solution? Re-installing the operating system? Well, that’s one option. Another option is to reset TCP/IP to the default state at the time when the operating system was installed. You can use the NetShell (netsh.exe) utility to reset TCP/IP. This document describes how you can use the NetShell utility to reset TCP/IP on Windows XP and Windows Server 2003. When you reset TCP/IP, it will rewrite all the important keys in the registry which has the effect of removing and reinstalling the entire TCP/IP stack.
Resetting TCP/IP
The NetShell utility is a command line tool (netsh.exe) that allows you to monitor and configure networking components on Windows XP/2003. To run this tool, go to the command prompt and type netsh. To display a list of commands that are available, type help, or simply type a question mark “?”.
C:\>netsh
netsh>?
The following commands are available:
Commands in this context:
.. – Goes up one context level.
? – Displays a list of commands.
abort – Discards changes made while in offline mode.
add – Adds a configuration entry to a list of entries.
alias – Adds an alias.
bridge – Changes to the `netsh bridge’ context.
bye – Exits the program.
commit – Commits changes made while in offline mode.
delete – Deletes a configuration entry from a list of entries.
diag – Changes to the `netsh diag’ context.
dump – Displays a configuration script.
exec – Runs a script file.
exit – Exits the program.
firewall – Changes to the `netsh firewall’ context.
help – Displays a list of commands.
interface – Changes to the `netsh interface’ context.
offline – Sets the current mode to offline.
online – Sets the current mode to online.
popd – Pops a context from the stack.
pushd – Pushes current context on stack.
quit – Exits the program.
ras – Changes to the `netsh ras’ context.
routing – Changes to the `netsh routing’ context.
set – Updates configuration settings.
show – Displays information.
unalias – Deletes an alias.
winsock – Changes to the `netsh winsock’ context.
The following sub-contexts are available:
bridge diag firewall interface ras routing winsock
To view help for a command, type the command, followed by a space, and then
type ?.
Tip: You can use abbreviations, or just the beginning part of a command instead of typing the entire command. For example, you can type int for interface, h for help, and either q or b to exit the program. If you want to go one level up in the path, type “..” without the quotes. You can also type the entire command without going into the individual contexts of netsh.
To reset TCP/IP, type the following at the command prompt.
netsh interface ip reset logfile_name
Where logfile_name is the name of a log file in the current directory, e.g. resetlog.txt. You can also create a log file in a different folder if you provide the full path.
When you reset TCP/IP, the two areas of registry that are affected include:
SYSTEM\CurrentControlSet\Services\DHCP\Parameters\
SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\
For a sample Windows XP TCP/IP reset log, check out resetlog.txt. If you notice that your log is empty, it could be because the TCP/IP entries on your computer have not been changed since the default installation.