How to Find Your IP Address Using Command Prompt
Knowing your IP address is one of those fundamental networking skills that comes up more often than you'd expect — whether you're troubleshooting a connection issue, setting up a home server, or just trying to understand how your network is configured. The good news: Command Prompt on Windows makes it fast and straightforward, once you know which command to use and what the output actually means.
What Is an IP Address, and Why Does It Matter?
An IP address (Internet Protocol address) is a numerical label assigned to every device on a network. It's how devices find and communicate with each other — think of it as a mailing address, but for data packets.
There are two types you'll likely encounter:
- IPv4 — The traditional format: four sets of numbers separated by dots (e.g.,
192.168.1.10). Still the most common format on home networks. - IPv6 — The newer, longer format using hexadecimal values (e.g.,
fe80::1a2b:3c4d:5e6f:7g8h). Increasingly common as IPv4 addresses run out globally.
You also have two distinct IP addresses to be aware of:
| IP Type | What It Is | Where It Comes From |
|---|---|---|
| Local (Private) IP | Your device's address on your home or office network | Assigned by your router |
| Public (External) IP | Your network's address on the internet | Assigned by your ISP |
Command Prompt gives you direct access to your local IP address. Your public IP requires a different method.
How to Open Command Prompt
Before running any commands, you need to open Command Prompt:
- Press Windows + R, type
cmd, and hit Enter - Or search "Command Prompt" in the Start menu and click to open it
- On Windows 10/11, you can also right-click the Start button and select Windows Terminal or Command Prompt
No administrator privileges are needed just to check your IP address.
The Main Command: ipconfig
The command you want is:
ipconfig Type it into Command Prompt and press Enter. You'll see output listing every active network adapter on your machine — including Ethernet, Wi-Fi, and any virtual adapters.
Here's what the key fields mean:
- IPv4 Address — Your device's local IP on the current network
- Subnet Mask — Defines the range of your local network (commonly
255.255.255.0) - Default Gateway — The IP address of your router; the exit point for traffic leaving your local network
🖥️ Look for the adapter that matches how you're currently connected — Ethernet adapter if you're wired in, Wireless LAN adapter Wi-Fi if you're on Wi-Fi. Ignore entries labeled "Disconnected" or virtual adapters from software like VPN clients or virtual machines unless those are relevant to your task.
Going Deeper: ipconfig /all
For more detailed information, run:
ipconfig /all This extended output adds:
- Physical Address (MAC Address) — The hardware identifier for your network adapter
- DHCP Enabled — Whether your IP was automatically assigned (Yes) or manually set (No)
- DHCP Server — The IP address of the device handing out addresses, usually your router
- DNS Servers — The servers your device uses to resolve domain names
- Lease Obtained / Lease Expires — When your current dynamic IP address was assigned and when it will refresh
This level of detail is particularly useful when diagnosing network issues, configuring static IPs, or checking whether your DNS settings are what you expect them to be.
Finding Your Public IP via Command Prompt
ipconfig only shows your local IP — the address your router assigned to your device within your home or office network. It won't show the public-facing IP your internet provider assigned to your router.
To retrieve your public IP from the command line, you can use:
nslookup myip.opendns.com resolver1.opendns.com This queries OpenDNS's public resolver and returns your external IP address in the "Address" field of the response. It's a clean, reliable method that doesn't require opening a browser.
Alternatively, tools like curl (available in Windows 10 and 11 via PowerShell or Command Prompt) can query public IP APIs directly:
curl ifconfig.me This returns just your public IP as plain text — useful in scripts or when you want a minimal output. 🌐
Why Your IP Address Might Look Different Than Expected
Several variables affect what you see when you run ipconfig:
- DHCP vs. static assignment — Most home users are on DHCP, meaning their router assigns a local IP automatically. That address can change over time. Servers or devices that need a consistent address use static IPs.
- Multiple network adapters — Laptops and desktops often have several adapters listed. A machine with both Wi-Fi and Ethernet connected simultaneously will show a different IP for each.
- VPN software — Active VPN connections create virtual adapters with their own IP ranges. If a VPN is running, you'll see additional entries — and your effective public IP will be different from your ISP-assigned one.
- IPv6 assignment — Many modern routers and ISPs now assign IPv6 addresses alongside IPv4. You may see both listed for the same adapter. Which one your device actually uses for outbound traffic depends on your network and application.
- Corporate or institutional networks — Managed environments often use different subnet ranges, proxy configurations, or restrict direct IP visibility in ways that home networks don't.
Understanding which adapter and which address type applies to your situation is what determines whether the IP you're looking at is the one you actually need. That part depends entirely on what you're trying to do and how your specific network is set up.