For ridiculously easy things like this, I think it's smarter for you to just host it yourself. This way you are not forcing other people to carry your burden. nginx config example: location /ip { add_header Content-Type "application/json"; return 200 '{"host":"$server_name","ip":"$remote_addr","port":"$remote_port","server_ip":"$server_addr","server_port":"$server_port "}\n'; } Which will return something like this i…
Icanhazip: A simple IP address tool survived a deluge of users (2021)
81–90 of 146 posts
Re: Icanhazip: A simple IP address tool survived a deluge of users (2021)
#82Earlier quoted context omitted.
Probably more efficient to use https://lib.rs/hyper - and actually maintainable.
I can't say a thing about efficiency, but for maintainability, I have to disagree. This seems to be a rust library, and for maintaining that, you'd need to write a program, compile it every time some updates come by, rerun the recompiled program, ... With the parent comment example, all you need is nginx, available as a package on all distros, and a single static config file. With an auto-updating package manager and…
Re: Icanhazip: A simple IP address tool survived a deluge of users (2021)
#83Earlier quoted context omitted.
Ok, I'll bite... What kind of machine do you host this on that can handle 400,000 of these requests (with TLS mind you) per second? That was the load he mentions it handling in 2021, he stopped mentioning requests per day metrics after that.
400,000 req/s is actually not crazy. Back in the single-core era I was doing 1/10th of that on a production server for similar workloads a compiled VB / COM+ app. I would wager Nginx can handle that pretty easily on a modern dual or quad-core system.
.. Ain't 65536 a capital B.
Edit: @toast0: valid point, thanks for the correction.
Re: Icanhazip: A simple IP address tool survived a deluge of users (2021)
#84For ridiculously easy things like this, I think it's smarter for you to just host it yourself. This way you are not forcing other people to carry your burden. nginx config example: location /ip { add_header Content-Type "application/json"; return 200 '{"host":"$server_name","ip":"$remote_addr","port":"$remote_port","server_ip":"$server_addr","server_port":"$server_port "}\n'; } Which will return something like this i…
My favorite: https://cloudflare.com/cdn-cgi/trace
I learned this from: https://news.ycombinator.com/item?id=36383258
Re: Icanhazip: A simple IP address tool survived a deluge of users (2021)
#85Earlier quoted context omitted.
I believe you're thinking of OpenDNS: dig -4 +short myip.opendns.com @resolver1.opendns.com
This only seems to work if your client can send requests directly to resolver1.opendns.com. It does not work if you have a server that is intercepting DNS or if you use the system configured DNS. The google version posted below is closer to what I was looking for: $ dig +short TXT o-o.myaddr.l.google.com @ns1.google.com "A.B.C.D" $ dig +short TXT o-o.myaddr.l.google.com "172.253.195.202" "edns0-client-subnet A.B.C.0/…
Akamai:
dig +short whoami.akamai.net @ns1-1.akamaitech.net
Google: dig +short o-o.myaddr.l.google.com txt @ns1.google.com
Cloudflare: dig +short whoami.cloudflare ch txt @1.1.1.1
OpenDNS: dig -4 +short myip.opendns.com @resolver1.opendns.com
Note that if you leave off the `@service.authoritative.nameserver` portion of all of the above, you get the IP address of the recursive resolver that your machine is configured to use. If you pass this to a service like https://ipinfo.io/, you can use this to figure out what company's DNS service is currently configured, be it your ISPs, or an internet company like Cloudflare/Google/Quad9.Arguably, that is the only valid reason to be using an IP address echoer via DNS, as if you truly wanted your own IP, you could fetch it far easier from a service like icanhazip.com.
Personally, Akamai's offering is by far the most useful and convenient--it's an A record, so you won't accidentally forget to add "txt" to your dig invocation, and has a very easy to remember name. Google's works too, though it requires remembering the strange domain name. Cloudflare tries to be cute and uses the Chaosnet DNS class, which while being an incredibly cool reference to internet history, unfortunately is not propagated by most public recursive resolvers. And like the parent comment mentions, OpenDNS somehow blocks requests that pass through a recursive resolver.
Re: Icanhazip: A simple IP address tool survived a deluge of users (2021)
#86Not related to the story of scaling the tech but rather to the IP business in 2023: I’m not affiliated with any of these services, but my goto has been ip4.me, ip6.me, and ip6only.me because they’re short and memorable and because they acknowledge the IPv4/IPv6 split. The first two domains give you your v4 and v6 IP respectively and the latter only resolves over IPv6 (useful to ensure your IPv6 is off when using a VP…
Even though nobody asked, I have to mention this every time there is a discussion about IPv6 and IP address data. According to domain name records, even if a site supports both IPv4 and IPv6 it defaults to IPv6. I would love to know why.
I have come across a lot of people saying IPinfo doesn't support IPv6. The internet as an ecosystem doesn't completely support IPv6, but we do. So, mentioning it constantly in every discussion is my current approach.
Re: Icanhazip: A simple IP address tool survived a deluge of users (2021)
#87Earlier quoted context omitted.
This only seems to work if your client can send requests directly to resolver1.opendns.com. It does not work if you have a server that is intercepting DNS or if you use the system configured DNS. The google version posted below is closer to what I was looking for: $ dig +short TXT o-o.myaddr.l.google.com @ns1.google.com "A.B.C.D" $ dig +short TXT o-o.myaddr.l.google.com "172.253.195.202" "edns0-client-subnet A.B.C.0/…
There's a whole list of such resolvers: Akamai: dig +short whoami.akamai.net @ns1-1.akamaitech.net Google: dig +short o-o.myaddr.l.google.com txt @ns1.google.com Cloudflare: dig +short whoami.cloudflare ch txt @1.1.1.1 OpenDNS: dig -4 +short myip.opendns.com @resolver1.opendns.com Note that if you leave off the `@service.authoritative.nameserver` portion of all of the above, you get the IP address of the recursive re…
Re: Icanhazip: A simple IP address tool survived a deluge of users (2021)
#88When I’m configuring flask on a random AWS server, `curl icanhazip.com` makes it easier and adds a little light to a boring task
AWS has an endpoint for this: http://checkip.amazonaws.com
Re: Icanhazip: A simple IP address tool survived a deluge of users (2021)
#89Earlier quoted context omitted.
400,000 req/s is actually not crazy. Back in the single-core era I was doing 1/10th of that on a production server for similar workloads a compiled VB / COM+ app. I would wager Nginx can handle that pretty easily on a modern dual or quad-core system.
The thing is, at that rate, you'll likely run out of ports without more advanced / exotic TCP configurations. .. Ain't 65536 a capital B. Edit: @toast0: valid point, thanks for the correction.
Chances are you'll never run into that limit for this service, because even if there's a ton of users behind the same IP due to NAT, they don't need to hold long sessions, and you can disable http keep-alive and close connections right away. Chances are you'll have some ip diversity in 400k requests/second though.
Re: Icanhazip: A simple IP address tool survived a deluge of users (2021)
#90Not related to the story of scaling the tech but rather to the IP business in 2023: I’m not affiliated with any of these services, but my goto has been ip4.me, ip6.me, and ip6only.me because they’re short and memorable and because they acknowledge the IPv4/IPv6 split. The first two domains give you your v4 and v6 IP respectively and the latter only resolves over IPv6 (useful to ensure your IPv6 is off when using a VP…
ipinfo.io's API and site is dualstack. But for IPv6 connection, you need to use v6.ipinfo.io for the API service. Even though nobody asked, I have to mention this every time there is a discussion about IPv6 and IP address data. According to domain name records, even if a site supports both IPv4 and IPv6 it defaults to IPv6. I would love to know why. I have come across a lot of people saying IPinfo doesn't support IPv…
Newer is better? Good clients use the 'happy eyeballs' (rfc 8305) mechanism, which is roughly, open v6, wait a bit, open v4, use whichever connection comes back first. There's a bias towards v6 because often it's a more direct connection, and may work better, but it was also common to have non working AAAA records, so a delayed fallback is preferable to no fallback as used to be common.