15 April 2022

Get external IP address via command line

nslookup:

nslookup myip.opendns.com resolver1.opendns.com

PowerShell:

(Invoke-WebRequest -uri http://ifconfig.me/ip).Content

Invoke via Command Prompt:

PowerShell -Command "(Invoke-WebRequest -uri http://ifconfig.me/ip).Content"

No comments:

Post a Comment