How To Find My Public IP Address

From myWiki
Revision as of 14:46, 24 February 2020 by Stevet (talk | contribs) (Created page with "Use dig command for determining my public IP address: ig +short myip.opendns.com @resolver1.opendns.com Store my IP address in a shell variable with the following syntax: m...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Use dig command for determining my public IP address:

ig +short myip.opendns.com @resolver1.opendns.com

Store my IP address in a shell variable with the following syntax:

myip="$(dig +short myip.opendns.com @resolver1.opendns.com)"
echo "My WAN/Public IP address: ${myip}"