Hi everybody, today i share a simple list for get your public IP in linux command line.
First command, check your IP using dyndns service is very long command.
curl -s http://checkip.dyndns.org/ | grep -o "[[:digit:].]\+"
This is short command and very easy to remember.
Ipify is the same than ifconfig but response is in
JSON format, prefer for webservices or other apps.
Mi favorite is this command, is very elegant only send a request to obtain IP using DNS server.
dig +short myip.opendns.com @resolver1.opendns.com
Other command is the same that others.
For to use this commands you need to install
sudo aptitude install curl
sudo aptitude install dnsutils