How to Check Your External IP Address on a Linux Server

Background

When using a Linux server, we often access it via remote terminal command line. Sometimes, we need to call third-party services that have IP whitelist restrictions. In such cases, we need to provide our public IP address to the third party for whitelist configuration. Unlike Windows, where we can easily search for our IP on Baidu, how can we do this on Linux?

Tip

Actually, we can still use commands to retrieve our external IP from various websites. You can directly use the following commands:

curl ifconfig.me
curl cip.cc
curl icanhazip.com
curl ident.me
curl ipecho.net/plain
curl whatismyip.akamai.com
curl tnx.nl/ip
curl myip.dnsomatic.com
curl ip.appspot.com
curl -s checkip.dyndns.org | sed 's/.*IP Address: \([0-9\.]*\).*/\1/g'


Leave a Comment