How to get to know you Ubuntu server public IP

When come to configure server, we always want to know what’s our server public IP is in order to whitelist or configure the security access to it, when using Widnow server, you may easily open your browser and browse to the website such as or to get to know your public IP.

In Linux CLI environment you don’t have such as facility to doing so, you may need to using command line to query and doing some filtering in order to get your server public IP.


The following are few of the way where you may query and check what’s your server Public IP:


dig +short
dig TXT +short
dig TXT +short | awk -F'"' '{ print $2}'
curl -s | sed -e 's/.*Current IP Address: //' -e 's/<.*$//'  
wget -qO- ; echo
wget -qO-


Leave a Reply, pub-3772983857049267, DIRECT, f08c47fec0942fa0
%d bloggers like this: