You can even lookup info for other up addresses. E.g. https://ipinfo.io/1.1.1.1
You can even lookup info for other up addresses. E.g. https://ipinfo.io/1.1.1.1
It's powered by largest residential proxy network so they almost certainly never gonna ban your IP.
The free DB has to be re-downloaded monthly IIRC.
And JSON: https://ifconfig.co/json?ip=1.2.3.4
PS C:\> irm ipinfo.io
PS C:\> $x = irm ipinfo.io
PS C:\> $x.timezone
Europe/London
Personally, I use http://checkip.dyndns.org/ by habit, with its one-line return.This service also works perfectly fine with https://ifconfig.co/
$ curl ifconfig.me
129.6.255.60
$ curl ifconfig.me/all
ip_addr: 129.6.255.60
remote_host: unavailable
user_agent: curl/7.68.0
port: 52332
Your example doesn't work. It needs to be:
irm ipinfo.io/json
Your other example can be get like this: irm http://checkip.dyndns.org | % HTML | % body
(And this ifconfig.co doesn't seem to actually, you know, work which is a big hindrance)
https://github.com/mpolden/echoip/issues/130
Perhaps you ought to open one for Norway? (I don't think it would be appropriate for me to do it because I am not seeing the issue, not being in Norway.)
For the benefit of anyone interested: for a "self-hosted" solution, you can do this entirely within Nginx. Here's an example config:
server {
listen 80 default_server;
listen [::]:80 default_server;
listen 443 default_server;
listen [::]:443 default_server;
# Use Letsencrypt for SSL. This part will depend on your own setup.
ssl_certificate /etc/letsencrypt/live/<my domain>/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/<my domain>/privkey.pem;
server_name <my domain>;
# Deny all access at all paths; useful if you're hosting other stuff behind
# the same Nginx server (e.g. reverse proxy)
location / {
deny all;
}
# At /ip, return 200 with the client IP address in the body
location = /ip {
default_type text/plain;
return 200 '$remote_addr';
}
}
That said, do you know of any software library that exposes the Geoip database (or at least Geoip Lite which you one easily obtain for free) in a nice API? Like how a lot of programming languages have tzinfo/tzdata libraries for querying the Tz database.
curl icanhazip.com
curl ipv4.icanhazip.com
curl ipv6.icanhazip.com
If the software behind the service is available and looks like it'll be easily usable for years because it has few to no dependancies that are likely to deprecated, I might actually commit the effort to memory and use it for all similar demands, similar to how I keep track of specific CLI *nix tools which I can rest assured, even if there are no updates and potential security issues, most are going to be usable at some future date in a pinch.
curl wtfismyip.com/json
Referring of course to the new Linux commands "ip a sh". :)
I hope he gets around to deploying it properly some day.
I always wondered where this info comes from, looking at the similar pattern I presume from the same provider. Is it a premium service from MaxMind or what?
http://checkip.amazonaws.com/
http://whatismyip.akamai.com/
dig +short myip.opendns.com @resolver1.opendns.com
I decided to solve this task in a fast and reliable fashion, so I made a tool which discovers own IP address using major public STUN servers: https://github.com/Snawoot/myip
Program issues parallel queries to public STUN servers to determine public IP address and returns result as soon as quorum of matching responses reached.
Works fast and reliable, especially compared to services requiring HTTPS:
user@dt1:~> time curl https://api.ipify.org
45.152.165.44
real 0m2,515s
user 0m0,030s
sys 0m0,019s
user@dt1:~> time curl ifconfig.co/
45.152.165.44
real 0m0,131s
user 0m0,011s
sys 0m0,008s
user@dt1:~> time myip
45.152.165.44
real 0m0,084s
user 0m0,012s
sys 0m0,012s
ifconfig.io https://news.ycombinator.com/item?id=17168415
ifconfig.in https://news.ycombinator.com/item?id=4070133
ifconfig.me https://news.ycombinator.com/item?id=6429921
IPv4: curl http://whatismyip.akamai.com curl http://whatismyip.akamai.com/advanced
Both hosts are distributed around the world using the Akamai platform and should be fast for everyone.
listen whatismyip
bind :::80 # listen on ipv4/ipv6
bind :::443 ssl crt /etc/haproxy/ssl/fullchain.pem
mode http
http-request return status 200 content-type "text/plain" lf-string "%[src]" if { path /ip }
http-request return status 200 content-type "application/json" lf-string "{\"ip\":\"%[src]\"}" if { path /json_ip }
http-request deny
def lambda_handler(event, context):
return {
'statusCode': '200',
'headers': None,
'body': event.get('requestContext', {}).get('identity', {}).get('sourceIp', 'unknown')
}
I do this, though my lambda is a bit more complex in practice, since I have some triggers that say "if this thing reports a new IP, do something".Of course, AWS provides this basic service as checkip.amazonaws.com
https://dev.maxmind.com/geoip/geoip2/geolite2/
In practice it's good enough for many purposes. It's actually the version of the database that ifconfig.co uses.
Caddyfile:
example.com {
respond "{remote_host}"
}
[0] https://caddyserver.com/docs/caddyfile/directives/respond[1] https://caddyserver.com/docs/caddyfile/concepts#placeholders
Between that and Mosh, I barely even notice when I change networks.
In EU? true Region England
We are so used to NAT that we don't realize how crazy it is that you essentially have to ask a stranger what's your address. It's really difficult to explain this to someone with no networking knowledge. Nothing else works this way: phone numbers, emails or postal addresses.
The only way this works securely with internet packets would be tor.
Their point is that you can always give your number to anyone and they can directly use it to contact you. It's never unclear what number to give someone so they can reach you. Yeah calls have to be routed, but routes are implicit, not something you have to worry about as src or dest.
$ dig +short @resolver1.opendns.com myip.opendns.com
But seriously, it's basically a front end to a bunch of people who have been incentivized (or fooled) into installing a proxy server on their home computers. It's primarily of interest as a way to make certain types of fraud (like ad fraud and credit card fraud) much harder to detect.
Say you're at home, you have a landline, and you don't know what your own phone number is. How do you get it? You call someone with caller ID, and ask them to tell you what number you called from.
Of course, I haven't had a land line in years and my cell phones tell me their numbers in the settings.
in case you just want to import a string. No headers either. (I'm lazy, so this is what I use to get an external IP for my robots)
Some anecdotes:
-At the moment the service has 10 GiB of traffic/day. In February, there were 295 476 879 requests.
-Because the service returns only the IP address and nothing else, the requests are larger than the replies.
-At some point a russian ISP began querying eth0.me from (apparently) all of their eyeball routers. Thousands of devices from their address space would query this service every second, which resulted in many Terabytes of traffic monthly. I decided to block their address space.
This service was run by somebody else up until a few years ago. It became more and more unreliable and went offline. At some point I noticed that the domain had expired. I decided to buy it and run it myself.
* You have login access to the router * Your router is directly exposed to the internet * You're not using a VPN
So it has ruined my second favorite wordpress security plugin - and MaxMind not really usable like it once was (?)
I work in IT (was a sysadmin for years, still administer my own servers) and I hated the configuration of the web servers (first Apache, then nginx) - mostly because I was too lazy to read the docs from beginning to end.
This changed with caddy. It is simple, fast, reliable, HTTPS first with LE. Great.
Now, all you get is a bunch of spammy sites that block you with a captcha then fill the page with ads.
Hopefully his thing rises to the top of the results.
I won't be advertising it here on HN any time soon, though, since it would probably fall over from the traffic. :)
> In EU?: true
How very 2019.
http://lumtest.com/myip http://lumtest.com/myip.json http://ip.oxylabs.io http://ip-api.com http://api.ipify.org http://ipinfo.io http://icanhazip.com http://ipaddressm.com https://api.myip.com http://httpbin.org/ip http://bot.whatismyipaddress.com https://ipapi.co/json http://ifconfig.io http://ifconfig.pro http://ipfinfo.fun http://checkip.amazonaws.com http://eth0.me http://ident.me http://ipaddress.sh http://ipfree.info https://iphorse.com/json http://myexternalip.com/json http://wgetip.com http://ip.jsontest.com http://thisip.com http://l2.io/ip https://wtfismyip.com/json http://ipecho.net/plain http://ipgrab.io http://whatismyip.akamai.com http://curlmyip.net http://myip.ipip.net http://checkip.dyndns.com http://ip.anysrc.net https://ip.seeip.org http://ipcalf.com
I guess you can count on the proxy networks, the big companies, and the aged ones. Otherwise take your pick based on what's memorable or short.