How to: Get Public IP address with CMD

You are on a server or have a screen sharing session and don’t want to open a ‘whatismyip’ website with all the advertisements.


It can be a very hassle to open a website with a lot of advertisements under the eye of a customer and on a server it just don’t feel right. With a NSlookup in CMD we can get the public IP very easily within two steps.

  • Open CMD as an admin of a desired machine
  • Fill in the following command
nslookup myip.opendns.com resolver1.opendns.com

Voila, under the section “address” of “myip.opendns.com” you will find the public IP.

Share this: