How to Change IP Address on Different Devices and OSes
How to Change IP Address on Different Devices and OSes
com/kb/change-ip-address
An IP address is a numerical label that identifies a device on a local or public network. Changing it alters how your
device appears on the network or to external servers. This may help with connectivity issues, enhance security, and
improve anonymity online.
This tutorial will explain how to change your IP address across major operating systems and platforms,
whether you're troubleshooting a network issue, improving privacy, or accessing restricted content.
Note: Most of these methods are temporary, and the IP address reverts to the previous state after
reboot. To make the change permanent, set a static IP through the advanced network settings or
configure it in your router. This ensures the IP settings persist across reboots.
7. Turn on IPv4 since it's the most commonly used protocol for home networks.
8. Enter the new IP address, subnet mask, default gateway, and preferred DNS server. In this example, they are:
Look for the interface you want to modify (in this tutorial, we'll modify Ethernet 4).
2. Set a static IP address with:
netsh interface ipv4 set address name="Ethernet 4" static [IP address] [Subnet Mask] [Gateway] Copy
netsh interface ipv4 set address name="Ethernet 4" static 192.168.56.10 255.255.255.0 192.168.56.1 Copy
netsh interface ipv4 set dns name="Ethernet 4" static [DNS IP] Copy
netsh interface ipv4 set dns name="Ethernet 4" static 8.8.8.8 Copy
New-NetIPAddress -InterfaceAlias "Ethernet 4" -IPAddress [IP address] -PrefixLength [Subnet Length] -DefaultCopy
Gateway [Gateway]
This sets the DNS servers (8.8.8.8 and 8.8.4.4) for the Ethernet 4 interface. The command does not produce any
output.
Change IP Address on Linux
The process on Linux works either through a graphical interface (GUI) or the terminal.
This section covers both methods. The process differs in other distributions.
Note: Both methods are temporary, and the IP address reverts to the previous state after reboot. To
make the change permanent, configure a static IP in the network settings or modify the /etc/network/
interfaces or /etc/netplan/ configuration files, depending on your distribution.
3. Select your network interface. Under Wired or Wi-Fi, click the gear icon.
5. Enter your desired IP address, netmask, and gateway in the appropriate fields. For instance:
ip addr Copy
This shows all available network interfaces. Look for an interface with an inet line showing an assigned IP address and
the UP status. In this case, enp0s3 is the active interface because it has the IP address 10.0.2.15/24 assigned to it.
2. To change your IP address, use the following command:
Replace [interface] with the name of your interface, and [new IP address] with the desired address:
For example:
The command has no output. The command also doesn't remove the old IP address, leaving the system with two IP
addresses.
3. To remove the old IP and apply the changes, use:
Note: If you want to skip Step 4, use ip addr flush dev [interface] to remove all existing IPs before
adding a new one, or use ip addr change instead to directly replace the current IP.
Replace [gateway-ip] with your actual gateway IP address. For example, use 192.168.1.1 :
7. If DNS is managed by systemd-resolved, set your DNS servers by editing the /etc/systemd/resolved.conf file in
a text editor of your choice. For example, in Nano, use:
8. Locate the [Resolve] section and add or modify the DNS and FallbackDNS entries:
[Resolve] Copy
DNS=1.1.1.1 8.8.8.8
FallbackDNS=9.9.9.9 8.8.4.4
Replace 1.1.1.1 and 8.8.8.8 with your preferred DNS servers. The FallbackDNS is optional but can be set as a backup
if the primary DNS servers are unreachable or fail.
9. Save and exit the file to confirm changes.
10. If NetworkManager is active, modify the DNS settings for your connection with:
3. Choose your active connection and click Details (or Advanced, depending on your macOS version).
Replace the IP address, subnet mask, and router IP with values that match your network.
The command has no output
4. Reset to automatic (DHCP) with:
This removes manual settings and requests a fresh IP from the router. The command does not print any output.
Change IP Address on Android OS
Changing your IP address on Android is a quick process. It helps you troubleshoot network issues, access region-
restricted content, or improve privacy.
Note: You can only set a static IP for Wi-Fi connections. For mobile data, your carrier automatically
assigns your IP.
Take the following steps to reset your IP address on your Android device:
1. Access the Settings app.
2. In the Settings menu, select Wi-Fi (or Connections and then tap Wi-Fi depending on the model.
3. Find the Wi-Fi network you're currently connected to. Tap the gear icon or the greater-than sign> to access the
settings next to it.
Note: When you disable DHCP, you're manually assigning an IP to your network interface. This
means the system will not automatically request an IP address from a DHCP server, and you will
need to configure all network settings (IP address, gateway, DNS) manually.
7. Save changes
Note: If you prefer automatically getting a new IP address, return to your Wi-Fi settings, tap on your
connected network, and tap Forget. Reconnect to your Wi-Fi network, and your device receives a
new dynamic IP address assigned by the router.
3. Scroll down to the IPv4 Address section and tap Configure IP.
4. Select Manual to assign a new IP address.
Note: The method is temporary, and the public IP address may revert to the previous one after the
router is restarted or after the ISP's dynamic IP lease expires. To make the change permanent,
contact your ISP to request a static IP address or configure the router for a static IP.
Note: A VPN changes your public-facing IP address and makes it visible to websites and external
services, masking your location. However, it does not alter your internal, private IP address within
your home or local network.
Note: The method is temporary, and the IP address reverts to the original public IP once the VPN
connection is disconnected or the device is rebooted. To keep your IP masked continuously,
configure your VPN to launch at startup and use features like a kill switch and DNS leak protection.