3 ms·
You can also just google 'my ip'. But the Akamai service is obviously much easier to use from a script.
by cynwoody 13y ago
You can also just google 'my ip'.
But the Akamai service is obviously much easier to use from a script.
- GuiA 13y agoWhy not grep+awk ifconfig if you need your IP from a script?
- jdc 13y agoNAT
- kelnos 13y agoThat won't give you your publicly-addressable IP if you're behind a NAT.
- cynwoody 13y agoBecause, typically, you are behind a NAT router, and you are after your WAN address, not the LAN address you were assigned by the router. Depending on the router, it might be simpler and more reliable to interrogate the router. Also, some routers come with dynamic DNS updating built in (dynamic DNS is a common reason for needing this service).
- jsnell 13y agoThat won't show you the public IP if you're behind a NAT. Why would you need the public IP instead of the private one? For example because you're trying to search for requests coming from that machin in some logs, take traffic traces from somewhere beyond the NAT, etc.
- Wilya 13y agoIf you're looking for your public ip, it won't always work. Especially if you are behind a nat/proxy. That, plus knowing which interface to inspect among those returned by ifconfig isn't always obvious.
- GuiA 13y agoCool, thanks for the reply! (and to all other replies as well :) )