To Learn Real(Public) Ip Over a Command-Line – Linux / Windows
On systems (depending on the project and environment), we often work with local IP's
, and we can obtain them from the network settings or through the command line. However, to process real IP's
, we can obtain real IP via the router/modem interface or the URL
that provides online services (multiple sites are available) and then process. Above is the NCC ripe.net as an example. There is a section above the entrance on the right side that reflects your output rope.
Now let’s take a look at how to get our real IP from the command line. I will use three alternative commands in Linux and one in Windows.
With Linux Dig command;
1 | > dig +short myip.opendns.com @resolver1.opendns.com |
With Linux Curl command;
1 | > curl ipinfo.io/ip |
With Nslookup on Windows; (You can also use Nslookup for Linux.)
1 | > nslookup myip.opendns.com. resolver1.opendns.com |
I hope it has been a useful article.