Live data from Hacker News

Icanhazip: A simple IP address tool survived a deluge of users (2021)

blog.apnic.net

71–80 of 146 posts

Re: Icanhazip: A simple IP address tool survived a deluge of users (2021)

#72
post #43

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?

I believe you're thinking of OpenDNS: dig -4 +short myip.opendns.com @resolver1.opendns.com

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 users (2021)

#73
post #30

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…

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.

Re: Icanhazip: A simple IP address tool survived a deluge of users (2021)

#74
post #30

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…

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 users (2021)

#75
post #30

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…

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.

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 users (2021)

#78
post #30

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…

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 users (2021)

#79
post #43

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?

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/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 users (2021)

#80
post #43

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?

dig +short TXT o-o.myaddr.l.google.com @ns1.google.com

This works! Thank you very much.
Post reply on HN