---

Display Public IP Address Using the Command Line in Linux

There are two ways to retrieve external/public IP addresses for your Linux server or system. First, the fastest method is by resolving the DNS (dig, host), and the other method is by retrieving data from the server through the HTTP protocol (cURL, wget).