How to configure TCP/IP settings from the Command Prompt in Windows

In order to configure TCP/IP settings such as the IP address, Subnet Mask, Default Gateway, DNS and WINS addresses and many other options you can use Netsh.exe.

With Netsh.exe you can easily view your TCP/IP settings. Type the following command in a Command Prompt window (CMD.EXE):

netsh interface ip show config

With Netsh.exe, you can easily configure your computer’s IP address and other TCP/IP related settings. For example:

The following command configures the interface named Local Area Connection with the static IP address, the subnet mask of, and a default gateway of

netsh interface ip set address name=»Local Area Connection» static 1 (The above is one long line)

If you want to export your current ip settings:

netsh -c interface dump > c:mySettings.txt 

If you want to import your ip settings:

netsh -f c:mySettings.txt

or instead of -f

netsh exec c:mySettings.txt

To automatically obatin an IP address using DHCP:

netsh interface ip set address «Local Area Connection» dhcp

DNS settings:

netsh interface ip set dns «Local Area Connection» static

WINS settings:

netsh interface ip set wins «Local Area Connection» static

Auto DNS settings:

netsh interface ip set dns «Local Area Connection» dhcp

Usefull links:

Link one and Link two


• Use better faster DNS servers, like (,
• Connect directly to DNS servers to avoid DNS forwarding through your router (acting as a DNS proxy).
• Turn off IPv6 DNS lookups in Firefox/Camino (references:
• If DNS forwarding is required, change the DNS servers directly on the router.
• Update your router’s firmware (references:, for better SRV and IPv6 handling.
• Below are detailed instructions on applying these fixes to slow dns lookups/slow Internet on Leopard