转载自:https://helpdeskgeek.com/networking/change-ip-address-and-dns-servers-using-the-command-prompt/
interface ip set address name="Local Area Connection" static 192.168.10.42 255.255.255.0 192.168.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, we changed the network properties for “Local Area Connection” to use a static IP address of 192.168.10.42, a subnet mask of 255.255.255.0 and a default gateway of 192.168.1.1.
Changing the DNS IP address is almost identical to the procedure above. Type the following command on the Netsh prompt:
interface ip set dns "Local Area Connection" static 192.168.1.1
To setup WINS, type the following command:
interface ip set wins "Local Area Connection" static 192.168.1.1
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