News for hackers. Stuff that matters.
Re:Free DDNS with Cloudflare and a Cronjob by codetrotter on Saturday July 27, 2024 @10:50AM (#41086966)
Seems to rely on https://api.ipify.org/ to determine public IP.

Is there any Cloudflare service one can use to determine the IP instead? That way there’s not an extra company in addition to Cloudflare itself that you need to continue existing.

Re:Free DDNS with Cloudflare and a Cronjob by gothink on Saturday July 27, 2024 @11:03AM (#41087037)
I feel like it's worth mentioning icanhazip.com [0] as well, since it's now run by Cloudflare [1]. Until recently switching to a custom CF worker, that's been by go-to for ages.

[0]: https://www.icanhazip.com/ [1]: https://major.io/p/a-new-future-for-icanhazip/

Re:Free DDNS with Cloudflare and a Cronjob by noname120 on Saturday July 27, 2024 @11:18AM (#41087124)
Does Cloudflare have a history of sunsetting products they've bought? Acquisitions by Google, Apple, Meta, etc. are yellow flags that the product may cease to exist soon. I wonder if Cloudflare has a better track record in that regard.
Re:Free DDNS with Cloudflare and a Cronjob by godzillabrennus on Saturday July 27, 2024 @11:31AM (#41087204)
No one sunsets products like Google.

I’m in the middle of transferring all my domains from Squarespace thanks to Googles sale of that business to that incredibly lousy vendor.

Re:Free DDNS with Cloudflare and a Cronjob by CSSer on Saturday July 27, 2024 @12:08PM (#41087434)
Ugh, same. You’re right. Nothing is safe at Google or even a safe bet with Google. Look at third-party cookies. I can’t believe there isn’t outrage in the streets over the fact that they beat that drum for four straight years and now they suddenly have a change of heart.

At some point their rationale has to become irrelevant. It’s simply unprofessional behavior.

Re:Free DDNS with Cloudflare and a Cronjob by b0ner_t0ner on Saturday July 27, 2024 @10:37PM (#41090860)
> Nothing is safe at Google

Google Ads

Re:Free DDNS with Cloudflare and a Cronjob by CSSer on Monday July 29, 2024 @10:10AM (#41100595)
This narrative might be shifting in realtime with the LLM race and privacy wars. How do I advertise in Gemini? Do Google users want me to? I’ve worked in and around digital advertising and marketing for the better part of a decade. We look at Google with all the admiration one would have for a pet crocodile.
Re:Free DDNS with Cloudflare and a Cronjob by blooalien on Saturday July 27, 2024 @12:10PM (#41087442)
May I inquire who you're moving to, and where I might browse to in order to follow you away from Squarespace / Google Domains? :)
Re:Free DDNS with Cloudflare and a Cronjob by pxx on Saturday July 27, 2024 @01:36PM (#41088103)
the correct answer I think is cloudflare? I'm a little wary of internet homogenization like this but I haven't the time to worry about this sort of thing for my spare one-off domains
Re:Free DDNS with Cloudflare and a Cronjob by graton on Saturday July 27, 2024 @07:28PM (#41090107)
I have moved all of mine to Cloudflare.
Re:Free DDNS with Cloudflare and a Cronjob by godzillabrennus on Thursday August 08, 2024 @06:35PM (#41197106)
NameCheap for the ones they support. I don’t like how tightly wound Cloudflare domains are with the account. I’m nervous about putting too many eggs in one basket with them. I sometimes need to switch hosting a domain in a cloudflare account with another cloudflare account. They don’t let you do that without moving a domain to a third party registrar first. I just shortened that process.
Re:Free DDNS with Cloudflare and a Cronjob by _0xdd on Saturday July 27, 2024 @12:34PM (#41087652)
This is how I ended up on Cloudflare. Burn by Google yet again.
Re:Free DDNS with Cloudflare and a Cronjob by immibis on Sunday July 28, 2024 @08:42AM (#41092816)
Now we wait until you get burned by Cloudflare. Have we already forgotten the "We've discovered a technical problem with your domain: pay us $150,000 or fuck off"
Re:Free DDNS with Cloudflare and a Cronjob by tomschlick on Saturday July 27, 2024 @01:03PM (#41087881)
Not that I'm aware of and this is likely now just a cloudflare worker that returns the IP they already have. I would imagine maintenance is basically zero as its feature complete.
Re:Free DDNS with Cloudflare and a Cronjob by szundi on Saturday July 27, 2024 @02:32PM (#41088416)
True but there is no such thing as zero maintenance
Re:Free DDNS with Cloudflare and a Cronjob by teamspirit on Saturday July 27, 2024 @10:56AM (#41086994)
Re:Free DDNS with Cloudflare and a Cronjob by mxuribe on Saturday July 27, 2024 @11:22AM (#41087154)
The (above) shared url leveraging the cloudflare.com domain name seems to show ip v6 address, while I've noticed that the following defaults to showing ip v4 address: https://1.1.1.1/cdn-cgi/trace

Pick your poison as you wish - either is great! :-)

Re:Free DDNS with Cloudflare and a Cronjob by codetrotter on Saturday July 27, 2024 @12:18PM (#41087513)
I’d pick the one that supports IPv6 and then make two separate requests to it. One request over IPv4 and one over IPv6.

  curl -4 https://www.cloudflare.com/cdn-cgi/trace

  curl -6 https://www.cloudflare.com/cdn-cgi/trace
Also the reason that the 1.1.1.1 one shows only IPv4 address is because 1.1.1.1 is itself an IPv4 address. So any connection to it will have to be using IPv4.
Re:Free DDNS with Cloudflare and a Cronjob by tcfhgj on Saturday July 27, 2024 @12:34PM (#41087642)
could you not retrieve your ipv6 directly from the system?
Re:Free DDNS with Cloudflare and a Cronjob by codetrotter on Saturday July 27, 2024 @01:29PM (#41088045)
Yes, but getting it in a response from an external server means I don’t have to be specific about which interface to get the IPv6 address of and so on.
Re:Free DDNS with Cloudflare and a Cronjob by tcfhgj on Saturday July 27, 2024 @01:37PM (#41088116)
the same specific interface used to contact the external server
Re:Free DDNS with Cloudflare and a Cronjob by codetrotter on Saturday July 27, 2024 @02:14PM (#41088340)
Which is neatly abstracted away so you don’t have to think about it unless you want to. And therefore reaching out to an external server and having it say where the request came from is the path of least resistance for a script that can work across different hosts with minimal machine specific configuration.

Listen, if you want to check the IPv6 address from the interface list go ahead I’m not trying to stop you.

But because I anyway need to reach a third party to know my own IPv4 address then yeah when that third party can also tell me IPv6 address I’m gonna do it that way.

Re:Free DDNS with Cloudflare and a Cronjob by wizzwizz4 on Saturday July 27, 2024 @02:00PM (#41088256)
i.e., an arbitrarily-selected interface capable of reaching Cloudflare.
Re:Free DDNS with Cloudflare and a Cronjob by graton on Saturday July 27, 2024 @07:31PM (#41090123)
That requires running it on the router/device which gets the public IP address. By using the service you can update your DNS IP address on a system that is behind the router.
Re:Free DDNS with Cloudflare and a Cronjob by tcfhgj on Sunday July 28, 2024 @03:25AM (#41091773)
What do you mean?

Every device gets a public ipv6 (usually).

Re:Free DDNS with Cloudflare and a Cronjob by graton on Sunday July 28, 2024 @11:26AM (#41093853)
I have a router connected to the internet, it gets the public IP address.

The router is connected to the internal network in my home and has the IP address of 192.168.1.1.

Behind the router is my computer which has a non-public IP address, for example 192.168.1.2. My computer is the one I want to run the program to update the DNS entry. My computer does not know what the public IP address is by looking at its interfaces.

Re:Free DDNS with Cloudflare and a Cronjob by tcfhgj on Sunday July 28, 2024 @02:50PM (#41095107)
We're talking ipv6 not ipv4
Re:Free DDNS with Cloudflare and a Cronjob by graton on Monday July 29, 2024 @02:19AM (#41098296)
I think the same situation applies for IPv6 if you are behind a router.
Re:Free DDNS with Cloudflare and a Cronjob by tcfhgj on Monday July 29, 2024 @03:58AM (#41098687)
No, it doesn't
Re:Free DDNS with Cloudflare and a Cronjob by graton on Monday July 29, 2024 @12:14PM (#41101531)
I'll agree to disagree :)
Re:Free DDNS with Cloudflare and a Cronjob by tcfhgj on Tuesday July 30, 2024 @02:48AM (#41106626)
Re:Free DDNS with Cloudflare and a Cronjob by graton on Tuesday July 30, 2024 @11:02AM (#41109841)
As I've said before. The server behind the router does not have a public IPv6 address. It is NATed to the Internet. Getting the internal IPv6 address is useless for this case.

I do not like to have the servers/computers that are on the internal home network directly connected to the Internet.

Re:Free DDNS with Cloudflare and a Cronjob by tcfhgj on Thursday August 01, 2024 @03:50AM (#41127013)
Nating in the context of ipv6 is not a common thing. It is the exception, while it's the rule for ipv4
Re:Free DDNS with Cloudflare and a Cronjob by macote on Saturday July 27, 2024 @12:49PM (#41087777)
This is how I use it in my bash script:

  current_ip=$(curl -s -X GET https://1.1.1.1/cdn-cgi/trace | grep -Po "(?<=ip=)(.*)")
Re:Free DDNS with Cloudflare and a Cronjob by networked on Saturday July 27, 2024 @03:01PM (#41088560)
I find awk more clear for this kind of job. You can replace

  grep -Po "(?<=ip=)(.*)"
with

  awk -F= '$1 == "ip" { print $2 }'
Re:Free DDNS with Cloudflare and a Cronjob by macote on Sunday July 28, 2024 @08:45AM (#41092824)
Thanks for that, I agree.
Re:Free DDNS with Cloudflare and a Cronjob by immibis on Sunday July 28, 2024 @08:42AM (#41092818)
Works on every cloudflare-MITMed domain btw.
Re:Free DDNS with Cloudflare and a Cronjob by victorbjorklund on Saturday July 27, 2024 @10:58AM (#41087001)
You could do it with a cloudflare worker that just returns the ip address of the request
Re:Free DDNS with Cloudflare and a Cronjob by victorbjorklund on Saturday July 27, 2024 @10:58AM (#41087006)
Nevermind. The other answer is better
Re:Free DDNS with Cloudflare and a Cronjob by fullspectrumdev on Saturday July 27, 2024 @12:33PM (#41087637)
Kind of, you can use the CF CDN to grab an external IP by using any CF site.

Example: https://www.fullspectrum.dev/a-less-suspect-way-to-get-exter...

Re:Free DDNS with Cloudflare and a Cronjob by genewitch on Saturday July 27, 2024 @01:55PM (#41088231)
there's a way to tell caddy server to host its own access.log

So you have some junk VPS or whatever that just has caddy hosting its log with an easy to remember domain (they're cheap enough), and you go like "curl http://easydomain.com/idreallylikemyip" and then once more: curl http://easydomain.com/N | grep "idreallylikemyip"

the code that used to work is on my github, i uploaded it there a week or two ago. Someone who needs a way to find out the public ipv4 of any device not just their own can probably figure out how to get it to work again!

Re:Free DDNS with Cloudflare and a Cronjob by dathery on Saturday July 27, 2024 @02:14PM (#41088338)
You can have Caddy return the user's IP address directly: https://caddy.community/t/caddy-server-that-returns-only-ip-...

Similar things are also possible with nginx and Apache.

Re:Free DDNS with Cloudflare and a Cronjob by genewitch on Saturday July 27, 2024 @02:54PM (#41088528)
this was implemented in 2018, but it is good to know. it also doubled as a dumb way to pass messages between hosts.
Re:Free DDNS with Cloudflare and a Cronjob by BasiliusCarver on Saturday July 27, 2024 @09:16PM (#41090569)
I’ve used this: dig @1.1.1.1 ch txt whoami.cloudflare +short
Re:Free DDNS with Cloudflare and a Cronjob by codetrotter on Sunday July 28, 2024 @08:52AM (#41092849)
That's pretty neat!

And they offer a similar service on their DNS resolver over IPv6.

This page lists the IPv6 addresses to use when connecting to their resolver over IPv6

https://developers.cloudflare.com/1.1.1.1/ip-addresses/

and with that I just tried

  dig @2606:4700:4700::1111 ch txt whoami.cloudflare +short
And it works, returning the IPv6 address that the request came from :)