How to find out your public ip using cmd or shell

This tutorial describes how to find out the public ip address or external ip address of your home, office, or any network using a personal computer.

How to find out your public ip using cmd or shell

Someone is requesting your public IP address for some business reason in order to whitelist your public IP address on their system. In the Google search engine, we can type the keyword "what is my ip?" This option is known to everyone. In some environments, we don't have access to a GUI (graphical user interface). There we have only the CLI command-line interface; in that case, use the second method to find out the public IP address. 

Firsts method or Know Method:-

Launch any browser on your computer. In the address bar, type google.com, and in the Google search bar, type "what is my ip?" It will tell you the public ip address of your machine.

Refer to the screenshot:-

what is my public ip

Second method or Hacker Mode:-

Let's get to the command prompt and use the Windows Command Prompt or a Linux Terminal to find out what your public IP address is.

I am using a Windows computer for demonstration.

1. Press the Win+R key on your keyboard.

How to open a run search bar win+R

2. In the RUN search box, type cmd and hit the enter key.

how to open command prompt

3. A black terminal box will open.

4. In the command prompt, type curl ifconfig.me or curl ifconfig.me/all and hit the enter key. boom command prompt display my public IP address.

curl ifconfig.me to get the public ip address

curl ifconfig.me --> Display only the public IP of your computer

curl ifconfig.me/all --> Display detailed information and forwarder

Note:- Curl should be installed by default on Linux computers, and for Windows, the curl command will be available on Windows 10 and later.

About CURL:-

A curl is a command-line tool that lets you transmit HTTP requests and receive responses from the command line or a shell script. It is available for Linux distributions, Mac OS X, and Windows. To use Curl to run your REST web API call, use the Curl command syntax to construct the command.

For more detailed documentation, please refer to the following documentation or website: https://ifconfig.me:

C:\> curl ifconfig.me115.97.226.31
C:\> curl ifconfig.me/ip115.97.226.31
C:\> curl ifconfig.me/uaMozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36
C:\> curl ifconfig.me/langen-US,en;q=0.9
C:\> curl ifconfig.me/encodinggzip, deflate, br
C:\> curl ifconfig.me/mimetext/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
C:\> curl ifconfig.me/charset
C:\> curl ifconfig.me/forwarded115.97.226.31, 34.160.111.145,35.191.15.164
C:\> curl ifconfig.me/allip_addr: 115.97.226.31
remote_host: unavailable
user_agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36
port: 49450
language: en-US,en;q=0.9
referer:
connection:
keep_alive:
method: GET
encoding: gzip, deflate, br
mime: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
charset:
via: 1.1 google
forwarded: 115.97.226.31, 34.160.111.145,35.191.15.164
C:\> curl ifconfig.me/all.json{"ip_addr":"115.97.226.31","remote_host":"unavailable","user_agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36","port":49450,"language":"en-US,en;q=0.9","method":"GET","encoding":"gzip, deflate, br","mime":"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","via":"1.1 google","forwarded":"115.97.226.31, 34.160.111.145,35.191.15.164"}

I hope this information is useful for you. Please forgive any typos or incomplete sentences.
Post a Comment (0)
Previous Post Next Post