To set the DNS IP address of the network to static with no address                             >netsh interface ip set dns name=”Local Area Connection” source=static addr=none

To set the primary DNS IP address of the network                                                     >netsh interface ip add dns name=”Local Area Connection” addr=8.8.4.4 index=1

To set the secondary DNS IP address of the network
>netsh interface ip add dns name=”Local Area Connection” addr=8.8.8.8 index=2

To set the DNS IP address from dhcp server                                                               >netsh interface ip set dns name=”Local Area Connection” source=dhcp

Besides that, you can set the IP address, subnet mask and default gateway address of a LAN interface with following command

>netsh interface ip set address name=”Local Area Connection” static 192.168.1.1 255.255.255.0 192.168.1.10

where,

Local Area Connection = name of the adapter

192.168.1.1 = static IP address of the computer

255.255.255.0 = subnet gateway

192.168.1.10 = default gateway

Advertisements