Live data from Hacker News

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

blog.apnic.net

41–50 of 146 posts

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

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

Probably more efficient to use https://lib.rs/hyper - and actually maintainable.

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

#42

It's funny that there are so many of these. I use curl ifconfig.me

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

Indeed, it's like "hello, world!" but actually useful :)

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

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

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

#44
post #35
post #28

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

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.

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

#45

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

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

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

This will return the wrong results when used behind a load balancer

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

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

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

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

#49

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

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

#50
post #32

Earlier quoted context omitted.

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

That's ridiculous bandwidth pricing. you can get unmetered gigabit at Hetzner for €20 per month. Need 2 Gb? Order a second server.

Do you think this is an important point?
Post reply on HN