Skip to content

Instantly share code, notes, and snippets.

@iMushlih
Forked from ipoddubny/ipconfig.md
Created December 8, 2022 06:12
Show Gist options
  • Save iMushlih/f8599fc6677e5f90349b802f9e2912d0 to your computer and use it in GitHub Desktop.
Save iMushlih/f8599fc6677e5f90349b802f9e2912d0 to your computer and use it in GitHub Desktop.
How to get public IP address from Linux shell

http

curl ifconfig.co
curl icanhazip.com
curl ifconfig.me
curl http://smart-ip.net/myip

telnet

telnet myip.gelma.net

dns

dig +short @resolver1.opendns.com myip.opendns.com
dig +short @ns1.google.com -t txt o-o.myaddr.l.google.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment