Sometimes we need to verify what our external IP address is. Let’s see how we can get the public IP information using command-line in Windows. Please note that you need to be connected to the Internet to use the below-mentioned commands and services.
If you have a home network, you can run these commands on one device even if multiple devices are connected to the Internet. They should all have the same public IP.
Find your public IP address using Command Prompt
You can get public IP information using the command nslookup and the OpenDNS service. Just run the following command on your command prompt and you will get your external IP address.
The following command will get you the public IP address of your computer:
nslookup myip.opendns.com resolver1.opendns.com
Find public IP address of your computer using PowerShell
You can also use PowerShell to get the external/public IP without using any third-party IP lookup tool.
Open PowerShell by going to Run –> powershell. Run the following command to get the public IP address of your computer:
(Invoke-WebRequest ifconfig.me/ip).Content.Trim()
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article