how to find ip address in cmd
How to find IP address in CMD
Answer: If you need to find the IP address of your computer using the Command Prompt (CMD) in Windows, follow these steps:
1. Open Command Prompt:
- Press
Windows key + R
to open the Run dialog box. - Type
cmd
and pressEnter
or clickOK
.
2. Use the ipconfig Command:
- In the Command Prompt window, type
ipconfig
and pressEnter
. - This command will display a detailed list of your network configurations.
Understanding the Output:
- Look through the output for an entry that says “Ethernet adapter” or “Wireless LAN adapter”, depending on whether you are using a wired or wireless connection.
- Under the adapter section, look for the field “IPv4 Address” or “IP Address”. This is your local IP address.
Here’s an example of what the output might look like:
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . : example.local
Link-local IPv6 Address . . . . . : fe80::d4a4:7f47:3e5c:1155%11
IPv4 Address. . . . . . . . . . . : 192.168.1.2
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1
In the above example, the IPv4 Address is 192.168.1.2
, which is the local IP address of the computer.
Finding External IP Address:
If you need your external IP address (the one visible to the internet), you can’t find it directly using ipconfig
. Instead, you can use a web-based service or a different command in CMD:
-
Using nslookup:
- Type
nslookup myip.opendns.com resolver1.opendns.com
in the Command Prompt and pressEnter
. - Look for the “Address” field in the output. This will display your external IP address.
- Type
-
Using PowerShell:
- Open Command Prompt and type
powershell
to enter the PowerShell environment. - Type
(Invoke-WebRequest -Uri "http://ifconfig.me/ip").Content.Trim()
and pressEnter
. Your external IP address will be shown.
- Open Command Prompt and type
By following these steps, you can easily find both your internal and external IP addresses using CMD on a Windows machine.