Change IP and DNS by command in Windows

  1. Run command prompt as administrator

  1. Check interface name
netsh interface show interface

  1. Check you current network information
netsh interface ipv4 show config

  1. Now use the belows command change your IP and DNS (For this example change on interaface Wi-Fi).
netsh interface ipv4 set address name="YOUR INTERFACE NAME" static IP_ADDRESS SUBNET_MASK GATEWAY

  1. Recheck your IP and DNS was changed by run command on No.3 again.
netsh interface ipv4 show config

Change Only DNS command

netsh int ipv4 set dns name="Ethernet" static 8.8.8.8 primary validate=no
netsh int ipv4 add dns name="Ethernet" 8.8.4.4 index=2

Ref: howtogeek.com