Internet

Find out your public IP with a simple command on Windows or Linux

When we browse the Internet, in order for this task to be accomplished, we use various protocols such as TCP / IP, HTTPS, FTP, DNS, and more. Apart from that, we need an identifier that allows us to make requests and receive responses, and that is none other than the public IP address. In this case, what allows us to perform this task on the Internet is the public IP. Sometimes we need to know it to be able to set up a web, FTP or game server. One of the ways in which we could find out is by entering a website to tell us what it is, however, you could also know your public IP with a single command.

The first thing we are going to do is know what a public IP is and the different classes that exist. Then we will see how you can find out your public IP with a simple command in a Windows 10 command prompt window. Afterwards, we will finish by verifying that this IP is our real public IP, and we will see what information we can obtain from it.

What is an IP and what are its types

The IP adress We could define it as a logical and unique identifier for each of the computers that are connected to a network. Today most networks are IPv4, but because we need more and more IP because there are more connected devices, we will have to migrate to IPv6 networks. To give you an idea of ​​the difference, an example of an IPv6 address could be this:

2011:0db8:85a3:0000:0000:8a2e:0370:7344

And another IPv4 address is this, which is the one we have for now:

80.34.48.125

Regarding IPs, we can say that there are two types: those that are public and routable over the Internet, and those that are private. According to the Private IP We could say that they are the ones that identify each of the computers connected to our local network that are behind the NAT. A typical example might be a laptop or smartphone connected to a router’s Wi-Fi network.

Then we have the Public IP, which will be the identifier of our network for the Internet. An important consideration is that we will not be able to put the one we want, and the person in charge of establishing it will be the Internet provider or ISP. Then they could be of two kinds:

  • Static public IP, which would be ideal for mounting an FTP or other server because it never changes.
  • Dynamic public IP, which will change according to what our provider decides.

You may be interested in knowing some tools to see your public IP.

How to see your public IP with a simple command in Windows

If you want to find out your public IP with a simple command it is very simple. The first thing we have to do is open a command prompt window and for this we will follow these steps:

  1. Let’s go to Start Menu.
  2. We type run and we press enter.
  3. There we write CMD and we press enter again.

Then we will find a command prompt window like this to enter commands.

Next, we have to write the following command and then press enter:

nslookup myip.opendns.com resolver1.opendns.com

These are the results I have obtained:

Here you have your public IP with a simple command marked with a red arrow. Next, we will check that the IP we have actually obtained is our public IP.

Contrast the public IP of the result

After obtaining your public IP with a simple command in a command prompt window, it is time to contract the results. We are going to do it through a trusted website which is what is my ip.net. Its operation is very simple, simply by clicking on the previous link you will be able to see your public IP.

As you can see, the public IP matches perfectly with the command that we have previously executed in Windows. Our public IP reveals a lot more information about us than we think. If we click on Geolocate IP we will discover more things.

Here we get new data like city, latitude and longitude. Also, if you want, here you have everything you can discover by knowing someone’s public IP.

As you have seen, we can have our public IP by executing a simple command and using OpenDNS. Finally, here you have learned to know your public IP with a simple command and also through a web.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *