My computer is Windows 8. I used command line to set static IP address by
netsh interface ipv4 set address name="Wired Ethernet Connection" source=static address=1.1.1.1 mask=1.1.1.1 gateway=1.1.1.1
And static DNS by
netsh interface ipv4 add dnsserver name="Wired Ethernet Connection" address=1.1.1.1 index=1
Where 1.1.1.1 in both cases is just for demonstration and was replaced by my real IP.
Edit: As of 2018, 1.1.1.1
is used as a DNS server now.
I want to change from static IP to DHCP now.
I tried
netsh interface ipv4 set address name="Wired Ethernet Connection" source=dhcp
for IP and
netsh interface ipv4 set dnsservers name="Wired Ethernet Connection" source=dhcp
for DNS.
However, only the command for DNS worked.
I then checked with
ipconfig /all
It told me that DHCP was on for Ethernet. However, my previous IP was still there.
Is there any way to set from static to DHCP in command line?
For Windows 10
If above
ipconfig /renew
command does not help, tryHowever, maybe all
address
,mask
andgateway
obtained fromdhcp
could match those defined bysource=static
previously.Are there
Lease Obtained
andLease Expires
properties displayed in theipconfig /ALL
output?