- To seek out your native IP handle from the CMD Command immediate, merely sort “ipconfig” into the immediate. Will probably be listed as “IPv4 Tackle”.
- To seek out your public (exterior) IP handle from a command immediate, sort “curl ifconfig.me” on Home windows 10 or 11.
Like most issues in Home windows there are dozens of how to get one thing achieved, so immediately we’re displaying you a number of totally different methods to seek out your public or personal IP handle from the command immediate.
Why would you need to get your IP handle from the command line when you possibly can simply look it up within the GUI in Home windows 10 or Home windows 11? In the event you’re an old-school type of geek, utilizing the command line to do issues comes naturally, so that you may discover it simpler to sort in a fast command as a substitute of clicking a complete bunch of settings. The actual purpose, although, is that you simply’re in all probability going to automate it in a script, and also you simply want to determine the appropriate command for the job.
Which IP Do You Need? Native (Personal) IP vs Exterior (Public) IP
Earlier than we present you how you can discover your IP handle we have to discuss concerning the distinction between private and non-private IP addresses.
Every community that you simply’re related to may have an IP handle related to it—in case your laptop is related through Wi-Fi in addition to Ethernet, each of the adapters may have their very own IP addresses, and your native TCP/IP routing desk is accountable for determining which one finally ends up getting used for which requests. More often than not, although, you’re simply related to your Wi-Fi router, so your native laptop connecting to your native community has a single IP handle.
Your web router, nonetheless, is all the time related to 2 separate networks: your native (personal) community in your home, and the exterior (public) community of your ISP. The router interprets the request out of your laptop utilizing NAT (Community Tackle Translation) to permit all the pieces in your community to share a single public IP handle.
When your Home windows PC, iPhone, or Raspberry Pi connect with the web from your home, the server that they connect with will see them as the identical IP handle: the exterior (public) IP in your router.
Get Native (Personal) IP handle from CMD (Command Immediate)
To seek out your native or personal IP handle from the command immediate in any model of Home windows, merely open up the Begin Menu, seek for the Command Immediate, open it up, and kind the next command:
Home windows will output a number of particulars, however the line you’re in search of is the one that claims “IPv4 Tackle” which can show your native / personal IP handle for the adapter that’s related to your Wi-Fi or Ethernet community.
Some folks may have a couple of adapter within the listing, and should you’ve obtained Digital machine software program put in or WSL you may see a number of additional stuff, so that you’ll must verify for the adapter that’s related to the community you’re looking for the handle for.
Remember that is your personal IP handle, not the general public handle that web sites will see your site visitors coming from. In your public IP handle, hold studying.
Get Public (Exterior) IP handle from CMD (Command Immediate)
To seek out your public / exterior IP handle from the command immediate, you will have a number of totally different choices, however maybe the best one is to easily sort the next command (assuming you’ve already opened Command Immediate from the Begin Menu)
This command will immediately output your present public IP handle proper there on the command line. It really works by utilizing the curl command to obtain the contents of ifconfig.me, which is a quite simple web site that anyone set as much as output nothing however your public IP handle. In the event you plug that area title into your browser, you’ll see the identical factor.
It’s value noting that Home windows 10 and 11 have the curl command constructed proper in, however should you’re utilizing an earlier model of Home windows you in all probability might want to obtain a duplicate of curl for Home windows. Curl ought to work from inside the common Home windows CMD immediate, however you too can use it from inside the Bash shell inside Home windows 10 or 11 as properly.
There are additionally quite a few different strategies for pulling up your public IP handle from the command immediate, and we’ll embody these for completeness—and simply in case the primary one stops working! Listed here are a couple of:
That final one weirdly contains an additional line break, which could not work very properly should you’re utilizing this in a script.
Maybe my favourite methodology makes use of OpenDNS and the trusty nslookup command that’s been on each model of Home windows since ceaselessly:
nslookup myip.opendns.com. resolver1.opendns.com
Now that you simply’ve had tons of enjoyable studying about how you can do all this from the command immediate I ought to in all probability level out which you could additionally simply sort “what’s my ip” into Google and it’ll let you know. Nevertheless it’s simply not as a lot enjoyable that method.
Wish to get extra sophisticated? Do you know which you could really change your IP handle from the command immediate? It’s also possible to edit the Home windows Registry, lock your PC, change a password, begin Excel or Phrase, map community drives, shut down your PC, uninstall packages, evaluate recordsdata, discover recordsdata, find your Home windows product key, and even use all kinds of keyboard shortcuts from the old-school Home windows command immediate.
Get Public IP Tackle from Powershell
In the event you’re prepared to actually have enjoyable, right here’s how you can discover your public IP handle from a extra highly effective PowerShell immediate (or script, for that matter). Simply sort this into your PowerShell terminal:
(Invoke-WebRequest -UseBasicParsing -URI ifconfig.me ).Content material
It’ll immediately return your IP handle identical to all the opposite examples above. It’s also possible to break up it out into a number of traces should you’re going to be utilizing it in a script:
$myip = Invoke-WebRequest -UseBasicParsing -URI ifconfig.me $myip.Content material
It will create the
$myip variable and put the contents of the request into it, after which you should use
$myip.Content material to spit out the worth or use it elsewhere in a script if you must. You possibly can change the ifconfig.me web site with any of the opposite examples that we confirmed you earlier, simply in case that web site isn’t working in some unspecified time in the future sooner or later.
Get Public IP Tackle from the Bash Shell
In the event you’re utilizing the Bash shell from inside Home windows, you’ll in all probability be pleased to know that getting your public IP handle is simply so simple as from the command immediate. Simply sort the next command:
It ought to work precisely the identical method because the command did within the common CMD immediate, however you are able to do a lot extra with the Bash shell than the command immediate.
Prepared to seek out extra IP handle data? You could find your IP handle utilizing the GUI in Home windows 10 or Home windows 11, or lookup the IP of your iPhone, Roku, printer, your Wi-Fi router, or another machine. When you’re an professional, you possibly can graduate to seeing what’s listening on TCP/IP ports and organising static IP routes.