Skip to content

September 14, 2009

Use Netsh to Change TCP/IP Settings from the Command Prompt

Netsh is a tool that allows you to change TCP/IP settings from the command prompt. You can even make changes to remote workstations that you have access to. Once you learn the basics of scripting with netsh, it’s effortless to make changes (especially when compared to using the GUI and endless windows and dialogs). Netsh has been available in all versions of Windows since the Windows 2000 days.

The things you can do with netsh are pretty extensive, and there’s no way that I can sum them all up here in a simple post. What I will attempt to do though is make mention of a few examples of netsh’s usage, and add more examples in the future. For anything more extensive, the accompanying documentation is fairly decent and can be viewed by using the /? switch.

View TCP/IP Settings

netsh interface ip show config

Set IP Address

Set a static IP of, with a subnet of and default gateway of

netsh interface ip set address name="Local Area Connection"

Obtain IP Address via DHCP

netsh interface ip set address "Local Area Connection" dhcp

Set DNS Server Address

netsh interface ip set dns "Local Area Connection" static

Dynamically Obtain DNS Settings

netsh interface ip set dns "Local Area Connection" dhcp
Read more from Administration, Windows

Share your thoughts, post a comment.


Note: HTML is allowed. Your email address will never be published.

Subscribe to comments