forgotmyip.com
Home / Guides

How to change your IP address

New local IP, new public IP, and why a restart often changes nothing.

Published

First decide which address you want to change. Your local (private) IP is your device's address on your home or office network. Your public IP is the one websites see. They're changed in different ways. Not sure which is which? See Public vs private IP.

Get a new local IP: renew your DHCP lease

If your device is set to get an IP address automatically, it gets it with DHCP (Dynamic Host Configuration Protocol) (Apple Support; Microsoft Support). With DHCP's dynamic allocation, an address that a client no longer needs can be reused automatically (RFC 2131). A device may give up its address (its lease) by sending a DHCPRELEASE message to the DHCP server (RFC 2131). Then it asks for an address again.

Releasing is optional. DHCP works correctly even if a device never sends a release (RFC 2131).

Windows

Open Command Prompt and run:

ipconfig /release
ipconfig /renew

/release sends a DHCPRELEASE message to the DHCP server and discards the adapter's IP configuration. /renew renews the DHCP configuration, but only works on adapters set to obtain an IP address automatically (Microsoft Learn). For IPv6 addresses handed out by DHCPv6, use ipconfig /release6 and ipconfig /renew6 (Microsoft Learn).

Watch out: between /release and /renew, TCP/IP is disabled on the adapter, so you're offline (Microsoft Learn). Run both commands on the computer itself, not over a remote connection.

Mac

If your Mac gets its address with DHCP, you can force it to renew. Apple notes this can also fix some connection problems (Apple Support).

  1. Open Apple menu → System Settings → Network.
  2. Click the network service that needs a new address, then click Details.
  3. Click TCP/IP, then Renew DHCP Lease.
  4. Click OK.

Linux (NetworkManager)

On distributions that use NetworkManager, take the connection down and bring it back up:

nmcli connection show            # list connection names
nmcli connection down "Home Wi-Fi"
nmcli connection up "Home Wi-Fi"

nmcli connection down deactivates a connection, and nmcli connection up activates one by its name, UUID or D-Bus path (nmcli manual). Replace Home Wi-Fi with your connection's name.

iPhone and Android

We didn't find official instructions for renewing a lease on phones. On Android you can forget a saved Wi‑Fi network and join it again: Settings → Network & internet → Internet, touch and hold the network, then tap Forget (Android Help). Android's help doesn't say this gives you a different address, so don't count on it.

Why you often get the same address back

Renewing or restarting often gives you the same IP back, by design. When a device asks for an address, a DHCP server SHOULD offer the device's current address first. If there isn't one, it SHOULD offer the device's previous address, if it's still free. Only after that does it pick a new one (RFC 2131, §4.3.1). A device can also ask to reuse an address it remembers (RFC 2131, §3.2).

The same applies one level up. If your internet provider gives your router its public address with DHCP, restarting the router follows the same rule (RFC 2131), so you will often get the same public IP back.

Choose a specific local IP

If you want a particular local address rather than just a different one, you can set it manually. Microsoft recommends DHCP because it makes TCP/IP settings easier to manage (Microsoft Support), so only do this if you need to.

Windows (Microsoft Support):

  1. Open Settings → Network & internet, then Wi‑Fi → Manage known networks (pick the network) or Ethernet.
  2. Next to IP assignment, select Edit.
  3. Choose Manual and turn on IPv4.
  4. Fill in IP address, Subnet mask and Gateway, then select Save.

To go back, choose Automatic (DHCP) in the same place.

Mac (Apple Support): in System Settings → Network → (your service) → Details → TCP/IP, set Configure IPv4 to Manually, then enter the IP address (and subnet mask and router, if you were given them).

Tip: if you set an address by hand, make sure no other device uses that address. Another option is a DHCP reservation in your router: in DHCP's “manual allocation”, the administrator chooses a client's address and DHCP delivers it to that client (RFC 2131, §1). See Static vs dynamic IP.

Change the public IP websites see

If your router uses NAT (Network Address Translation) to swap your device's private address for its own public one (RFC 3022), renewing your device's lease doesn't change the public IP websites see. To show websites a different address, send your traffic through something else:

For what each option does and doesn't hide, see What does my IP address reveal?

IPv6: temporary addresses change by themselves

If you have IPv6, your device may already change its address regularly. Temporary addresses are made by adding a random part (the interface ID) to the prefix your network handed out (RFC 8981). So the prefix from your provider stays the same, and only the last part changes.

On Linux, list your temporary IPv6 addresses with (ip-address(8)):

ip -6 address show temporary

Check that it worked

Reload forgotmyip.com and check both the IPv4 and IPv6 lines, since a change may affect only one of them. From a terminal:

curl https://forgotmyip.com

More options: Get your IP from the command line. To see your local address instead, follow How to find your IP address.

Sources

  1. Apple Support — Use DHCP or a manual IP address on Mac
  2. Microsoft Support — Essential network settings and tasks in Windows
  3. RFC 2131 — Dynamic Host Configuration Protocol (DHCP)
  4. Microsoft Learn — ipconfig
  5. Apple Support — Renew your IP address from the DHCP server on Mac
  6. NetworkManager — nmcli reference manual
  7. Android Help — Connect to Wi‑Fi networks on your Android device
  8. RFC 3022 — Traditional IP Network Address Translator (NAT)
  9. Mozilla — What is a VPN?
  10. Tor Project — About Tor Browser (three relays)
  11. Apple Support — About iCloud Private Relay
  12. RFC 8981 — Temporary Address Extensions for SLAAC in IPv6
  13. Linux man page — ip-address(8)

Forgot your IP? See your IPv4 and IPv6 now.

Show my IP