How to force Windows 7 to ask for a "fresh" IP address from DHCP server?

306,668

Solution 1

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.

Solution 2

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 (it 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*

Screenshot

Solution 3

This will work:

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

Enter image description here

Solution 4

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

Solution 5

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:
306,668

Related videos on Youtube

haimg
Author by

haimg

Updated on September 18, 2022

Comments

  • haimg
    haimg over 1 year

    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.

    • haimg
      haimg almost 12 years
      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.
    • Iszi
      Iszi almost 12 years
      You could wait for the lease to expire, or try shortening the lease time to expedite the expiration.
    • haimg
      haimg almost 12 years
      @Iszi: it doesn't help. Windows will propose the same IP when renewing the lease.
    • Iszi
      Iszi almost 12 years
      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.
  • Basilevs
    Basilevs almost 10 years
    Duplicates Joachim Sauer's answer.
  • Ray Woodcock
    Ray Woodcock over 9 years
    A cold reboot worked for me.
  • Gregor
    Gregor over 9 years
    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.
  • Kaz
    Kaz almost 9 years
    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.
  • Pete
    Pete almost 9 years
    this worked for me, but i also cleared out the dhcp leases and dns forward/reverse lookups
  • Bibz
    Bibz almost 9 years
    This also worked for me using an admin cmd prompt.
  • Joe Johnston
    Joe Johnston almost 9 years
    This was as painless as it was fast.
  • Aki
    Aki about 8 years
    Only one that worked
  • Fabricio Araujo
    Fabricio Araujo over 6 years
    No, Joachim's didn't mentioned an 2nd computer to hold the undesired address while issuing the commands on the first computer.