Live data from Hacker News

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

blog.apnic.net

121–130 of 146 posts

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

#121
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…

Another one https://whatismyip.akamai.com/advanced?debug https://ipv4.whatismyip.akamai.com 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.

Another DNS based one:

  dig ip @dns.toys +short

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

#122
post #85
post #79

Earlier 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…

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

#123
post #109

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: Okay. I am not sure, is it really necessary? I will use N…

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.

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

#124

Earlier quoted context omitted.

Another one https://whatismyip.akamai.com/advanced?debug https://ipv4.whatismyip.akamai.com 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.

Another DNS based one: dig ip @dns.toys +short

[deleted]

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

#125
post #114
post #100

Earlier quoted context omitted.

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 ).

Great service! Very informative. If you could also implement ip.wtf/ip or some such, it might decrease your bandwidth..!

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

#128
post #81

Earlier quoted context omitted.

My favorite: https://cloudflare.com/cdn-cgi/trace

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.

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

#129
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

Post reply on HN