A few words of thanks would be greatly appreciated.

Command Prompt to Find IP Address

This article will explain how to detect your Windows IP address using a command prompt. In addition to introducing the command prompts, we will also explain why certain sites may show a different IP address than the address shown by your command prompt, and give you some possible ways to sidestep this issue. We've also included a quick loop tip for those using Linux.

Detect Your IP Address with Command Prompt

Your IP address (or Internet Protocol address) is a numeric identification number that detects your computer in a given network. It is used to communicate between nodes in a system network.

Public IP Address vs. Private IP Address

When you connect to the internet through an ADSL modem, your computer has two network interfaces.

A private interface is used to network computers connected to a router. Computers in this network typically have an IP address in the range of 192.168.0.* or 192.168.1.* A router will connect to the gateway with an IP address in the range of or A command via the computer will allow you to determine the private IP address that has been assigned to your router.

You can also simply log onto specialized sites to access this information.

Find Your Private IP Address

Command Prompt for Windows

Go to Start Menu and select Run. Then, type
cmd /k ipconfig /all

Your IP address will appear in an open window after a few seconds.

Command Prompt for Windows 95/98

If you are a Windows 95 or Windows 98 user, head to your Start Menu and select Run. Then type

Command for Linux

Linux users can find their IP address by typing in
as a root. Alternatively, you may also type in
in a console as a user.

Find Your Public IP Address

The easiest way to find your public IP address is to head to whatismyip. Simply click on the link to view the address.

Some Sites Show Different IP Addresses

may often show a different IP address than that seen on sites such as whatismyip. If this is the case for you, there are two possible explanations.

The first explanation is that you did not initially check the right interface. You may have multiple IP addresses corresponding to multiple modems or WiFi connections. Use
ipconfig /all
to view all interfaces.

The second explanation is that you are behind a router, gateway, or proxy. A router will perform address translation between the internet and your LAN (NAT). If this is the case, please refer to our tips on detecting your public IP and retrieving your public IP.

Note that whatismyip sees only the internet address of your router, while
only sees the address of your computer.

Photo: © alexskopje - 123rf.com

A few words of thanks would be greatly appreciated.

Ask a question
CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jean-François Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.


This document, titled « Command Prompt to Find IP Address », is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).

1 Comment