Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: Justyourip.com (justyourip.com)
42 points by geocrasher on Jan 18, 2022 | hide | past | favorite | 44 comments


Anyone who runs a website with nginx might find this directive helpful:

    location /whatsmyip {
        default_type text/plain;
        return 200 $remote_addr\n;
    }


I got tired of sending people to ad laden websites, some of them quite obnoxious, just for an IP. So I made this.

No ads, no affiliation with anybody but the guy who made it, just a place to get Just Your IP.


Gosh, and here I feel like an Old for remembering the big list:

* http://checkip.dyndns.com/

* http://ip1.dynupdate.no-ip.com/

* https://ipchicken.com/

* https://ifconfig.me

or, the classic "let TTL do the work": ping -i 2 example.org (assuming you're one hop from your egress)


There's also icanhazip.com and /cdn-cgi/trace on any Cloudflare-proxied site.


I didn't know about the /cdn-cgi/trace Cloudflare trick. Here's a one-liner to print just the ip via curl:

  curl -s cloudflare.com/cdn-cgi/trace | grep ip | cut -d "=" -f 2 --


That may return IPv6 if you have IPv6 connectivity, which might not be what you're looking for.

I just do this, myself:

IP=`curl -s checkip.amazonaws.com`


You could use awk instead of grep & cut:

      curl -s cloudflare.com/cdn-cgi/trace | awk '{FS="="} /ip/ {print $2}'


And sed:

    curl -s cloudflare.com/cdn-cgi/trace | sed -nr "s/^ip\=(.+)$/\1/p"


What do those -- at the end do? I get my IP without them.


One does not simply upvote to the top alone! Thank you, bookmarked!


Thanks!


How about a sister site called notyourip.com that shows someone else’s IP address?


Just a heads up that it's not working as expected in Chrome. I loaded the page and got an IP that wasn't mine, then refreshed the page and got a different IP that still wasn't mine. Upon further investigation, both incorrect IPs appear to be owned by CloudFlare.

Same results in Safari. Oddly enough, works as expected in Firefox.


Yeah I was initially testing it on Cloudflare but took it off because I didn't want to fiddle with the server. DNS might be cached for some reason. I switched over to my private nameservers for the time being.

Edit: Are you using 1.1.1.1 by chance? If so turn it off.


I recommend https://ifconfig.me which has ways to actually just return the IP address unlike this website e.g via curl



That is already 100 times better than existing solutions.

That being said, I find it useful to see the location I'm connecting from (mostly to make sure that my VPN works).


Do you mean rdns for your hostname, or geolocation? Or both?


Not sure what the difference is but either probably works for my use case.


I love it, one thing it does, and that's it, 2 lines of text and the information i want. thank you for this tool.


It's not just that. Take your cursor and drag over the site as if to paint the entire page for copying.




Personally I prefer ifconfig.me which takes this idea one step further.

Especially: Querying it with curl (or another system requesting plain text) really only returns the IP, not some HTML page. (Opening it in the browser also shows some useful information about the request, but http://ifconfig.me/ip always shows just your IP address)


I can make a curl version of it at some point. For now, though, the point is that its JUST your IP. Nothing else. It's made for sending grandma's to.

EDIT: Now, best of both worlds. Reload the page and either highlight the page text or look in the source code for how to use it with curl and bash. I'm sure you can figure out your favorite parser for csv.


JustYouRip.com


:D yup that's one interpretation lol


I'm a big fan of https://httpbin.org/ip

or

dig @ns1.google.com o-o.myaddr.l.google.com TXT +short | tr -d \"

or

https://github.com/Snawoot/myip


Also http://v4.ident.me and http://v6.ident.me if you want to check a specific IP version. Unfortunately, leaving off the version prefix (/subdomain) doesn't work.



I use those that have IP geolocation or ISP info to confirm that my VPN or proxy works.

Otherwise I'm happy that you've made this. The world has fewer and fewer tools that do one thing well without asking anything of you.


It is the Unix way :-)


Doesn’t seem to work for me on Safari/iOS.

Couple alternatives:

* Search Google or DDG for “my ip”.

* http://checkip.amazonaws.com/


I like Amazon's page because it doesn't return any HTML, just a simple plaintext response which makes it simple to integrate into a script or bash one-liner. Also, Amazon is large enough that I'm confident they're not going to put in a captcha or rate limit.


My favorite (very fast & lightweight)

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


This doesn't work for me for some reason.

I use:

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

which I've aliased to ipe


That's neat, but you have to get rid of the quotes somehow.


This doesn't work for me, I had a VPN and resreshed on and off and it doesn't change


Where do I submit feature requests?


You can comment here for now.


Was joking :) It does everything it says it will


Well in that case you can submit a pull request on my github repo. :D


Doesn't work with IPv6...


Just You Rip




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: