Public IP Address using dig can be obtained using command:
dig
$ dig TXT +short o-o.myaddr.l.google.com @ns1.google.com
Alternate using curl:
curl
$ curl ifconfig.me
Last updated 3 months ago