NetWiki

I can make net work

User Tools

Site Tools


leftovers:find_my_public_ip

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
leftovers:find_my_public_ip [2023-08-26 03:27] – [Find My Public IP] daveleftovers:find_my_public_ip [2024-08-22 19:50] (current) – [PowerShell] dave
Line 12: Line 12:
 CLI commands to find your public IP address. CLI commands to find your public IP address.
  
-===== Curl =====+==== Curl ====
 <code> <code>
 > curl icanhazip.com > curl icanhazip.com
Line 22: Line 22:
 </code> </code>
  
-===== Dig =====+==== Dig ====
 <code> <code>
 +# via OpenDNS
 > dig +short myip.opendns.com @resolver1.opendns.com > dig +short myip.opendns.com @resolver1.opendns.com
 11.22.33.44 11.22.33.44
  
 +# via Google
 > dig TXT +short o-o.myaddr.l.google.com @ns1.google.com > dig TXT +short o-o.myaddr.l.google.com @ns1.google.com
 "11.22.33.44" "11.22.33.44"
 +
 +# via Akamai
 +> dig @ns1-1.akamaitech.net ANY whoami.akamai.net +short
 +11.22.33.44
 </code> </code>
 +Install the [[Software:isc_dig_host|ISC dig and host]] tools.
 +
  
-===== nslookup =====+==== nslookup ====
 <code> <code>
 # same as above, but nslookup for Windoze # same as above, but nslookup for Windoze
Line 43: Line 51:
 </code> </code>
  
-===== PowerShell =====+==== PowerShell ====
 <code> <code>
   (Invoke-WebRequest 'http://icanhazip.com/').Content   (Invoke-WebRequest 'http://icanhazip.com/').Content
Line 52: Line 60:
 </code> </code>
  
 +Invoke-WebRequest is also aliased as curl so this is another way to get the same result.
 +
 +<code>
 +curl icanhazip.com | Select-Object -ExpandProperty Content
 +</code>
 +
 +You could sub http://api.ipify.org/ to get the same results.
leftovers/find_my_public_ip.1693020455.txt.gz · Last modified: by dave

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki