Get public IP from command line

To get your machines public IP from the command line, run the following command:

nslookup myip.opendns.com resolver1.opendns.com