Open Command Prompt and run ipconfig /release then ipconfig /renew. One line: ipconfig /release && ipconfig /renew. Your connection drops for a few seconds while it renews.

What's going on

Routers lease IP addresses to devices using DHCP. If a lease goes stale, two devices end up with the same IP, or you changed networks, releasing and renewing gets a fresh, correct address and gateway.

It only works when the adapter is set to obtain an IP automatically; with a static IP there’s nothing to renew.

Signs of the problem

  • “Windows has detected an IP address conflict”.
  • 169.254.x.x address or no default gateway.
  • Internet stopped after switching networks.

Why it happens

  • Stale DHCP lease or IP conflict.
  • Router restarted and reassigned addresses.

Fixes to try, in order

  1. Open Command PromptPress Win, type cmd, Enter (admin not required for most cases).
  2. ReleaseRun ipconfig /release. The adapter loses its IP.
  3. RenewRun ipconfig /renew. Wait for a new IPv4 address and Default Gateway.
  4. IPv6Use ipconfig /release6 and ipconfig /renew6.
  5. If renew fails“An error occurred while renewing interface… unable to contact your DHCP server” means the router isn't responding. Restart it and check the cable/Wi-Fi.

Command

ipconfig /release
ipconfig /renew
ipconfig /flushdns

Windows Command Prompt. On Mac: System Settings → Network → Details → TCP/IP → Renew DHCP Lease.

How to confirm the fix: ipconfig shows a valid IPv4 address and Default Gateway, and the internet works.

Prevent it from coming back

Set DHCP reservations in the router for devices that need stable addresses.