Open Command Prompt and run the right command

Your IP address is visible in Command Prompt using a single command. On Windows, press the Windows key, type cmd, and press Enter. A black window opens — this is Command Prompt.

Type ipconfig and press Enter. Command Prompt displays a list of network adapters and their settings. Look for the line labeled IPv4 Address — the number next to it is your local IP address, usually starting with 192.168 or 10.0.

This address is what your computer uses to talk to other devices on your home or office network. It is different from your public IP address, which is what websites see when you visit them.

Key Takeaways

  • Type ipconfig in Command Prompt to see your local IP address next to "IPv4 Address".
  • Your local IP address usually starts with 192.168 or 10.0 and only works on your own network.
  • Type ipconfig /all to see additional details like your MAC address and DNS settings.
  • To find your public IP address (what the internet sees), use ipconfig /all and look for "Default Gateway", or search "what is my IP" in a browser.

Understanding the ipconfig output

When you run ipconfig, Command Prompt shows one section for each network adapter on your computer. Most computers have at least two: Ethernet (wired) and Wireless LAN (Wi-Fi). If you are connected to the internet right now, the adapter you are using will show an IPv4 Address.

The IPv4 Address is the number your computer uses on your local network. Other devices on the same Wi-Fi or wired network can reach you using this address. The Subnet Mask (usually 255.255.255.0) tells your computer which other addresses are on the same network. The Default Gateway is the router's address — the device that connects your network to the internet.

If an adapter shows "Media State: Media disconnected", that adapter is not currently in use. This is normal if you have both Ethernet and Wi-Fi but are only using one.

Getting more detail with ipconfig /all

Type ipconfig /all and press Enter to see extended information about every network adapter. This command shows everything the basic ipconfig shows, plus additional settings you may need for troubleshooting.

The extra details include your MAC Address (a unique identifier for your network card), your DHCP Server (the device that assigned your IP address automatically), and your DNS Servers (the addresses your computer uses to turn website names into IP addresses). You also see when your IP address lease expires — if you use DHCP, your address is temporary and renews periodically.

Most of the time you only need the IPv4 Address. Use ipconfig /all when you are troubleshooting network problems or when someone asks for your MAC address or DNS settings.

Finding your public IP address from Command Prompt

Your local IP address (192.168.x.x or 10.0.x.x) only works on your own network. Websites and online services cannot reach you using it. To find your public IP address — the one the internet sees — you have two options from Command Prompt.

The first option is to type nslookup myip.opendns.com resolver1.opendns.com and press Enter. This asks OpenDNS's servers what IP address you are connecting from. The answer appears in the output under "Address:" — that is your public IP.

The second option is simpler: open any web browser, search for "what is my IP", and look at the first result. Your public IP appears immediately. This method is faster and does not require Command Prompt at all, but it works if you want to stay in the command line.

Copying and saving your IP address

To copy text from Command Prompt, right-click the window title bar, select "Edit", then "Select All". The text turns white. Right-click again and select "Copy". You can now paste the output into Notepad or any other program.

If you only need the IP address itself, you can type it manually into a text file or email. For most purposes, you only need to remember or write down the IPv4 Address — the long number that starts with 192.168 or 10.0.

If you run ipconfig regularly and want to track changes, save the output to a text file by typing ipconfig > myip.txt and pressing Enter. Command Prompt creates a file called myip.txt in your user folder with the results. Run the command again later and it overwrites the file with the new results.

Why your IP address might change

If you check your IP address on different days and see a different number, this is normal. Most home networks use DHCP, which means your router assigns IP addresses automatically and temporarily. When your computer reconnects to the network or the lease expires, it may receive a different address.

You can set a static IP address — one that does not change — through your router's settings, but this is rarely necessary for home use. If you need a device to always have the same address (like a printer or security camera), your router usually has an option to reserve an address for that device's MAC address.

Your public IP address changes less often but can shift if your internet service provider reassigns it or if your modem restarts. This is also normal and usually does not affect your internet use.

Troubleshooting when ipconfig does not show an address

If you run ipconfig and see "Media disconnected" for all adapters, your computer is not connected to any network. Check that your Ethernet cable is plugged in or that you are connected to Wi-Fi. Once you reconnect, run ipconfig again.

If you are connected but the IPv4 Address field is blank or shows 169.254.x.x, your computer is not receiving an address from the router. Try unplugging your router for 30 seconds, plugging it back in, and waiting two minutes for it to restart. Then run ipconfig again. If the problem continues, restart your computer.

If you still see no IPv4 Address after restarting both devices, your router may not be assigning addresses correctly. Check that DHCP is turned on in your router settings, or contact your internet service provider for help.

Frequently Asked Questions

Is my IPv4 address the same as my public IP address?

No. Your IPv4 address (192.168.x.x or 10.0.x.x) is local to your network only. Your public IP address is what websites see and is usually different. Use nslookup myip.opendns.com resolver1.opendns.com or search "what is my IP" in a browser to find your public address.

Can I change my IP address using Command Prompt?

You can view and renew your IP address in Command Prompt, but you cannot change it directly. Type ipconfig /release to give up your current address, then ipconfig /renew to request a new one from your router. Your router may assign you the same address again.

What does the MAC address do?

Your MAC address is a unique identifier for your network card. It only matters on your local network — routers use it to know which device to send data to. You see it in ipconfig /all listed as "Physical Address". You rarely need it unless setting up a printer or configuring your router.

Why do I see multiple IPv4 addresses in ipconfig?

If you have multiple network adapters (Ethernet and Wi-Fi, for example), each one shows its own IPv4 address. Only the adapter you are currently using to connect to the internet matters. The others show addresses because they are configured, but they are not active.

Is it safe to share my IPv4 address with someone?

Your local IPv4 address (192.168.x.x or 10.0.x.x) is safe to share — it only works on your own network. Your public IP address is less sensitive than a password, but avoid posting it publicly online. Most people cannot do anything harmful with just an IP address, but it is still good practice to keep it private.