How to find your IP address in Command Prompt

Your IP address is a set of numbers that identifies your device on a network — think of it like a mailing address for your computer. You can find it quickly using Command Prompt, a built-in Windows tool that lets you run text commands. The fastest method takes about 30 seconds and shows you both your local IP (the one your home network uses) and your public IP (the one the internet sees).

Command Prompt is already on your Windows computer. You do not need to download anything or use a website. This matters because you stay in control of the information — nothing leaves your machine unless you choose to share it.

Key Takeaways

  • Open Command Prompt by typing "cmd" into the Windows search box, then right-click and select "Run as administrator" for full access.
  • Type ipconfig to see your local IP address (the number your home network assigns to your device).
  • Type ipconfig /all to see additional details including your MAC address and DNS settings.
  • Type curl ifconfig.me or nslookup myip.opendns.com 208.67.222.222 to find your public IP address (what websites see when you connect).

Opening Command Prompt the right way

Click the Windows search box at the bottom left of your screen and type "cmd". You will see "Command Prompt" appear in the results. Right-click on it and select "Run as administrator". This gives the tool full permissions to access your network information without restrictions.

If you just click "Command Prompt" without running as administrator, some commands will work but others will not. Running as administrator takes two extra seconds and prevents errors later. A black window will open — this is where you type your commands.

Finding your local IP address with ipconfig

Type ipconfig and press Enter. The window will display a list of network adapters on your computer. Look for the section labeled "Ethernet adapter" (if you use a cable) or "Wireless LAN adapter" (if you use WiFi). Under that section, find the line that says "IPv4 Address". The number next to it — usually something like 192.168.1.100 — is your local IP address.

This is the address your home router assigns to your device. It is only used within your home network. Other devices on your WiFi can reach your computer using this number, but the outside internet cannot. If you have multiple network adapters (for example, both WiFi and Ethernet), you will see multiple sections — look for the one that shows "Connected" or the adapter you are currently using.

Getting detailed network information with ipconfig /all

Type ipconfig /all and press Enter. This shows everything your network adapter knows about itself: your local IP, your MAC address (a unique identifier for your network card), your DNS servers, your DHCP server, and whether your IP is set to renew automatically.

The MAC address looks like six pairs of numbers and letters separated by hyphens — for example, 00-1A-2B-3C-4D-5E. You need this if you are setting up port forwarding, connecting to a network that requires device registration, or troubleshooting why a device cannot connect. The DNS servers listed are the computers that translate website names (like google.com) into IP addresses your browser can use.

Finding your public IP address from Command Prompt

Your local IP is only visible to devices on your home network. Your public IP is what websites and online services see when you connect to them. To find it from Command Prompt, type curl ifconfig.me and press Enter. After a moment, a single IP address will appear — that is your public IP.

If that command does not work, try nslookup myip.opendns.com 208.67.222.222 and press Enter. Look for the line that says "Address:" — the number after it is your public IP. This address is assigned by your internet service provider and changes periodically (usually when you restart your modem or after a set number of days). Websites use this address to know where to send information back to you.

Understanding what each address means

Your local IP (from ipconfig) is used only inside your home. Your router knows this address and directs traffic to your computer. If you have a printer, security camera, or smart speaker on your WiFi, they also have local IPs. These numbers start with 192.168, 10.0, or 172.16 — these ranges are reserved for home networks and never appear on the public internet.

Your public IP is what the outside world sees. When you visit a website, that website logs your public IP in its server records. Your internet service provider controls this address. If you restart your modem, your public IP usually changes within a few minutes. Some people use VPN services to hide their public IP, but that is a separate choice — Command Prompt shows you what your computer is actually using right now.

Troubleshooting if commands do not work

If you type ipconfig and nothing happens, make sure you opened Command Prompt as administrator. Close the window and try again, right-clicking and selecting "Run as administrator". If you see an error message like "ipconfig is not recognized", your system files may be damaged — restart your computer and try again.

If the curl or nslookup commands for your public IP do not work, your firewall may be blocking them. This is rare but possible. The simplest workaround is to open a web browser and search "what is my IP" — any search engine will show you your public IP instantly. You lose the benefit of staying in Command Prompt, but you get the same answer.

Frequently Asked Questions

Why do I have two different IP addresses?

Your local IP is assigned by your router to your device only. Your public IP is assigned by your internet service provider to your entire home network. Websites see only the public IP. Your router translates between them — when a website sends data back to your public IP, the router knows to send it to the local IP of the device that requested it.

Does my IP address change?

Your local IP usually stays the same unless you restart your computer or your router forgets it. Your public IP changes when you restart your modem or after your internet service provider's lease period expires (often every 24 hours, but this varies by provider). If you need a stable public IP, you can contact your internet service provider about a static IP, though this usually costs extra.

Can someone harm me if they know my IP address?

Knowing your public IP alone is not enough to harm your computer. They would also need to find an open port and a vulnerability in software listening on that port. A firewall (which Windows includes by default) blocks most incoming connections. Your local IP is only visible to devices on your home network, so it is much lower risk.

What is the difference between IPv4 and IPv6?

IPv4 addresses look like four numbers separated by dots (192.168.1.1). IPv6 addresses look like groups of letters and numbers separated by colons (2001:0db8:85a3::8a2e:0370:7334). IPv6 is newer and provides more addresses, but most home networks still use IPv4. Command Prompt shows both if your network supports IPv6.

Why would I need to know my IP address?

You might need your local IP to set up port forwarding, connect to a printer on your network, or troubleshoot connection problems. You might need your public IP to report abuse to a website or to understand what information is visible to the outside internet. Most of the time you do not need either one, but Command Prompt makes it fast to learn about you do.