Open Command Prompt and run the right command

To see your IP address in Command Prompt, open the program and type ipconfig, then press Enter. The output shows your network settings, including your IPv4 address — the four-number sequence like 192.168.1.5 that identifies your device on your network.

On Windows, Command Prompt is built in. Press the Windows key, type "cmd", and select Command Prompt from the results. On Mac or Linux, you would use Terminal instead and type ifconfig or ip addr, depending on your system.

Key Takeaways

  • Type ipconfig in Command Prompt on Windows to display your local IP address and other network details.
  • Your IPv4 address appears next to "IPv4 Address" in the output and typically starts with 192.168 or 10.0 on home networks.
  • The command also shows your subnet mask, default gateway, and whether you are using DHCP to receive your address automatically.
  • To see only your IP address without extra information, type ipconfig | findstr "IPv4" instead.

Understanding what ipconfig shows you

When you run ipconfig, Command Prompt displays information for each network adapter on your computer. Most people have at least two: Ethernet (if plugged in with a cable) and Wi-Fi (wireless). Each one gets its own section in the output.

Look for the line that says "IPv4 Address" — that is your local IP address, the one your router assigns to your device. Below it you will see "Subnet Mask" (usually 255.255.255.0 on home networks) and "Default Gateway" (usually your router's address, like 192.168.1.1). These three pieces work together to let your device talk to other devices on the same network.

Finding your public IP address instead

The address ipconfig shows is your local IP address — it only works inside your home or office network. Your public IP address is what the rest of the internet sees, and Command Prompt cannot show it directly because your router handles that connection.

To find your public IP address from Command Prompt, type curl ifconfig.me on Windows 10 or later, or nslookup myip.opendns.com resolver1.opendns.com on any Windows version. Both commands reach out to an external service and return the address your internet provider assigned to your router. The public address is what websites and online services see when you connect to them.

Using ipconfig /all for detailed network information

If you need more detail than the basic ipconfig command provides, type ipconfig /all instead. This shows additional information like your MAC address (a unique identifier for your network card), your DNS servers, and whether DHCP is enabled.

The MAC address is useful if you are setting up network access rules or trying to identify a specific device on your network. DNS servers are the computers that translate website names into IP addresses — your router usually provides these automatically, but you can change them if you want to use a different service. The detailed output also shows your DHCP lease time, which tells you when your router will reassign your address.

Refreshing your IP address from Command Prompt

If you have changed your network settings or your router has assigned you a new address, you can force your computer to request a fresh IP address. Type ipconfig /release to give up your current address, then type ipconfig /renew to request a new one from your router.

This is useful when your internet stops working but you do not want to restart your computer. The release and renew process usually takes a few seconds, and your connection should return once the new address is assigned. You will see the new address if you run ipconfig again. Some people run these commands together as ipconfig /release && ipconfig /renew to do both at once.

Saving ipconfig output to a file

To keep a record of your network settings, you can save the ipconfig output to a text file. Type ipconfig > network_info.txt and press Enter. Command Prompt creates a file called network_info.txt in your current folder with all the information from ipconfig.

This is helpful if you need to share your network details with technical support or compare your settings before and after a change. You can open the file in Notepad or any text editor to read it. If you want the detailed version, use ipconfig /all > network_info.txt instead. The file will be saved in whatever folder Command Prompt is currently pointing to, usually your user directory.

Frequently Asked Questions

What is the difference between IPv4 and IPv6?

IPv4 addresses have four numbers separated by dots, like 192.168.1.5. IPv6 addresses are longer and use letters and numbers with colons, like 2001:db8::1. IPv6 is the newer standard with more available addresses, but most home networks still use IPv4. ipconfig shows both if your network supports them.

Why does my IP address keep changing?

Your router uses DHCP to assign addresses automatically, and it may give your device a different one each time you restart or reconnect. If you need the same address every time, you can set a static IP in your router settings or on your device itself. Check your router's manual for instructions specific to your model.

Can I change my IP address from Command Prompt?

You can release and renew your address with ipconfig /release and ipconfig /renew, but you cannot directly set a specific address from Command Prompt. To assign a static IP, you need to change settings in your network adapter properties or your router's configuration page.

What does "DHCP Enabled: Yes" mean?

DHCP stands for Dynamic Host Configuration Protocol. When it is enabled, your router automatically assigns your device an IP address. If it is disabled, your device uses a static address that does not change. Most home networks have DHCP enabled for simplicity.

How do I know which network adapter to look at?

If you are connected by Ethernet cable, look at the section labeled "Ethernet" or "Local Area Connection". If you are on Wi-Fi, look for "Wireless LAN adapter" or "Wi-Fi". The adapter you are actually using will have an IPv4 address listed. Adapters you are not using may show "Media disconnected" or no address at all.