Hello,
Here is a small command line tool to get your WAN IP adress. The application expects one parameter, the external source providing the WAN IP :
GetWanIP.exe http://whatismyip.akamai.com
GetWanIP.exe https://ipecho.net/plain
Posted 17 March 2022 - 05:27 PM
Hello,
Here is a small command line tool to get your WAN IP adress. The application expects one parameter, the external source providing the WAN IP :
GetWanIP.exe http://whatismyip.akamai.com
GetWanIP.exe https://ipecho.net/plain
Posted 18 March 2022 - 10:04 AM
Easier may be is just click Whatismyip.org Or watismijnip.nl Or whatismyip.com
Posted 18 March 2022 - 01:45 PM
@wimb
But clicking on a hyperlink is not command line, being able to gather the IP address from command line (or batch/script) may have its uses.
@Vortex
But curl can do the same, right?
So it is just for the tiny size of the .exe?
On Windows versions with Powershell, it can be used as well:
(Invoke-WebRequest ifconfig.me/ip).Content.Trim()
And there is still the good/ol:
nslookup myip.opendns.com resolver1.opendns.com
Wonko
Posted 18 March 2022 - 05:32 PM
And there is still the good/ol:
nslookup myip.opendns.com resolver1.opendns.com
Wonko
i love this nslookup idea : good one !
Been using nslookup for years as well as well as https://myip.dnsomatic.com/(opendns) in a browser but never thought and combining both.
Posted 18 March 2022 - 07:07 PM
i love this nslookup idea : good one !
Yep, though unlike curl (or the new little thingy by Vortex) that can use one of the many sites/services, it is "limited" (AFAIK) to the opendns.com and a couple other ones:
nslookup whoami.akamai.net. ns1-1.akamaitech.net
nslookup -q=TXT o-o.myaddr.l.google.com. ns1.google.com
See:
https://www.howtodoj...m-command-line/
There is also telnet, but with it you have one choice only:
telnet telnetmyip.com
and if I recall correctly it is not very reliable.
Wonko
Posted 18 March 2022 - 07:35 PM
Hi Wonko,
It's only a small command line tool to get the WAN IP address. It might be useful for batch scripting.
Posted 19 March 2022 - 09:41 AM
On Windows versions with Powershell, it can be used as well:
(Invoke-WebRequest ifconfig.me/ip).Content.Trim()
And there is still the good/ol:
nslookup myip.opendns.com resolver1.opendns.com
Thanks for the alternative ways to get IP-adress in PowerShell or Command line scripts
Indeed that can be quite useful.
0 members, 0 guests, 0 anonymous users