IP addresses are unique identifiers used to determine who is who on the Internet. IP addresses can be formatted differently depending on whether they use IPv4 or IPv6 protocol. Using curl 1 curl ifconfig.co 1 echo $(curl -s api.ipify.org) 1 echo $(curl -s ipaddress.sh) 1 echo $(curl -s ipinfo.io/ip) Using dig 1 dig +short myip.opendns.com @resolver1.opendns.com 1 dig TXT +short o-o.myaddr.l.google.com @ns1.google.com | awk -F'"' '{ print $2}' References What is my IP address? | Cloudflare How to find your IP address in Linux ipaddress.sh - Simple service to get the public IP address What is my IP address? — ifconfig.co ipify - A Simple Public IP Address API The trusted source for IP address data, leading IP data provider - IPinfo.io