Internet

Know your public IP with a simple command on Windows or Linux

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

In the case of a IPv4 addressit would be like this:

80.34.48.125

But there are different types of public IP addresses. It will be the identifier of our network facing the Internet. It will be assigned by the operator, so we will not be able to use the one we want. It is the information that a web page will receive when we visit it or any online service. There are two kinds:

  • static public IP: in this case the address is always fixed. It will not change and this is ideal for setting up an FTP server, for example.
  • dynamic public IP: This guy is going to change. It is the most common and most likely it is your case. It will change as our operator decides, although in many cases we can change it by restarting the router.

It is different from the private IP, since in this case it is used to identify devices facing the router. This device is the one that automatically assigns addresses and this time you could change which one each one uses, in case you need to do it for something.

Steps to view public IP on Windows with one command

In Windows, no matter what version you use, you will be able to find out what your public IP address is in a very simple way through a command. Therefore, if you need to know what it is to configure a server or just out of curiosity, you just have to follow these steps that we are going to show.

  • You have to go to Home
  • You type Terminal or CMD and open it

Once there you will find a window where you will be able to run commands. That’s exactly what you need to find out the public IP through this method. You don’t need to open it with administrator permissions.

Enter Command Prompt

When you are in that window you have to run the following command:

nslookup myip.opendns.com resolver1.opendns.com

Next, different data will appear. You will see the Address section, which is the one that interests you. That is the public IP address of your connection. You can write it down and use it wherever you need. As you can see, you don’t have to do anything else. It is simply to execute that command and the information will automatically appear in the Windows Terminal.

Know the public IP in Windows

How to use a command to see the public IP in Linux

You will be able to do something similar if you have a distribution of Linux. You will only have to execute a command and you will quickly get the information about what your public IP address is, in case you want to know it to configure a server or to see if it has changed correctly after restarting the router.

Once again, you have to go to Terminal on your Linux distribution and run the same command What did you do in the case of Windows:

nslookup myip.opendns.com resolver1.opendns.com

You will automatically find different data, among which is Address. That is what you are interested in knowing what your public IP address is. In this way you will be able to write down the numbering and be able to use it when configuring a server or in any situation that you need it.

Know the IP in Linux

As you have seen, it is very easy to know what the public IP address is through a command and OpenDNS. It is something that you can do both in Windows and in any Linux distribution that you have installed on your computer. You will quickly see the corresponding data and you will be able to use it.

Verify that this is your public IP

Have you seen what is possible? find out the public IP address with a simple command. However, you may want to verify it in some way. You will be able to do it simply by entering a web page and thus see if the IP that it shows you corresponds to what you have obtained through the Windows or Linux command line.

What you are going to do is use the What’s My IP web page. There, just by entering, you will see the address. In addition, you will also be able to see information about the operator, if you are browsing through a proxy or even geolocate that address to have more data.

Check public IP

As you can see, the address is the same as the one shown to you when running the command on Windows or Linux. Does a different one appear to you? In that case it can happen if you are browsing through a VPN. For example, if we give Geolocate from a browser that uses a VPN extension, it will show us that we are in a different place and with another IP.

Geolocate the IP address

To the geolocate the IP you can obtain other data, such as coordinates, city or country. This can be very useful if you are connected through a VPN and you want to verify that it really works and your public IP is that of that program and not your real one. Simply by geolocating the address you will be able to see that you do not appear on the Internet in the place where you are physically.

In short, as you have seen, it is very easy to check what the public IP is simply with a command in Windows and Linux, with the help of OpenDNS. In addition, you can verify this data through a web page and also geolocate the address to see if the VPN you are using works correctly.

If you want to hide your IP address, the best thing to do is use a VPN. You will also be able to browse through a proxy or use the Tor browser. Also, if at any time you need to change that public IP, you can usually do it by turning off the router and turning it back on after a few minutes. You would be assigned a different address, although you can never really choose which one to use.

Related Articles

Leave a Reply

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