Muhammad Irfan

"The purpose of life is a life of purpose." Robert Byrne

Change IP Address and DNS Servers Using the Command Prompt

Leave a comment

Changing TCP/IP settings using the GUI property is very easy and simple. But what about if you want to have more fun doing it, and change the IP and DNS properties using the windows command prompt?

If you are a Linux guru or a batch scripting wizard this should not be complicated, if you are new to the command prompt, well, today is a good day to start.

We will change the IP address and DNS servers using the built-in utility in Windows called “Netsh”.

Netsh is a nifty utility to change system networking settings, locally or remotely.

  • To run Netsh click on Start then Run and type CMD press ENTER.
  • When the command prompt comes up type Netsh and press ENTER.
  • Now you should be ready to execute commands.
  • Just to warm up type “interface ip show config” (It will shows up the TCP/IP network settings)

Now, how you change the IP address and Default Gateway settings?

To change the Local Area Connection TCP/IP settings type the following command:

interface ip set address name=”Local Area Connection” static 10.34.110.42 255.255.255.0 10.34.110.1 1

As you can see, when you use Netsh you need to specify what network properties you need to change, in the example above,

  1. We changed the network properties for “Local Area Connection
  2. Then we setup a Static IP Address,
  3. Subnet Mask,
  4. and at the end the Default Gateway.

We can also changes TCP/IP without netsh command line services using the following command

netsh int ip set address “local area connection” static 10.34.110.42 255.255.255.0 10.34.110.1 1

Changing the DNS IP Address is almost identical as the procedure above, type the following command on the Netsh prompt:

interface ip set dns “Local Area Connection” static 10.32.100.15

Or user following command without netsh prompt

netsh int ip set dns “local area connection” static 10.32.100.15

To Setup WINS, type the following command on the Netsh prompt:

interface ip set wins “Local Area Connection” static 10.32.100.16

Or user following command without netsh prompt

netsh int ip set wins “local area connection” static 10.32.100.16

To Set the Network Properties to Obtain the IP Address from a DHCP Server, type the following command:

interface ip set address “Local Area Connection” dhcp

To Set DNS to Obtain IP Address Automatically, type the following:

netsh interface ip set dns “Local Area Connection” dhcp

There you have it, a useful tool to help you on your network configuration.

 

Advertisements

Author: alahdin

I Muhammad Irfan is an IT professional currently working at SNGPL in IT/MIS Department. My Contact Numbers: +92 (0)333 442 9629 +92 (0)306 466 9667 +92 (0)313 494 5679

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s