What’s my ip address–from Windows command line (cmd.exe)



If you’re behind a router (and most people are) then ipconfig.com will give your LAN address–local to your building, but not your WAN address–the IP address that websites see you as.

The most common way to find your WAN IP address is http://whatsmyip.net.

But that doesn’t (easily) work from the Windows command line, eg cmd.exe

But, your salvation is here: Here is something that does. Quite simple:

C:\users\YOURNAME> nslookup myip.opendns.com. resolver1.opendns.com

Notice the dot (“.”) after myip.opendns.com. That prevents it getting appended.


Reference: