title: Set from static IP to DHCP on Windows 8 using command line
body: <p>My computer is Windows 8.
  I used command line to set static IP address by</p>
  
  <pre><code>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
  </code></pre>
  
  <p>And static DNS by</p>
  
  <pre><code>netsh interface ipv4 add dnsserver name="Wired Ethernet Connection" address=1.1.1.1 index=1
  </code></pre>
  
  <p>Where 1.1.1.1 in both cases is just for demonstration and was replaced by my real IP.</p>
  
  <p><strong>Edit:</strong> As of 2018, <code>1.1.1.1</code> is used as a DNS server now.</p>
  
  <hr>
  
  <p>I want to change from static IP to DHCP now.</p>
  
  <p>I tried</p>
  
  <pre><code>netsh interface ipv4 set address name="Wired Ethernet Connection" source=dhcp
  </code></pre>
  
  <p>for IP and</p>
  
  <pre><code>netsh interface ipv4 set dnsservers name="Wired Ethernet Connection" source=dhcp
  </code></pre>
  
  <p>for DNS.</p>
  
  <p>However, only the command for DNS worked.</p>
  
  <hr>
  
  <p>I then checked with</p>
  
  <pre><code>ipconfig /all
  </code></pre>
  
  <p>It told me that DHCP was on for Ethernet. However, my previous IP was still there.</p>
  
  <p>Is there any way to set from static to DHCP in command line?</p>