Configure NIC in command prompt

Netsh.exe is a command line utility that allows locally / remotely, display or edit the NIC configuration of a live computer. Following are few tasks done using Netsh.exe.

Configure IP, Mask and gateway
C:\>netsh interface ip set address name=”Local Area Connection” static

View your TCP/IP settings
C:\> netsh interface ip show config

Export current NIC settings to a file

C:\>netsh -c interface dump > c:\localip.txt

Import NIC settings from a file

C:\>netsh -f c:\localip.txt

NIC to automatically obtain an IP address from a DHCP server

C:\>netsh interface ip set address “Local Area Connection” dhcp

Configure DNS address in NIC
C:\>netsh interface ip set dns “Local Area Connection” static

Dynamically obtain DNS IP from DHCP

C:\>netsh interface ip set dns “Local Area Connection” dhcp

Note: add index=1 and index=2 if you like to add primary and secondary DNS. Default primary.


About Robiul

Robiul has 15 years of continuous successful career experience in ICT with extensive background in System Engineering, IT infrastructure design, operations and service delivery, managing IT projects / MIS functions for local and multi-national companies with in-depth knowledge of multiple operating systems as well as construct / manage small to medium size Data Center. Proven ability to design and implement medium to semi-large scale LAN/WAN/WLAN and system infrastructures. Academic qualification: Master of Science in Information Systems. Professional certifications are: MCSE, CCNA, ITIL and FoundStone Security Professional, VCP, NetAPP, CISSP etc.
This entry was posted in Windows and tagged . Bookmark the permalink.