How to Find Your IP Address on Windows, Android, macOS, and Linux

Goal: when a router, NAS, game, server, or troubleshooting tool asks for an IP address, the first question is which IP address it needs. A local IP identifies a device inside your network; a public IP identifies the Internet-facing connection seen by remote services. This guide shows reliable graphical and command-line methods on Windows, Android, macOS, and Linux, then explains gateway, DNS, NAT, IPv6, and CGNAT so you can interpret the result correctly.
Quick steps
- Windows: open Terminal and run
ipconfig; look for IPv4 Address under the interface actually in use. - Android: open Settings > Network/Internet > Wi-Fi > your connected network and inspect the network details. Labels vary by manufacturer.
- macOS: open System Settings > Network > Wi-Fi/Ethernet > Details, or use the appropriate interface in Terminal.
- Linux: run
ip addrorhostname -I, then identify the address assigned to the active interface. - Public IP: check the WAN status in your router or use a reputable external IP-checking service. A VPN or CGNAT can change what that result means.
Expected result: you can identify the correct local address, distinguish it from gateway and public addresses, and explain why a service is or is not reachable.
What you need before you start
- Connect to the network you want to inspect.
- Know whether you need the device’s local address or the Internet-facing public address.
- If you are troubleshooting a service, note whether a VPN, proxy, virtual machine, or container network is active.
- Do not treat an IP address as proof of a person’s identity or precise physical location.

Detailed tutorial
Local address, public address, gateway, and DNS are different things
Private IPv4 ranges such as 192.168.x.x, 10.x.x.x, and 172.16.0.0/12 are commonly used inside local networks. The default gateway is usually the router address used to leave that subnet. DNS servers translate names such as example.com into IP addresses. A machine can therefore have a perfectly valid local IP and still fail to reach websites if its gateway or DNS configuration is wrong.
| Value | Example | Purpose | Common mistake |
|---|---|---|---|
| Local IPv4 | 192.168.1.42 | Identifies a device on the LAN | Copying a VPN or VM address instead |
| Default gateway | 192.168.1.1 | Routes traffic to other networks | Assuming it is the PC address |
| DNS | Router or public resolver | Resolves names | Calling it a Wi-Fi failure when only DNS is broken |
| IPv6 | Several addresses may exist | IPv6 connectivity | Publishing a temporary address as if it were fixed |
Windows: use PowerShell for a clean view
Run the following in Windows Terminal / PowerShell without administrator rights. It only displays interfaces that have an IPv4 default gateway, which often removes inactive virtual adapters from the output. No value needs to be changed.
Get-NetIPConfiguration | Where-Object { $_.IPv4DefaultGateway } |
Select-Object InterfaceAlias, IPv4Address, IPv4DefaultGateway, DNSServerYou should see one or a few entries corresponding to Wi-Fi or Ethernet. If nothing appears, verify that the PC is actually connected. If several interfaces appear, identify the one carrying your traffic. The command is read-only, so there is nothing to undo.
macOS and Linux: identify the active interface first
On macOS, en0 is common but should not be assumed on every Mac. Start with System Settings or network tools to identify the active interface. On Linux, ip route is particularly useful because the line beginning with default via shows both the gateway and the outgoing interface.
Run the following in a Linux terminal without root privileges. Replace INTERFACE_NAME with the interface name you actually observed, for example wlp2s0 or enp3s0. Use the interface name you actually observed; the placeholder INTERFACE_NAME is not a literal command value.
ip route
ip address show dev INTERFACE_NAMEAn IPv4 address shown after inet and different from 127.0.0.1 is usually the one you need for the local network. A 169.254.x.x address on Windows, or an equivalent link-local situation, often means DHCP assignment failed. If Linux reports that the device does not exist, re-check the interface name.

Public IP, NAT, and CGNAT
The public address shown by a website is the Internet exit point observed by that site. It may belong to your home router, an ISP carrier-grade NAT gateway, a corporate VPN, or a commercial VPN server. It does not uniquely identify the device that generated the traffic.
If you want to host a service at home, compare the WAN address displayed by your router with the public IP seen from the Internet. A router WAN address in 100.64.0.0/10 is a classic sign of CGNAT. In that situation, a normal IPv4 port-forwarding rule on your router may not be sufficient because the ISP performs another layer of translation upstream.
Practical case: local service works on the host but not on another device
- Record the server’s local IP on the interface that is actually connected.
- From another device on the same LAN, test connectivity to that address.
- Check whether the application listens on the LAN address or only on
127.0.0.1. - Check the host firewall before changing router settings.
- Only configure Internet exposure if remote access is genuinely required and properly secured.
A frequent mistake is to keep searching for the “right PC IP” when the application is bound only to localhost. localhost and 127.0.0.1 are reachable only from the same machine unless the application is configured differently.
IPv6: do not ignore it
A device may have several IPv6 addresses at once: link-local, global, and temporary privacy addresses. Do not disable IPv6 simply because an older tutorial only discusses IPv4. For troubleshooting, note the interface, address scope, and route in use. If a service works over IPv4 but not IPv6, treat the listening address and firewall rules as separate issues.
How to verify that it works
- The local address belongs to the same expected subnet as the gateway.
- A default route exists on the active interface.
- Name resolution works if DNS is configured correctly.
- If a VPN is active, repeat the check with and without the VPN to understand which public IP is being used.
Common problems and fixes
- Several IPv4 addresses are listed: ignore disconnected, VPN, VM, and container adapters unless they are the network you are diagnosing.
- You see 169.254.x.x: the device probably did not receive a normal DHCP lease.
- The public IP differs from the router WAN IP: investigate VPN, proxy, or CGNAT.
- A website works by IP but not by name: focus on DNS rather than Wi-Fi signal strength.
Safety and precautions
- Do not publish full network screenshots containing host names, internal services, SSIDs, or management addresses unless necessary.
- Do not disable the firewall just to make a service reachable; create the narrowest rule required for the service.
- For a stable local address, prefer a DHCP reservation in the router instead of randomly choosing an address inside the DHCP pool.
Frequently asked questions
Should I give someone my IPv4 or IPv6 address?
Give the address type the tool or administrator expects. On many home LANs, the local IPv4 address is still the most common value requested.
Why does my local IP change?
DHCP leases can change. A router-side DHCP reservation is usually the cleanest way to keep a device at a consistent local address.
What does a VPN do to my public IP?
A VPN usually makes remote sites see the VPN server’s exit address instead of the public address of your direct connection.
Final checklist
- Active interface identified.
- Local IP and prefix noted.
- Default gateway identified.
- DNS servers identified.
- Public IP clearly distinguished from local IP.
- VPN/proxy status taken into account.
Key takeaways
The method: find the address on the active interface first, then identify gateway, DNS, and public IP separately. Do not copy the first number you see without context.
The key principle: an IP address only makes sense when you know which interface, network layer, and purpose it belongs to.
Official sources and references
- Microsoft Learn — Official documentation
- Microsoft Learn — Official documentation
- Microsoft Learn — Official documentation
- Apple Support — Official documentation
- Linux man-pages — Reference
Image credits
- Photo 1 — Pexels · Pexels License.
- Photo 2 — Pexels · Pexels License.
- Photo 3 — Pexels · Pexels License.
Commentaires