Check External IP in Linux Server

check external ip

All these commands check external IP in Linux Terminal for any Linux system.


Nice format for External IP

curl -s | sed -e 's/.*Current IP Address: //' -e 's/<.*$//'

Short and Simple to remember


For those with security concerns without using curl

dig TXT +short | awk -F'"' '{ print $2}'

Any of these commands will achieve the same result, so pick which one you like best. Personally, for business and professional environments I stick with dig and just make an alias for it, however, for home projects a simple curl is great.

Leave any Questions and Comments below and I will get back to you. I regularly publish on YouTube, Steemit, and so if you’d like to see more videos and articles click the subscribe button in the top right.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: