News for hackers. Stuff that matters.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by LeoPanthera on Monday July 31, 2023 @05:04PM (#36948801)
tl;dr: Bought by Cloudflare.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by cryne on Monday July 31, 2023 @05:12PM (#36948904)
...for a symbolic price because "the fun totally dried up" for the author and he felt the site would be in good hands at Cloudflare.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by alpb on Monday July 31, 2023 @05:13PM (#36948913)
> Their sponsorship of icanhazip.com has saved me tens of thousands of dollars per month.

Can someone please explain how does returning a few hundred bytes of plaintext response can cost thousands of dollars? Either I'm really bad at estimating things or there's some hidden cost somewhere I'm not seeing.

Also why could it not work fine behind a Cloudflare free tier?

Re:Icanhazip: A simple IP address tool survived a deluge of ... by karamanolev on Monday July 31, 2023 @05:17PM (#36948967)
> In 2021, the traffic I once received in a month started arriving in 24 hours. The site went from a billion requests per day to 30-35 billion requests per day over a weekend.

30 billion times 350 bytes (size of my response) is equal to 10.5 terabytes (base-10) a day. 84 terabits per day, 84000/3600/24 ~= 1 gigabit if my math is right. A fully saturated 1 gigabit pipe of worldwide internet costs a lot. So, there.

Re:Icanhazip: A simple IP address tool survived a deluge of ... by alpb on Monday July 31, 2023 @05:30PM (#36949139)
Really interesting. I never heard of this website and was surprised to hear this volume of traffic it's getting. (I always used curlmyip.org or whatsmyip.net|.com). I wonder what is the rationale for providing a non-rate limited service that can be easily abused like this. The volume almost suggests some stuff like IoT devices or other software use this to test internet connectivity. Or botnets?
Re:Icanhazip: A simple IP address tool survived a deluge of ... by thefifthsetpin on Monday July 31, 2023 @05:56PM (#36949440)
I believe that creating a traffic rate-limiting system, which is more cost-effective than simply echoing back the requestor's IP address, is likely to be a complex task. However, I haven't personally performed the calculations to confirm this.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by vlan0 on Monday July 31, 2023 @08:01PM (#36950588)
>Seeing that over 90% of my traffic load was malicious and abusive was frustrating. Dealing with the abuse emails and complaints was worse.

My take. I suspect Cloudflare benefited allowing that traffic. It's another data point/tool in their toolbox against the baddies.

Re:Icanhazip: A simple IP address tool survived a deluge of ... by mhayden on Tuesday August 01, 2023 @08:58AM (#36955380)
That was something I discussed with them and I certainly hope they're doing it now. ;)
Re:Icanhazip: A simple IP address tool survived a deluge of ... by akho on Monday July 31, 2023 @05:25PM (#36949076)
What does the site do that’s needed by 35 billion requests a day? doesn’t it just return n external IP?
Re:Icanhazip: A simple IP address tool survived a deluge of ... by deadbunny on Monday July 31, 2023 @05:27PM (#36949098)
Go read TFA?
Re:Icanhazip: A simple IP address tool survived a deluge of ... by Zetice on Monday July 31, 2023 @06:45PM (#36949886)
At $0.085 per GB (some us-east-1 exfil cost Google gave me), 10TB is... ~$1k/day?

Yeah sorry, I would not pay $30k/mo so y'all could track your external IP addresses...

Re:Icanhazip: A simple IP address tool survived a deluge of ... by TechBro8615 on Monday July 31, 2023 @07:10PM (#36950140)
OP said a fully saturated gigabit link, which generally means you pay for transit ("size of the pipe") rather than "stuff pushed through it." I haven't been in the market for a long time, but 5-10 years ago the price was on the order of $0.50 per mbps, so $500 for a 1000 gbps ("gigabit") link. Usually you buy this with a dedicated server or colocation. You wouldn't want to host this in the cloud because they price gouge you on bandwidth by charging for stuff through the pipe.

And that's if you truly expect to saturate it. If you just want to take the risk and go for oversold fiber, you can pay some nominal price for "unmetered bandwidth" (with the caveat that if you're saturating the pipe, your host will probably make you pay for it eventually).

Re:Icanhazip: A simple IP address tool survived a deluge of ... by Fornax96 on Monday July 31, 2023 @07:10PM (#36950141)
That's ridiculous bandwidth pricing. you can get unmetered gigabit at Hetzner for €20 per month. Need 2 Gb? Order a second server.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by Zetice on Monday July 31, 2023 @07:48PM (#36950495)
Do you think this is an important point?
Re:Icanhazip: A simple IP address tool survived a deluge of ... by lkbm on Monday July 31, 2023 @08:15PM (#36950684)
He was using Hetzner and says it was costing him $200/month. He then had to spin up a second server, presumably increasing the cost, and it was still struggling.

From there traffic doubled, and he moved to Cloudflare Workers. And then traffic 30xed.

I suspect it's more about request count (>300k per second) than raw number of bits.

Re:Icanhazip: A simple IP address tool survived a deluge of ... by bunga-bunga on Monday July 31, 2023 @05:19PM (#36948989)
It mentions 2 petabytes of data per month, plus compute for a trillion requests per month. It sounds like all kinds of optimizations were made so probably it can’t be much cheaper. My guess is that the “tens of thousands” is calculated on CF Workers prices though.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by veave on Monday July 31, 2023 @06:04PM (#36949512)
>Also why could it not work fine behind a Cloudflare free tier?

Eh, how would that even work? You have to serve the requests anyway.

Re:Icanhazip: A simple IP address tool survived a deluge of ... by ChrisClark on Monday July 31, 2023 @06:23PM (#36949694)
For $8.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by metadat on Monday July 31, 2023 @05:15PM (#36948933)
Related prior submission at the time:

A New Future for Icanhazip

https://news.ycombinator.com/item?id=27415537 (2 years ago, 253 comments)

Re:Icanhazip: A simple IP address tool survived a deluge of ... by sunshinekitty on Monday July 31, 2023 @05:22PM (#36949029)
A great tool I’ve used countless times after learning about it while working at Rackspace a decade ago . It was great to learn about how it’s grown over the years, what an ordeal!

Cloudflare is at the top of the list of custodians I would want if in a similar position, glad it’s found a new steward.

Re:Icanhazip: A simple IP address tool survived a deluge of ... by politelemon on Monday July 31, 2023 @05:35PM (#36949203)
That's a great read, the author had a passion project and stuck by it. I'd love to read more of these
Re:Icanhazip: A simple IP address tool survived a deluge of ... by ComputerGuru on Monday July 31, 2023 @05:37PM (#36949227)
Not 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 VPN). You can tack on /api to any of them to get a plaintext response.

Re:Icanhazip: A simple IP address tool survived a deluge of ... by 0x6A75616E on Monday July 31, 2023 @05:45PM (#36949290)
the issue is that these return a bunch of html so using them from the command line is not ideal.

I made wgetip.com back in 2008 to solve this. icanhaz must've been pretty suboptimal back then to have issues with traffic. wgetip still gets about 3M requests per hour. All from a single $5 droplet.

Re:Icanhazip: A simple IP address tool survived a deluge of ... by zokier on Monday July 31, 2023 @05:47PM (#36949317)
ip4.me and ip6.me have /api endpoint for programmatic access
Re:Icanhazip: A simple IP address tool survived a deluge of ... by SadTrombone on Monday July 31, 2023 @06:28PM (#36949742)
The /api endpoint seems to return me a 301 error from the command line.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by ComputerGuru on Monday July 31, 2023 @06:35PM (#36949796)
That’s a redirect, not an error. Probably to /api/ with a trailing slash. Or use the -l flag to curl to have it auto redirect.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by jffry on Monday July 31, 2023 @06:32PM (#36949772)

  curl https://ip4.me/api/
works for me
Re:Icanhazip: A simple IP address tool survived a deluge of ... by pepa65 on Tuesday August 01, 2023 @04:52AM (#36953870)
There, /ip is better.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by pepa65 on Tuesday August 01, 2023 @04:48AM (#36953841)
Best thing to try first is to append /ip I've found.

For wgetip.com that is not needed of course. But I haven't found a way to get the IPv4 address there...

Re:Icanhazip: A simple IP address tool survived a deluge of ... by NelsonMinar on Monday July 31, 2023 @05:48PM (#36949330)
https://www.ipify.org/ is my go to, mostly because it has a really simple JSON version. Funny how many ways there are to do this simple thing.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by pepa65 on Tuesday August 01, 2023 @04:23AM (#36953683)
https://api.ipify.org/ works to just get text IP.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by pests on Monday July 31, 2023 @06:12PM (#36949596)
Does Chrome not recognize the .me TLD? I just tried to type that ip4.me domain twice and it just sent me to search results.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by kiwijamo on Monday July 31, 2023 @08:09PM (#36950650)
Edge works just fine which is interesting.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by owenmarshall on Monday July 31, 2023 @08:36PM (#36950852)
I think that would be very surprising to the fine people of Montenegro.

Check your local DNS configuration, something is likely hijacking NXDOMAINs.

Re:Icanhazip: A simple IP address tool survived a deluge of ... by bla3 on Monday July 31, 2023 @08:45PM (#36950911)
Works for me (heh).
Re:Icanhazip: A simple IP address tool survived a deluge of ... by paradox460 on Monday July 31, 2023 @07:27PM (#36950292)
I like ifconfig.me because it returns the IP along with some other little bits of useful information, and works great with curl
Re:Icanhazip: A simple IP address tool survived a deluge of ... by erinnh on Monday July 31, 2023 @07:46PM (#36950479)
Icanhazip.com will do the same.

They have ipv4.icannazip.com and ipv6.icannazip.com where they will return that.

Re:Icanhazip: A simple IP address tool survived a deluge of ... by sitzkrieg on Monday July 31, 2023 @08:07PM (#36950641)
so 3, 2 less memorable sites, ok got it
Re:Icanhazip: A simple IP address tool survived a deluge of ... by erinnh on Monday July 31, 2023 @08:39PM (#36950872)
I’d say that is up you. I can never remember what tld those other sites used. I’ve been using icanhazip since many years. I seem to remember it fine.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by pepa65 on Tuesday August 01, 2023 @04:45AM (#36953817)
Replace the double nn in your post by nh and it will work better ;-)
Re:Icanhazip: A simple IP address tool survived a deluge of ... by erinnh on Wednesday August 02, 2023 @02:40PM (#36975089)
Thanks. Phone keyboards are hard sometimes.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by reincoder on Monday July 31, 2023 @09:36PM (#36951259)
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 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 ... by toast0 on Monday July 31, 2023 @10:25PM (#36951610)
> According to domain name records, even if a site supports both IPv4 and IPv6 it defaults to IPv6. I would love to know why.

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.

Re:Icanhazip: A simple IP address tool survived a deluge of ... by Caligatio on Monday July 31, 2023 @11:03PM (#36951819)
Don't forget about the new still-draft-but-already-used HTTPS DNS record type (no, that's not a typo)! I'm still fuzzy on its IP hint value(s) but it can potentially bypass A and AAAA records completely.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by hayyyyydos on Monday July 31, 2023 @11:54PM (#36952084)
When helping someone over the phone, I get them to go to http://ipchicken.com

Very easy URL to relay, "do you see the chicken? let me know what the blue numbers are below it" - and most people seem to get a kick out of it!

Re:Icanhazip: A simple IP address tool survived a deluge of ... by dgl on Tuesday August 01, 2023 @12:35AM (#36952348)
A long time ago I spent a bit too long debugging something to later find out the "source port" that displays isn't right! It's still not right! I obviously fixed this by making my own site (https://ip.wtf).
Re:Icanhazip: A simple IP address tool survived a deluge of ... by pepa65 on Tuesday August 01, 2023 @04:21AM (#36953667)
Great service! Very informative. If you could also implement ip.wtf/ip or some such, it might decrease your bandwidth..!
Re:Icanhazip: A simple IP address tool survived a deluge of ... by dgl on Tuesday August 01, 2023 @05:46AM (#36954171)
Thanks!

No need for a /ip, just doing:

$ curl ip.wtf

... will do the right thing, or if your user-agent isn't curl send a header of "Accept: text/plain" and you'll get the plain text version (see https://ip.wtf/about for more).

Re:Icanhazip: A simple IP address tool survived a deluge of ... by ComputerGuru on Sunday August 06, 2023 @03:15AM (#37019656)
And no need for an IPv4 or IPv6 mode url/param since curl -4 or curl -6 will do the trick!
Re:Icanhazip: A simple IP address tool survived a deluge of ... by pepa65 on Tuesday August 01, 2023 @04:17AM (#36953653)
Gives a CloudFlare 520 error for me...
Re:Icanhazip: A simple IP address tool survived a deluge of ... by pepa65 on Tuesday August 01, 2023 @04:09AM (#36953605)
And if you attach /ip you get only the IP address (as /api also includes the URL of the documentation).
Re:Icanhazip: A simple IP address tool survived a deluge of ... by ChrisArchitect on Monday July 31, 2023 @05:49PM (#36949339)
This is a re-blog; Original post: https://news.ycombinator.com/item?id=27415537
Re:Icanhazip: A simple IP address tool survived a deluge of ... by ddrager on Monday July 31, 2023 @05:51PM (#36949362)
Wow, I didn't realize the little article I wrote for Lifehacker would have such a big impact on this project. Also didn't realize he had passed on the project to Cloudflare. They're a great team so I'm happy it's in their capable hands now!
Re:Icanhazip: A simple IP address tool survived a deluge of ... by renewiltord on Monday July 31, 2023 @06:00PM (#36949481)
It's funny that there are so many of these. I use

    curl ifconfig.me
Re:Icanhazip: A simple IP address tool survived a deluge of ... by jamesponddotco on Monday July 31, 2023 @06:16PM (#36949629)
It's a fun project if you want to learn to code, which is why I think there're so many of them around. I built and run Accio127[1][2] for the same reason.

[1] https://api.accio127.com/v1/ip/

[2] https://git.sr.ht/~jamesponddotco/accio127

Re:Icanhazip: A simple IP address tool survived a deluge of ... by tetrep on Monday July 31, 2023 @07:17PM (#36950199)
Indeed, it's like "hello, world!" but actually useful :)
Re:Icanhazip: A simple IP address tool survived a deluge of ... by brandonp0 on Monday July 31, 2023 @06:06PM (#36949536)
I made a site like this to mess with a guy at work. Everyone knew of IPChicken, and his last name is Herring, so I created IPHerring. I'd put Photoshopped images of him on the site for different holidays and coworkers always thought it was hilarious. They would even send me ideas of what to put next.

Now I sometimes use AI image generation tools to really make it stand out. It's been a lot of fun. A lot of the tech folks in my area are using it now.

Re:Icanhazip: A simple IP address tool survived a deluge of ... by prmoustache on Tuesday August 01, 2023 @10:16AM (#36956220)
So you are proud of being a toxic coworker?
Re:Icanhazip: A simple IP address tool survived a deluge of ... by matrix12 on Monday July 31, 2023 @06:26PM (#36949721)
Jsonip.com was great, even included fortunes for the day. https://web.archive.org/web/20170328001726/https://jsonip.co...
Re:Icanhazip: A simple IP address tool survived a deluge of ... by Snawoot on Monday July 31, 2023 @06:32PM (#36949771)
Why not use protocols which are specifically designed to report mapped IP address like STUN? It's faster as UDP exchange is shorter than 3-way TCP handshake (or even TCP+TLS handshake).

Here is an implementation which uses parallel STUN queries to report address reliably as fast as possible: https://github.com/Snawoot/myip

Re:Icanhazip: A simple IP address tool survived a deluge of ... by msm_ on Monday July 31, 2023 @06:53PM (#36949960)
Nice tool! Looks like a great solution.

But unfortunately I don't have it in a random docker/kubernetes containers or random internal servers, and these are the contexts where I personally usually want to check my external IP. They usually have curl though.

Re:Icanhazip: A simple IP address tool survived a deluge of ... by seabass-labrax on Monday July 31, 2023 @07:26PM (#36950284)
Maybe curl ought to support STUN (if it doesn't already). It's becoming a very common technology now that NAT is so prevalent.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by diath on Monday July 31, 2023 @07:13PM (#36950159)
Because one requires you to merely type a simple URL in your browser that you already likely have open, the other requires you to install Go, clone a git repo, compile the program, install the program, and THEN finally run the program.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by justsomehnguy on Monday July 31, 2023 @08:22PM (#36950742)
... only to be blocked by the corporate firewall which doesn't allow anything besides tcp/80 and tcp/443.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by tchbnl on Monday July 31, 2023 @11:02PM (#36951814)
This is very cool and something that'd be neat to roll into a toolset. But I think you're missing the point of izanhazip. It's meant to be quick and easily accessible regardless of where you are or what system you're on (assuming there's curl or similar installed).

I might not have permission or it wouldn't be reasonable to install something. And I can link it to customers or give them a simple command to run, and all it returns is the actual info I need from them.

Re:Icanhazip: A simple IP address tool survived a deluge of ... by zie on Monday July 31, 2023 @06:33PM (#36949781)
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 in JSON format:

    {"host":"www.example.org","ip":"199.200.200.14","port":"7990","server_ip":"199.200.100.229","server_port":"443"}
This is all done 100% within NGINX, and I include a lot of stuff you probably don't want or care about. Other web servers probably have similar capabilities.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by nurettin on Monday July 31, 2023 @06:52PM (#36949958)
I have something very similar, and all my projects depend on that. I also made a copy of httpbin which I host on a server. Useful for unit testing. And a gateway for hookback urls that I use for relaying/logging oauth and similar things to internal vpns. All very useful gadgets that have been running for over half a decade on arch.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by turtlebits on Monday July 31, 2023 @07:13PM (#36950160)
If it's on the public internet, you're not forcing anyone to provide you a service. Standing up reliable infra isn't easy nor free, no matter how trivial deploying it may be.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by iknowstuff on Monday July 31, 2023 @07:14PM (#36950170)
Probably more efficient to use https://lib.rs/hyper - and actually maintainable.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by jesprenj on Monday July 31, 2023 @08:45PM (#36950919)
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 a service manager, one never needs to write anything else apart from that static config file.

Or did you mean something else with "actually maintainable"?

Re:Icanhazip: A simple IP address tool survived a deluge of ... by lmm on Monday July 31, 2023 @09:27PM (#36951204)
I would trust the rust compile/rerun process a lot more than an auto-updating linux distribution, personally. Sooner or later that auto-updating package manager will break your config file, itself, or both.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by noirscape on Tuesday August 01, 2023 @03:27AM (#36953349)
The majority of nginx distributions will not get any major bumps during the lifetime of the distros they're in. Whether that's because the distro itself has policies against that (Debian, Ubuntu) or because the distro version expires before nginx' stable release does (most of the ones with a higher update frequency, ie. Fedora) so by the time the version expires, they can just go to the next stable version on the release after. This is pretty much only a risk if your distro is completely rolling release and even those in my experience at least offer an "lts" package of some sort.

So that's not a problem. Besides the majority of nginx setups don't rely on too fancy things; most of the stuff that gets changed in updates that affect config files are the fancier nginx modules.

Re:Icanhazip: A simple IP address tool survived a deluge of ... by lmm on Tuesday August 01, 2023 @08:56PM (#36965535)
> The majority of nginx distributions will not get any major bumps during the lifetime of the distros they're in. Whether that's because the distro itself has policies against that (Debian, Ubuntu) or because the distro version expires before nginx' stable release does (most of the ones with a higher update frequency, ie. Fedora) so by the time the version expires, they can just go to the next stable version on the release after.

If you're following that approach then having auto updates enabled is kind of irrelevant/meaningless; at some point you're going to be running a very old (and unsupported) version of your distro with all that that implies.

Re:Icanhazip: A simple IP address tool survived a deluge of ... by jesprenj on Tuesday August 01, 2023 @04:01PM (#36961835)
That is true, yeah. But the library in question will also eventually break the existing API / stop supporting compatible releases with security patches. I assume this nginx config will still work for many releases in the future.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by lmm on Tuesday August 01, 2023 @08:55PM (#36965519)
> But the library in question will also eventually break the existing API / stop supporting compatible releases with security patches.

Maybe. I have more faith in a Rust library to maintain API backward compatibility than a Linux distro, is what I'm saying.

Re:Icanhazip: A simple IP address tool survived a deluge of ... by Titan2189 on Monday July 31, 2023 @07:27PM (#36950295)
This will return the wrong results when used behind a load balancer
Re:Icanhazip: A simple IP address tool survived a deluge of ... by justsomehnguy on Monday July 31, 2023 @08:05PM (#36950629)
Anything would return proxy/LB address. So do not use it behind LB/proxy/NAT.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by xereeto on Tuesday August 01, 2023 @04:19AM (#36953660)
Not if you use the PROXY protocol
Re:Icanhazip: A simple IP address tool survived a deluge of ... by linsomniac on Monday July 31, 2023 @08:35PM (#36950840)
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.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by BeefWellington on Monday July 31, 2023 @08:58PM (#36951006)
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.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by metadat on Monday July 31, 2023 @09:29PM (#36951213)
The thing is, at that rate, you'll likely run out of ports without more advanced / exotic TCP configurations.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by toast0 on Monday July 31, 2023 @10:16PM (#36951546)
Tcp connections are a 4-tuple {PeerAIP, PeerBIP, PeerAPort, PeerBPort}, if you hold your IP and port fixed, because you only listen on port 443, you can do 64k connections to each other peer's IP... if the other peer can manage to use them all.

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 ... by hamandcheese on Monday July 31, 2023 @09:09PM (#36951079)
I think you are misunderstanding... the point of self hosting is that you only need to handle your own load. It only needs to scale to what, 1 request per day?
Re:Icanhazip: A simple IP address tool survived a deluge of ... by noirscape on Tuesday August 01, 2023 @03:20AM (#36953310)
Wasn't the original target of nginx back in the nineties to hit 100k requests per second with less overhead than (at the time, standard) apache2?

With that in mind + the general advancing of hw since then, it wouldn't be too suprising if nginx could handle that load easily. It'd just get more difficult if you wanted to put anything else (ie. metrics) on that endpoint since afaict nginx doesn't have anything to monitor those things if you don't have the Enterprise version of their tools.

In any case you might be misreading the setup for the parent here - the recommendation is just that if you're doing this in the context of a webapp, that this sort of behavior is trivially easy to bounce back in JSON using nginx.

Re:Icanhazip: A simple IP address tool survived a deluge of ... by zie on Tuesday August 01, 2023 @09:53AM (#36955972)
No, the point is, you host it for your own needs, so you are not using their service. Your implementation is for YOUR needs. You can make it public or not and advertise it or not at your discretion. What we do is make it public, but don't advertise it at all. Our software just uses it when needed.

If your use case calls for 400k/reqs a second on what your IP is and you haven't yet figured out how to build out your infrastructure(or pay someone to do it for you), you have bigger problems than figuring our what your public IP is.

Re:Icanhazip: A simple IP address tool survived a deluge of ... by francislavoie on Monday July 31, 2023 @08:59PM (#36951016)
Alternatively, with Caddy (with automated TLS, single static binary):

    example.com {
        handle /ip {
            header Content-Type application/json
            respond `{"host":"{host}","ip":"{remote_host}","port":"{remote_port}"}`
        }
    }
Though the usefulness of the host (client specified it), remote port (it's random), and server ip/port (it's static and not useful for the client) are questionable.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by quickthrower2 on Tuesday August 01, 2023 @12:22AM (#36952269)
Useful for UA sanity checking I guess
Re:Icanhazip: A simple IP address tool survived a deluge of ... by anon7331 on Monday July 31, 2023 @09:18PM (#36951138)
Alternatively, search the web for everyone implementing "/ip" and random load balance between all of them and let them handle the load for you.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by gaudat on Monday July 31, 2023 @09:22PM (#36951169)
Re:Icanhazip: A simple IP address tool survived a deluge of ... by matthberg on Monday July 31, 2023 @09:29PM (#36951217)
/cdn-cgi/trace isn't available on just cloudflare.com, it's on every site they proxy too (there might be a setting somewhere to disable it yet it's on by default). I've yet to figure out what happens if your site also serves something there, yet it was surprising to see on a barebones site I had routed through them.

I learned this from: https://news.ycombinator.com/item?id=36383258

Re:Icanhazip: A simple IP address tool survived a deluge of ... by e28eta on Monday July 31, 2023 @11:21PM (#36951924)
TIL. Looks like they have it documented (since Apr 2022, based on the github history), it cannot be modified or customized, and that it sometimes causes problems with SEO crawlers!

https://developers.cloudflare.com/fundamentals/get-started/r...

Re:Icanhazip: A simple IP address tool survived a deluge of ... by 1vuio0pswjnm7 on Tuesday August 01, 2023 @12:01AM (#36952123)

   sni=plaintext
There was a great trial CF ran for a long period with a previous version of encrypted SNI (now ECH). One could get encrypted SNI with any site using CF via modified OpenSSL. But they stopped this experiment. Meanwhile ECH was still not ready.

If anyone is getting something other than "sni=plaintext" for a CF domain besides crypto.cloudflare.com, then please let us know how.

Re:Icanhazip: A simple IP address tool survived a deluge of ... by progbits on Tuesday August 01, 2023 @06:54AM (#36954528)
Isn't ECH still off by default in most browsers? The latest info I could find has it implemented but opt-in behind experimental flag in both Firefox and Chrome, and not supported at all in Safari.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by 1vuio0pswjnm7 on Tuesday August 01, 2023 @03:46PM (#36961613)
And only enabled by CF in certain regions. Not sure.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by zie on Tuesday August 01, 2023 @09:54AM (#36955986)
That's neat, but that's the opposite of what I'm suggesting. I'm saying if you are hosting web content anyway, then just host a /ip endpoint that returns the IP address. That way you aren't forcing other people to carry your load.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by 1vuio0pswjnm7 on Tuesday August 01, 2023 @12:18AM (#36952242)
Another one

https://whatismyip.akamai.com/advanced?debug

DNS-based

   drill whoami.akamai.net 
The second one might be useful to verify one is not using local, ISP-provided DNS, or to see whether a DoH provider effectively geolocates its users, e.g., Cloudflare.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by sublinear on Tuesday August 01, 2023 @12:37AM (#36952362)
Bad cert. The common name does not match the subdomain.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by 1vuio0pswjnm7 on Tuesday August 01, 2023 @02:22AM (#36952954)
Certificate says CN is a248.e.akamai.net

CNAME for whatismyip.akamai.com is a1524.g.akamai.net

Probably no certitifcate that lists whatismyip.akamai.com

Re:Icanhazip: A simple IP address tool survived a deluge of ... by mr-karan on Tuesday August 01, 2023 @04:56AM (#36953889)
Another DNS based one:

  dig ip @dns.toys +short
Re:Icanhazip: A simple IP address tool survived a deluge of ... by 1vuio0pswjnm7 on Saturday August 05, 2023 @12:11AM (#37008947)
Another one

Send a request to stackexchange.com or any of its subdomains without a user-agent header.

Re:Icanhazip: A simple IP address tool survived a deluge of ... by acidburnNSA on Tuesday August 01, 2023 @01:04AM (#36952526)
Now I just need the apache config for this...anyone?
Re:Icanhazip: A simple IP address tool survived a deluge of ... by paravz on Wednesday August 02, 2023 @01:21AM (#36967224)
great callout! A more advanced self hosted option can be https://github.com/mpolden/echoip
Re:Icanhazip: A simple IP address tool survived a deluge of ... by blibble on Monday July 31, 2023 @06:47PM (#36949906)
if some AS is taking the piss: start returning random addresses just for them?

they'd soon learn

Re:Icanhazip: A simple IP address tool survived a deluge of ... by yardstick on Monday July 31, 2023 @08:21PM (#36950731)
Yeah I’m surprised this wasn’t attempted
Re:Icanhazip: A simple IP address tool survived a deluge of ... by cferry on Monday July 31, 2023 @07:02PM (#36950059)
Not having to ask the public facing IP address of some NAT-performing router is one of the good sides of IPv6. I'm wondering what uses there are of such a service, besides dynamic DNS updates, that would need automated queries and result in such an overwhelming amount of traffic...
Re:Icanhazip: A simple IP address tool survived a deluge of ... by dfc on Monday July 31, 2023 @07:25PM (#36950264)
Slightly related: There used to be a DNS server that you could query a TXT record and the response would include the IP of the server that submitted the query. You could use it to debug DNS issues. I thought it was from DNS-OARC but I can't find it anywhere. Does anyone know a way to accomplish this?
Re:Icanhazip: A simple IP address tool survived a deluge of ... by erinnh on Monday July 31, 2023 @07:40PM (#36950421)
I don’t know of a server that does exactly what you wrote, but I generally troubleshoot dns issues with a few dig commands. dig without any parameters will resolve via your normal dns server and display the servers ip.

With @(dns server ip here) you can query a different dns server to check what their answer is.

With +trace you can go through the complete dns chain from the root servers on to check for issues in the chain.

Sorry if this doesn’t help you or you knew this already.

Re:Icanhazip: A simple IP address tool survived a deluge of ... by gavinsyancey on Monday July 31, 2023 @07:44PM (#36950461)
dig +short TXT o-o.myaddr.l.google.com @ns1.google.com
Re:Icanhazip: A simple IP address tool survived a deluge of ... by p1mrx on Monday July 31, 2023 @07:57PM (#36950571)
This is what it looks like when a debug interface escapes captivity.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by dfc on Monday July 31, 2023 @09:21PM (#36951158)
This works! Thank you very much.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by thenickdude on Monday July 31, 2023 @07:52PM (#36950521)
I believe you're thinking of OpenDNS:

dig -4 +short myip.opendns.com @resolver1.opendns.com

Re:Icanhazip: A simple IP address tool survived a deluge of ... by jtokoph on Monday July 31, 2023 @08:52PM (#36950974)
And the v6 version: dig -6 +short myip.opendns.com @resolver1.opendns.com aaaa
Re:Icanhazip: A simple IP address tool survived a deluge of ... by dfc on Monday July 31, 2023 @09:20PM (#36951155)
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/24"
    $ dig +short TXT o-o.myaddr.l.google.com @9.9.9.9
    "162.244.55.23"
    $ dig +short TXT o-o.myaddr.l.google.com @1.1.1.1
    "172.71.221.175"
The opendns implementation returns nothing if you try something similar to the last three.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by arjvik on Monday July 31, 2023 @09:32PM (#36951240)
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 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 ... by dfc on Monday July 31, 2023 @09:38PM (#36951278)
The opendns server does not return anything if I send the query to anything other than opendns.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by arjvik on Monday July 31, 2023 @10:41PM (#36951703)
Admittedly my comment was incredibly long, but I did include

> 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 ... by pepa65 on Tuesday August 01, 2023 @05:19AM (#36954040)
Cudos: Akamai also doesn't put the returned IP address in quotes, unlike Google and Cloudflare.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by arjvik on Tuesday August 01, 2023 @12:10PM (#36957984)
By virtue of being an A record (native IP address) rather than a TXT record (string)
Re:Icanhazip: A simple IP address tool survived a deluge of ... by p1mrx on Monday July 31, 2023 @07:56PM (#36950556)
"https://myresolver.info/" was good while it lasted. It used stupid DNS tricks to show your resolver in the browser:

https://web.archive.org/web/20131126131155/https://ndkyez8kh...

Re:Icanhazip: A simple IP address tool survived a deluge of ... by mgbmtl on Monday July 31, 2023 @08:40PM (#36950885)
You could write a program that listens on port 53, parses the query and returns the correct value?

DNS is hard to implement, but for responding to a very specific type of query, should be easy?

Re:Icanhazip: A simple IP address tool survived a deluge of ... by theblazehen on Tuesday August 01, 2023 @03:28AM (#36953355)
In addition to the others, there is also https://www.dns.toys/
Re:Icanhazip: A simple IP address tool survived a deluge of ... by yardstick on Monday July 31, 2023 @08:20PM (#36950726)
I used to use ipchicken and some others, but now I just type “what is my ip” into google and get it that way. Not suitable for automation but in my case it’s just a quick manual check.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by blahyawnblah on Monday July 31, 2023 @08:21PM (#36950741)
curl ipinfo.io or ipinfo.io/ip
Re:Icanhazip: A simple IP address tool survived a deluge of ... by kayodelycaon on Monday July 31, 2023 @08:28PM (#36950787)
Ah Major Hayden. Great guy. I remember getting a crash course on system administration in Slicehost’s IRC channel because some idiot ran an ancient Java application server on an open port. We got hacked and I got volun-told to clean up the mess because I was the only person running Linux on my laptop.

Everyone was so nice and I learned so much. I owe them all a lot of drinks. :)

Re:Icanhazip: A simple IP address tool survived a deluge of ... by mhayden on Tuesday August 01, 2023 @08:57AM (#36955369)
Glad I could help. Hope you're doing well. I miss those Slicehost days.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by jesprenj on Monday July 31, 2023 @08:51PM (#36950962)
Quite useful that it returns a newline after the IP address.

My similar setup with nginx (http://4a.si/ip) only returns $remote_addr without the newline, making it ugly for using with `curl`.

Re:Icanhazip: A simple IP address tool survived a deluge of ... by stuartd on Monday July 31, 2023 @09:11PM (#36951090)
When I’m configuring flask on a random AWS server, `curl icanhazip.com` makes it easier and adds a little light to a boring task
Re:Icanhazip: A simple IP address tool survived a deluge of ... by RKearney on Monday July 31, 2023 @09:13PM (#36951105)
AWS has an endpoint for this: http://checkip.amazonaws.com
Re:Icanhazip: A simple IP address tool survived a deluge of ... by arjvik on Monday July 31, 2023 @09:51PM (#36951370)
Saves a few milliseconds of transit at the expense of a few seconds of chuckling... not worth it :)
Re:Icanhazip: A simple IP address tool survived a deluge of ... by jokoon on Monday July 31, 2023 @10:48PM (#36951739)
Those numbers are astronomical

So he did not solve that Chinese block?

No follow up?

Re:Icanhazip: A simple IP address tool survived a deluge of ... by makach on Tuesday August 01, 2023 @02:40AM (#36953059)
what an amazing letter, thank you for your service!

icanhazip is part of internet lore, and passing it on to Cloudflare is a very noble thing to do! Cloudflare, please stay true to the idealistic principles of simplicity and availability for the service.

Re:Icanhazip: A simple IP address tool survived a deluge of ... by mhayden on Tuesday August 01, 2023 @09:06AM (#36955443)
You're welcome! It was a fun ride with plenty of failures to learn from. ;)
Re:Icanhazip: A simple IP address tool survived a deluge of ... by SergeAx on Tuesday August 01, 2023 @03:29AM (#36953358)
Earlier today, I talked with my ex-colleague about things being bloated and unnecessarily complicated in software. Here we have a perfect example.

  $ curl -v icanhazip.com

  > GET / HTTP/1.1
  > Host: icanhazip.com
  > User-Agent: curl/8.2.1
  > Accept: */*   
curl is being curl here: protocol, host, shortest possible user-agent string, nothing extra. Let's see the reply:

  < HTTP/1.1 200 OK
Okay.

  < Date: Tue, 01 Aug 2023 06:59:21 GMT
I am not sure, is it really necessary? I will use NTP if I need to know the current GMT. RFC doesn't state this header as mandatory.

  < Content-Type: text/plain
  < Content-Length: 14
Okay, nice to know.

  < Connection: keep-alive
Really? What's a use case here? Do I need to be reminded of my IP again in a few seconds? Or is it in case my IP will quickly change? Oh, never mind...

  < Access-Control-Allow-Origin: *
  < Access-Control-Allow-Methods: GET
Now, this is a bit ridiculous. Why would the fetch-based browser app rely on a third-party service to determine the client's IP?

  < Set-Cookie: [250 bytes of total abomination]
Why, oh why? Why do I need to receive this and keep it somewhere? All I want is to haz IP! Can I only haz IP?

  < Server: cloudflare
Okay, a little vanity never killed nobody.

  < CF-RAY: 7efc32adfef5c21e-VIE
I know what Cloudflare Ray is. The question is: why do I need it here?

  < alt-svc: h3=":443"; ma=86400
Good to know, maybe, but to be honest - this is redundant too.

  xxx.xx.xx.xx [my IP address, masked for privacy reasons]
At last! Now I can do my thing with the IP I just haz.

I will not rant here about extra bytes transferred, extra bandwidth congested, extra electricity burned, and so on. Sapienti sat. Two side notes: it replies with HTTP 1.1 on HTTP 1.0 request, and it still puts alt-svc header into https reply.

I rest my case.

Re:Icanhazip: A simple IP address tool survived a deluge of ... by thefz on Tuesday August 01, 2023 @03:40AM (#36953439)
Just use plain curl and all you are getting is the IP.

It was conceived this way to be used in scripts. I don't see why you might want to -v here except to prove a non existing point that you made up.

Re:Icanhazip: A simple IP address tool survived a deluge of ... by SergeAx on Tuesday August 01, 2023 @03:51AM (#36953503)
Because I was interested in the whole response, not it's text/plain part. All those headers are still there, even if I don't use them.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by xereeto on Tuesday August 01, 2023 @05:35AM (#36954121)
You do know headers are transferred whether you look at them or not, right? A request to icanhazip.com results in a response that is 90% completely wasted bandwidth.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by bloqs on Tuesday August 01, 2023 @04:43AM (#36953810)
Im so glad the late 00s era of cringy "lolcat english" is over. Perhaps the modern equivalent of excessively pretentious sounding crypto bro naming schemes is worse in some ways, but at least I dont have to pause to explain the name when I say it out aloud to someone.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by denton-scratch on Tuesday August 01, 2023 @06:21AM (#36954354)
I see no amusing request headers. I guess Cloudflare dropped them.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by erubin on Tuesday August 01, 2023 @06:29AM (#36954405)
if all the traffic is abusiveness why keep running the service
Re:Icanhazip: A simple IP address tool survived a deluge of ... by Yeri on Tuesday August 01, 2023 @07:11AM (#36954637)
Using cloudflare workers you can host your own[1]:

``` addEventListener("fetch", event => { event.respondWith(handleRequest(event.request)) })

async function handleRequest(e) { const connectingIP = e.headers.get("cf-connecting-ip"); return new Response(`${connectingIP}\n`, {status: 200}) } ```

[1]: formatting gets messed up: https://pastebin.com/gSysKd5k

Re:Icanhazip: A simple IP address tool survived a deluge of ... by hfkwer on Tuesday August 01, 2023 @08:16AM (#36955017)
It's sad to think that everyone had to work so hard to solve a problem whose solution is 27 years old. One day we'll just be able to run `ip -6 addr show scope global` and get the correct answer without wasting everyone's bandwidth and compute.
Re:Icanhazip: A simple IP address tool survived a deluge of ... by zzo38computer on Wednesday August 02, 2023 @01:26AM (#36967246)
I use icanhazip. It is good; just the plain IP address, no HTML and no JSON. It could be done even simpler by just nc to a specified host and port and no HTTP is needed either; it need not wait for a request and will not need response headers.

I made a shell script with:

  curl -s 'http://icanhazip.com/' | cat -v