Networking

Where to Find Your IP Address on a Computer (Windows, Mac, Linux)

The IP address on your computer is in its network settings, or one command away: ipconfig on Windows, ip address on Linux, and ipconfig getifaddr en0 on macOS. That shows your local address; the public one that websites see is held by your router and is found on its status page or with an IP lookup site.

Local address or public address?

A computer has two kinds of IP address in the usual home setup, and "my IP address" can mean either:

  • Local (private) address. Assigned to your computer by your router. This is the one the commands below show.
  • Public address. The address your traffic appears to come from on the internet. Your computer does not hold it when it sits behind a router.

If you only need to connect a printer, set up file sharing or remote access on your own network, you want the local one. The ranges and the reasons for the split are in public vs private IP address.

Windows: Settings

Microsoft's instructions for Windows 11:

  1. Open Network & internet settings from Start > Settings, or right-click the network icon on the taskbar.
  2. For Wi-Fi, select Wi-Fi, then choose the network you are connected to. For a wired connection, select Ethernet.
  3. Read the value labeled IPv4 address.

The Properties icon beside your connected network opens the same details more quickly. Menu wording differs between Windows versions, so if you do not see these labels, use the command below, which works the same everywhere.

Windows: ipconfig

Open Command Prompt or PowerShell and run:

ipconfig

Microsoft's reference says that used without parameters, ipconfig displays IPv4 and IPv6 addresses, subnet mask and default gateway for all adapters. Example output for a Wi-Fi adapter (the addresses are placeholders):

Wireless LAN adapter Wi-Fi:

   Connection-specific DNS Suffix  . :
   IPv4 Address. . . . . . . . . . . : 192.168.1.42
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.1.1

The address you want is the IPv4 Address of the adapter that has a Default Gateway, because that adapter is the one connected to your router. Adapters for VPNs and virtual machines also appear in the list, usually without a gateway. For the full configuration, including the DHCP server and the MAC address, run ipconfig /all.

macOS: Terminal

Open Terminal and run:

ipconfig getifaddr en0

SS64's reference describes this as printing "the IP address for the first network service associated with the given interface," and says the output is empty if no service is configured or active on that interface. On many Macs en0 is the Wi-Fi interface, but not on all, so if it prints nothing, try en1. I could not confirm the System Settings path from Apple's documentation, so this article does not give one for macOS.

Linux: ip address

In a terminal, run:

ip address

The ip-address(8) manual says the command "displays addresses and their properties," and that with no arguments show lists IPv4 and IPv6 addresses on all interfaces. Example output for one interface (the address is a placeholder):

2: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 ...
    inet 192.168.1.42/24 brd 192.168.1.255 scope global dynamic wlan0

The inet line is the IPv4 address; inet6 lines are IPv6. The number after the slash is the prefix length of the network. Interface names vary by system (wlan0, eth0, enp3s0 and others). Ignore lo, the loopback interface, whose address is only valid inside the host. The manual defines scope global as "the address is globally valid" and scope link as valid only on this device.

How to find your public IP address

Because your computer sits behind your router, it cannot report the public address itself. Two reliable ways to see it:

  • Open your router's admin page, usually at the default gateway address you saw above (192.168.1.1 in the example), and look for WAN, Internet or Connection status.
  • Search for "what is my IP" and use any site that echoes the address your request arrived from.

If the router's WAN address and the lookup result differ, your provider is probably using carrier-grade NAT, covered in the article linked above. A VPN also changes what a lookup site reports, because your traffic then leaves from the VPN server.

If the address starts with 169.254

On Windows, Microsoft's reference notes that ipconfig shows whether values came from DHCP or Automatic Private IP Addressing (APIPA). A 169.254.x.x address means the computer could not get an address from your router. Check the cable or Wi-Fi connection, restart the router, then ask for a new lease:

ipconfig /release
ipconfig /renew

Per Microsoft, /release discards the current DHCP configuration and disables TCP/IP on adapters that obtain an address automatically until you renew, so run both commands together. Run them from a local session, not over a remote connection that depends on that adapter. Name resolution is a separate step from addressing; how DNS works explains how names become addresses.

Frequently asked questions

Is the IP address on my computer the same one websites see?
Usually not. Your computer has a local (private) address handed out by your router, often starting with 192.168 or 10. Websites see the public address of your router or your provider's equipment, so every device in the home shows the same public address.
Why does my computer show more than one IP address?
Each network adapter has its own address. A laptop can have separate entries for Wi-Fi, Ethernet, a VPN and virtual machines, and each adapter can have both an IPv4 and an IPv6 address. Use the entry for the adapter that is actually connected to your router; on Windows that is the one with a default gateway.
Does the IP address change?
It can. Local addresses are normally assigned automatically by DHCP on your router, so a device may receive a different one after a long time offline or a router restart. Public addresses from home providers are also often assigned dynamically.
Can I find my IP address without the command line?
Yes. On Windows 11, open Settings, go to Network & internet, choose Wi-Fi or Ethernet, and read the value labeled IPv4 address. For your public address, use your router's status page or a website that echoes the address your request came from.

Sources