Is there a command that checks the global IP address that I used to connect to only the command line without using a browser?
linux
$curl inet-ip.info/ip
116.64.92.65
Now you can check it out
JSON format is here
$curl inet-ip.info/json
{"IP":"116.64.92.65","Hostname":"[116-64-92-65.rev.home.ne.jp.]","CountryCode":"JP","CountryName":"Japan","Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"],"AcceptEncoding":["gzip, deflate, sdch"],"AcceptLanguage":["en-US,en;q=0.8,ja;q=0.6"],"UserAgent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36(KHTML, like Gecko) Chrome/49.0.2623.75 Safari/537.36", "Via":[1.1 vegur], "XForwardedFor":[116.64.92.65"], "XForwardedPort":[80", "XForwardedProto":["http", "RequestURI"/":}
httpbin.org is recommended because you can check various HTTP responses in addition to looking up IP addresses.
$curl httpbin.org/ip
Also, there seems to be a way to find the current IP address from DNS (Reference)
$dig o-o.myaddr.l.google.com@n s1.google.com txt+short
$ dig [email protected] + short
578 Understanding How to Configure Google API Key
581 PHP ssh2_scp_send fails to send files as intended
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
618 Uncaught (inpromise) Error on Electron: An object could not be cloned
915 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
© 2024 OneMinuteCode. All rights reserved.