How to View Your IP Address in CMD: A Complete Guide
Finding your IP address using the Windows Command Prompt is one of those skills that looks intimidating until you actually do it — then it takes about ten seconds. But understanding what you're looking at afterward is where things get more nuanced.
What Is an IP Address and Why Check It in CMD?
Your IP address (Internet Protocol address) is a numerical label assigned to your device on a network. It works like a postal address — other devices use it to know where to send data.
There are two kinds you'll regularly encounter:
- Private IP address — the address your router assigns to your device on your local network (home, office, etc.)
- Public IP address — the address your entire network presents to the internet, assigned by your ISP
CMD gives you fast, reliable access to both — without clicking through menus or digging into network settings.
How to Open Command Prompt
Before running any commands, you need to open CMD:
- Press Windows key + R, type
cmd, and hit Enter - Or search "Command Prompt" in the Start menu
- For some commands, you may need to right-click and select "Run as administrator"
The Main Command: ipconfig
The command you need is ipconfig. Type it into the Command Prompt window and press Enter.
ipconfig You'll see a list of network adapters on your machine — Wi-Fi, Ethernet, virtual adapters (like VPN or Hyper-V), and more. Each one shows:
- IPv4 Address — your private IP on the local network (e.g.,
192.168.1.105) - Subnet Mask — defines the network range (e.g.,
255.255.255.0) - Default Gateway — usually your router's IP address (e.g.,
192.168.1.1)
The IPv4 Address next to your active adapter (Wi-Fi or Ethernet) is the one you're typically looking for.
Going Deeper: ipconfig /all
For the full picture, run:
ipconfig /all This expands the output to include:
- MAC address (Physical Address) — your network card's hardware identifier
- DHCP status — whether your IP was automatically assigned or set manually
- DNS servers — the servers your machine uses to resolve domain names
- IPv6 address — the newer IP format, often appearing alongside IPv4
This is particularly useful for troubleshooting network issues, setting up port forwarding, or configuring static IPs.
Understanding IPv4 vs. IPv6 🌐
You may notice two address formats in the output:
| Format | Example | Notes |
|---|---|---|
| IPv4 | 192.168.1.105 | 32-bit, most common for local networks |
| IPv6 | fe80::a1b2:c3d4:e5f6:g7h8 | 128-bit, longer, increasingly standard |
| Loopback (IPv4) | 127.0.0.1 | Always refers to the local machine itself |
Most home and office setups still rely heavily on IPv4 for internal addressing, but IPv6 is more prominent on modern networks and ISP connections.
How to Find Your Public IP via CMD
ipconfig only shows your local/private IP — not the public one your ISP assigns to your router. To find your public IP through CMD, you can use the curl or nslookup commands if available:
curl ifconfig.me Or use a DNS-based lookup:
nslookup myip.opendns.com resolver1.opendns.com The nslookup method queries OpenDNS's resolver to return the public IP tied to your connection. This works reliably on most Windows systems without additional software.
Note: curl may not be available on older versions of Windows (pre-Windows 10 build 1803). On newer systems, it's built in.
Common Issues and What Affects Your Results 🔍
Multiple adapters listed: If you see several network adapters, look for the one labeled "Wi-Fi" or "Ethernet" and check that it has an active IPv4 address — not 0.0.0.0 or an APIPA address starting with 169.254.x.x (which signals a DHCP failure).
APIPA address (169.254.x.x): This means your device couldn't reach a DHCP server to get a proper address. It's a fallback — and usually a sign of a connectivity issue.
VPN or virtual adapters: If you're running a VPN, you'll see additional adapters in the list. Your "real" local IP and your VPN tunnel IP will appear separately.
Static vs. dynamic IP: Some setups (servers, printers, certain workstations) use manually assigned static IPs that don't change. Most home devices use dynamic IPs assigned by DHCP, which can change over time.
What the Output Means for Different Use Cases
The same ipconfig output means different things depending on what you're doing:
- Home user troubleshooting: You mainly need the IPv4 address and default gateway to check router connectivity
- Remote access or port forwarding: You'll need both the private IP (for internal routing) and the public IP (for external access)
- Network administration: The full
ipconfig /alloutput — MAC addresses, DHCP lease times, DNS servers — becomes essential - Developer or server setup: IPv6 addresses and loopback behavior matter more here
The command itself is simple and consistent. What varies is how much of the output is relevant — and that depends entirely on what you're trying to accomplish, the type of network you're on, and how your machine is configured. 💡