How to Check Your IP Address Using CMD (Command Prompt)

Knowing your IP address is one of those fundamental networking tasks that comes up more often than you'd expect — whether you're troubleshooting a connection, setting up a home server, or configuring network devices. The Windows Command Prompt gives you a fast, reliable way to find this information without digging through menus. Here's exactly how it works and what the results actually mean.

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 identify and communicate with each other. You actually deal with two types regularly:

  • Private IP address — assigned to your device within your local network (home Wi-Fi, office LAN). Typically starts with 192.168.x.x, 10.x.x.x, or 172.16.x.x
  • Public IP address — assigned to your router by your ISP, visible to the wider internet

CMD gives you direct access to your private/local IP and related network adapter details. Your public IP requires a different method (more on that below).

How to Open Command Prompt

Before running any commands, you need to open CMD:

  1. Press Windows + R, type cmd, and press Enter
  2. Or type "Command Prompt" in the Windows search bar and click the result
  3. Or press Windows + X and select Terminal or Command Prompt from the menu

No administrator privileges are needed just to check your IP address.

The Main Command: ipconfig

The go-to command for checking your IP address is:

ipconfig 

Type it into the Command Prompt window and press Enter. You'll immediately see output listing all your active network adapters and their assigned addresses.

Reading the ipconfig Output

The output can look overwhelming at first, but the key fields are straightforward:

FieldWhat It Means
IPv4 AddressYour local IP on the current network
Subnet MaskDefines the range of your local network
Default GatewayYour router's IP address
IPv6 AddressThe newer IP format (if enabled on your network)

Look for the adapter that matches your current connection — Ethernet adapter if you're wired, or Wireless LAN adapter Wi-Fi if you're on Wi-Fi. Ignore adapters labeled "Loopback" or "Bluetooth" unless those are relevant to your task.

Getting More Detail: ipconfig /all

If you need deeper information — like your MAC address, DHCP server, or DNS server — run:

ipconfig /all 

This expands the output to include:

  • Physical Address (MAC) — hardware identifier for each adapter
  • DHCP Enabled — whether your IP is assigned automatically or set manually
  • DHCP Server — usually your router's IP
  • DNS Servers — the servers resolving domain names for your connection
  • Lease Obtained / Lease Expires — when your current IP assignment was given and when it expires

This extended view is particularly useful when diagnosing network configuration issues or setting up port forwarding on a router.

Finding Your Public IP via CMD 🌐

CMD doesn't have a built-in command to directly return your public IP, but you can pull it using the curl or nslookup tools if they're available on your system:

Using curl (Windows 10/11):

curl ifconfig.me 

Using nslookup against a DNS-based lookup service:

nslookup myip.opendns.com resolver1.opendns.com 

The nslookup method queries OpenDNS, which returns your public-facing IP as seen from outside your network. This is your router's IP — shared by all devices on your home network.

Other Useful Network Commands Alongside ipconfig

Once you're in CMD checking IPs, these related commands often come in handy:

  • ping [IP or domain] — tests connectivity to another device or website
  • tracert [destination] — shows the route your traffic takes to reach a destination
  • netstat -an — lists active connections and listening ports
  • arp -a — shows IP-to-MAC address mappings for devices on your local network

Each of these builds a clearer picture of what's happening on your network beyond just your own address.

Factors That Affect What You See in CMD

The output from ipconfig isn't the same for every user, and a few variables explain the differences:

  • Number of adapters installed — virtual machines, VPNs, and Bluetooth adapters each create additional entries in the output, which can make it harder to find the address you need
  • Static vs. dynamic IP — if DHCP is disabled and you've set a static IP manually, that's what appears; if DHCP is enabled, the address can change when your lease expires or you reconnect
  • IPv4 vs. IPv6 — modern networks often assign both; which one your traffic actually uses depends on your router and network configuration
  • VPN software — if a VPN is active, your visible IP and routing may differ from your base network setup 🔒
  • Windows version — the exact command syntax and available tools (like curl) vary slightly between Windows 7, 10, and 11

For most home users running Windows 10 or 11 on a standard router, ipconfig returns clean, readable output with one relevant adapter. On work machines, development environments, or systems running virtualization software, the output is often more complex and requires knowing which adapter to focus on.

IPv4 vs. IPv6: A Quick Note

You may notice your adapter shows both an IPv4 address and an IPv6 address. IPv4 is the traditional 32-bit format (192.168.1.x) and still handles most local network communication. IPv6 is a newer 128-bit format designed to handle the exhaustion of available IPv4 addresses globally. Both can be active simultaneously on the same adapter — this is called dual-stack networking.

Whether you need to pay attention to your IPv6 address depends entirely on what you're doing. Most home networking tasks, like finding your IP for port forwarding or local device communication, still rely on IPv4.


How much of this matters in practice comes down to what you're actually trying to accomplish — a basic local IP lookup is three keystrokes away, but interpreting the full output of ipconfig /all in a complex network environment is a different task entirely depending on your setup. 🖥️