How to Find Your IP Address on Windows Using the Command Line
Knowing your IP address is one of those basic networking tasks that comes up more often than you'd expect — whether you're setting up a home server, troubleshooting a connection issue, or configuring network software. Windows gives you several ways to find it through the command line, and each method surfaces slightly different information depending on what you actually need.
What "IP Address" Actually Means in This Context
Before running any commands, it helps to know there are two distinct addresses in play:
- Private (local) IP address — the address your router assigns to your device on your home or office network. This is typically something like
192.168.1.xor10.0.0.x. - Public IP address — the address the wider internet sees when your traffic leaves your network. This is assigned by your ISP and is shared across all devices on the same connection.
The Windows command line is best suited for finding your local IP address. Retrieving your public IP requires an external lookup, which we'll cover separately below.
Opening the Windows Command Prompt
You have a few quick ways to get there:
- Press Windows + R, type
cmd, and hit Enter - Search for Command Prompt in the Start menu
- Press Windows + X and select Terminal or Command Prompt from the menu (Windows 10/11)
PowerShell works equally well for all the commands listed here.
The Main Command: ipconfig 🖥️
The go-to command for finding your local IP address is:
ipconfig Run this and Windows returns a list of all active network adapters — Ethernet, Wi-Fi, virtual adapters, and more. For each adapter, you'll see:
- IPv4 Address — your local IP on the network (e.g.,
192.168.1.105) - Subnet Mask — defines the range of your local network (e.g.,
255.255.255.0) - Default Gateway — usually your router's IP address (e.g.,
192.168.1.1)
For most users, the relevant section will be labeled Wireless LAN adapter Wi-Fi or Ethernet adapter Ethernet, depending on how you're connected.
Getting More Detail: ipconfig /all
If you need more than just the basic IP, the /all flag expands the output significantly:
ipconfig /all This version adds:
- Physical Address (MAC address) — a hardware identifier for your network adapter
- DHCP Enabled — whether your IP is assigned automatically or set manually
- DNS Servers — the addresses your system uses to resolve domain names
- Lease Obtained / Lease Expires — if using DHCP, when your IP assignment was last renewed and when it expires
- IPv6 Address — the modern IP format alongside IPv4
This is the command to use when diagnosing network issues or configuring software that needs specific adapter information.
Understanding the Output: Multiple Adapters
One thing that trips people up: ipconfig often lists several adapters, not just one. Common entries you'll see alongside your real network connection include:
| Adapter Type | What It Is |
|---|---|
| Loopback Pseudo-Interface | Internal software interface (127.0.0.1) |
| VirtualBox / VMware adapters | Created by virtualization software |
| Bluetooth Network Connection | Active even if not in use |
| vEthernet (WSL) | Created by Windows Subsystem for Linux |
Your actual usable IP address is the one listed under your active Ethernet or Wi-Fi adapter — not any of the virtual ones.
Finding Your Public IP from the Command Line
The Windows command line doesn't have a native command for this, but you can query an external service using PowerShell:
Invoke-RestMethod -Uri "https://api.ipify.org" Or using curl (available in Windows 10 and later):
curl https://api.ipify.org Both return your public-facing IP address as seen from the internet. Keep in mind this reflects the IP assigned to your router by your ISP — not your individual device.
Using netstat and Other Network Commands 🔍
For users who need more context about active connections and which addresses are in use, a few related commands are worth knowing:
netstat -n— lists active network connections with IP addresses and port numbersping [hostname or IP]— tests connectivity and can help confirm your local IP is routing correctlynslookup— queries DNS and can reveal IP addresses associated with domain namestracert [destination]— shows the network path packets take, hop by hop
These go beyond simply finding your IP, but they're part of the same toolkit when you're doing any real network troubleshooting.
Variables That Affect What You See
The output you get from ipconfig varies based on your specific setup:
- Number of adapters installed — more software (VPNs, virtual machines, Bluetooth) means more adapters in the list
- IPv4 vs. IPv6 — newer networks may show an IPv6 address as the primary one; older setups may not show IPv6 at all
- Static vs. DHCP addressing — if your IP is manually configured, the lease information won't appear
- VPN usage — an active VPN adds a virtual adapter and may change which address is effectively "yours" for outbound traffic
- Multiple network connections — a laptop connected to both Ethernet and Wi-Fi simultaneously will show two valid local IP addresses
Which address is the one that matters depends entirely on what you're trying to do with it — and that's the piece only your specific setup can answer.