CMD & Terminal5 min read

How to Find IP Address in Windows CMD & PowerShell: Complete Command Guide

Step-by-step tutorial on discovering your local IP, default gateway, DNS servers, and external public IP using Command Prompt and PowerShell.

D
DNSChecker Systems Admin Team
Windows & Linux Infrastructure Engineer
Published: November 2026
Companion Diagnostic Tool

Verify Public IP Online

Test your domain or IP address in real time with our free online network scanner.

Launch Tool

Checking your network IP address directly from the Windows Command Prompt (CMD) or PowerShell is one of the fastest skills for troubleshooting connectivity, setting up port forwarding, or configuring home servers.

1. Find Local IP via Command Prompt (ipconfig)

Press Win + R, type cmd, and press Enter. Then run:

ipconfig

Look for your active network adapter (e.g., Wireless LAN adapter Wi-Fi or Ethernet adapter). Key fields:

  • IPv4 Address: Your local device IP (e.g. 192.168.1.105).
  • Subnet Mask: Usually 255.255.255.0.
  • Default Gateway: Your router's administrative IP (e.g. 192.168.1.1).

2. Inspect Advanced Network Details (ipconfig /all)

To display your physical MAC address, DHCP lease expiration, and assigned DNS servers:

ipconfig /all

3. Find Your Public IP via CMD & PowerShell

Because ipconfig cannot see beyond your router, you can query a lightweight remote endpoint right from the terminal using Windows 10/11 native curl:

curl -s https://api.ipify.org

This command immediately returns your public IPv4 address without opening a browser.

5. Troubleshooting Windows IP & DNS Cache

If you encounter connection drops or DNS resolution conflicts, execute this standard renewal sequence:

# Flush stale DNS cache
ipconfig /flushdns
# Release current DHCP lease
ipconfig /release
# Request fresh IP lease from router
ipconfig /renew

Frequently Asked Questions

Why does ipconfig only show 192.168.x.x instead of my real internet IP?

Because ipconfig queries your local Network Interface Card (NIC). Your computer sits behind your router's NAT, so it only knows its internal private IP. To find your external internet IP, you must query an outside server using curl or a web tool.

What is the fastest command to get just the IP without extra text?

In PowerShell, run: (Get-NetIPAddress -AddressFamily IPv4 -InterfaceAlias 'Wi-Fi*').IPAddress. Or in CMD: curl icanhazip.com.

Share this technical guide: