Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm troubleshooting a certain issue with my DHCP configuration, and need my Windows machine to ask for a "fresh" IP address, so I can see which address DHCP server gives by default.

When I do ipconfig /release followed by ipconfig /renew, Windows "proposes" its old IP address to the DHCP server (just checked with Wireshark, initial "DHCP Discover" message has Option-50 (requested IP address) with Windows machine's old IP).

Tried disabling/enabling network adapter. Same behavior.

Question: How can I force Windows to just ask for a new IP address, without proposing its old IP address.

share|improve this question
    
Is this on your own home network? If so, assigning a static IP may work fine. –  Simon Sheehan Sep 5 '12 at 23:54
3  
Yes, static IP will work... However, I've specifically stated that I'm debugging a problem with DHCP, so I need an answer to my question, not a workaround. –  haimg Sep 6 '12 at 0:04
    
You could wait for the lease to expire, or try shortening the lease time to expedite the expiration. –  Iszi Sep 6 '12 at 0:09
    
@Iszi: it doesn't help. Windows will propose the same IP when renewing the lease. –  haimg Sep 6 '12 at 0:15
    
Fire up a VM or another box and set that to statically take over that IP? It might be more helpful if you could describe the issue you're really troubleshooting. –  Iszi Sep 6 '12 at 0:16

7 Answers 7

up vote 11 down vote accepted

There is no procedure worth the effort. It's stored in a registry key, but that portion of the registry is cached while the network subsystem is running. So you'd have to shut the system down, boot another OS installation, mount the registry, delete the key, and then reboot into the original OS installation. The key is DhcpIPAddress but it is only used across reboots, so you can't modify it.

Uninstalling and re-installing the network adapter might work.

share|improve this answer
    
A cold reboot worked for me. –  Ray Woodcock Oct 31 '14 at 22:07

You could try configuring the DHCP server to give out addresses in a range that excludes the old address. Eg, if the old address is x.x.x.101, set the range to be x.x.x.120 to 130. I know you're interested in determining some default behavior of the server, so this may not be helpful if it alters the very thing you want to determine.

share|improve this answer

I've just found a workaround. It does require changing the DHCP server configuration however:

  • Shut down the offending system (or just disable the network adapter)
  • Delete the lease on the DHCP server (optional, depending on server)
  • Configure a registration for the original IP address (using any random MAC address)
  • Boot up the client (or re-enable the network adapter)
  • Delete the dummy registration
share|improve this answer

A little late to the party here, but this will work:

If your ethernet driver supports it, you could change the MAC address on the NIC. Its usually a relatively painless procedure. Then ipconfig /renew should give you a new IP address.

enter image description here

share|improve this answer

Running net stop dhcp and then net start dhcp appears to work on my Windows 7 test system. The resulting DHCP Discover packet does not include Option 50.

I guess it's your choice if you want run ipconfig /release first in order to signal to the DHCP Server that the IP Address is available. (should remove the existing lease on the DHCP server).

So, to summarize, the whole process would be (in an Administrator cmd window):

ipconfig /release
net stop dhcp
net start dhcp
ipconfig /renew

If you wanted to indicate only a connection matching Local* (for example, Local Area Connection), then you could do:

ipconfig /release Local*
net stop dhcp
net start dhcp
ipconfig /renew Local*
share|improve this answer
1  
Just checked. Does not work. –  Basilevs Sep 7 '14 at 16:31
    
Work for me. I did (in administrator cmd window): ipconfig/release then net stop dhcp then net start dhcp then ipconfig/renew and I got a new address. –  Gregor Mar 12 at 21:22
    
ipconfig /renew Local* just prints the interface info, as if I typed ipconfig with no arguments. Edit: nope! It prints the info (for all interfaces, not just ones matching Local*) and renews the lease. –  Kaz Jun 24 at 19:24
    
this worked for me, but i also cleared out the dhcp leases and dns forward/reverse lookups –  Pete Jul 30 at 0:46

Step 1. write down ip address that you want to get rid of on the client:
ipconfig /release run net stop dhcp

Step 2. on second computer, temporarily assign manual ip address you wrote down in step 1. on first computer where you trying to change dhcp reservation: net start dhcp ipconfig /renew

Step 3. first computer will now get next ip address that dhcp will offer remove static address on secondary machine by switching back to dhcp setting.

share|improve this answer
    
Duplicates Joachim Sauer's answer. –  Basilevs Sep 7 '14 at 16:32

I found this solution here.

  1. Reset WinSock and TCP/IP Stack
    a. Open a Command Prompt as administrator
    b. Reset WINSOCK entries: netsh winsock reset catalog
    c. Reset TCP/IP stack: netsh int ip reset reset.log
    d. Reboot the machine (you can run both commands first, I tend to put multiple commands in notepad and then copy and paste into the command window).

  2. Renew your IP
    Configure your IP settings, whether static or dynamic, and we’re done

share|improve this answer

protected by Community May 20 at 23:30

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.