Command Prompt to Find IP Address

October 2016

This article will explain how to detect your Windows IP address using a command prompt. This tip is applicable to Windows 2000, Windows XP, and Windows Vista users, as well as to Windows 95 and Windows 98 users. We've also included a quick loop tip for those using Linux.

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.

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 2000/XP/Vista

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: © Vector -

Related :

This document entitled « Command Prompt to Find IP Address » from CCM ( is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.