If we want to set up our IP Address and DNS Servers from Windows command line, first of all, we need to open the Windows PowerShell or the Windows Command Prompt as Administrator. To do that, we need to press Windows Key + X or press right click on the Start Menu and select the option "Windows PowerShell (Admin)" or " Command Prompt (Admin) ".

With the Command line open, we can start working with some commands.

Here's a list:

SHOW CONFIG
netsh interface ipv4 show config

SET UP STATIC IP ADDRESS
netsh interface ipv4 set address name="Ethernet 4" static 192.168.3.8 255.255.255.0 192.168.3.1

SET UP DYNAMIC IP ADDRESS
netsh interface ipv4 set address name="Ethernet 4" source=dhcp

SET UP STATIC DNS
netsh interface ipv4 add dnsservers "Ethernet 4" address=1.1.1.1 index=1
netsh interface ipv4 add dnsservers "Ethernet 4" address=1.0.0.1 index=2

SET UP DYNAMIC DNS
netsh interface ipv4 set dnsservers "Ethernet 4" source=dhcp

I've attached 2 examples batch files.

Download Set Up Automatic IP and DNS.7z

Download Set up Static IP and DNS.7z

Feel free to email me and make any suggestions.