Live data from Hacker News

Free DDNS with Cloudflare and a cronjob

github.com

41–50 of 202 posts

Re: Free DDNS with Cloudflare and a cronjob

#42
post #37

Since my IP hardly changes, I went from DDNS to an email notifying me when the IP changes with this cron: old_ip=`cat ~/.prev_ip` my_ip=`ifconfig em0 | awk '/inet/ {print $2}' 2>&1` my_email=me@example.com if [ "$my_ip" != "$old_ip" ]; then echo $my_ip > ~/.prev_ip echo $my_ip | mail -r $my_email -s "New IP: $my_ip" $my_email fi

I did something similar, but scripted a curl command to update the DNS A/AAAA records that have a short TTL to the hostname.

It’s also trivial if you run your own nsd/bind instance.

Re: Free DDNS with Cloudflare and a cronjob

#44
post #25

Earlier quoted context omitted.

https://www.cloudflare.com/cdn-cgi/trace will return your ip.

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! :-)

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

#45

Instead of using DDNS, I have been using Cloudflare tunnels to expose my home services to the internet. The setup is much simpler and it seems like it's more secure too You specify a port and point it to a subdomain and it just immediately works, no maintenance necessary. The daemon only needs to be installed once with a simple terminal command

There are some limitations such as: – TLS termination mandatorily happens at Cloudflare (i.e. your traffic is mitm'ed). That's because this free product is meant as a gateway drug (aka a loss leader) to Cloudflare's WAF/Anti-DDOS products (which require TLS termination to happen on their side for technical reasons). – Other TCP protocols (including SSH) require every client to run the software too. So if you were thi…

> – TLS termination mandatorily happens at Cloudflare (i.e. your traffic is mitm'ed). That's because this free product is meant as a gateway drug (aka a loss leader) to Cloudflare's WAF/Anti-DDOS products (which require TLS termination to happen on their side for technical reasons).

But on the flip side, this allows you to have a nice certificate on your outside connection without having to fiddle with letsencrypt or whathaveyou.

Re: Free DDNS with Cloudflare and a cronjob

#46

If only this didn't require an API token with write access to the entire domain. Please Cloudflare, let us grant access to specific (or regexp!) records

Last I checked AWS has the same limitation. One workaround is creating a separate sub-zone and giving access only to that to whatever you need. But for a "cheap homelab" solution, that's gonna cost you a bit more per month.

Re: Free DDNS with Cloudflare and a cronjob

#48
post #19

I used ddclient with Cloudflare for years with no issues. Recently upgraded my home router and the manufacturer operates a free dynamic dns service enabled with a toggle button. I have a cname record in my domain’s dns records pointing to the dynamic dns entry. I actually don’t even need that anymore. All the services I run at home are only for immediate family so only available remotely via a Wireguard vpn connectio…

Mikrotik at least has that DDNS functionality. It is really nice feature.

So does OPNsense. It’s such a joy to use that whole OS.

Re: Free DDNS with Cloudflare and a cronjob

#49

Instead of using DDNS, I have been using Cloudflare tunnels to expose my home services to the internet. The setup is much simpler and it seems like it's more secure too You specify a port and point it to a subdomain and it just immediately works, no maintenance necessary. The daemon only needs to be installed once with a simple terminal command

There are some limitations such as: – TLS termination mandatorily happens at Cloudflare (i.e. your traffic is mitm'ed). That's because this free product is meant as a gateway drug (aka a loss leader) to Cloudflare's WAF/Anti-DDOS products (which require TLS termination to happen on their side for technical reasons). – Other TCP protocols (including SSH) require every client to run the software too. So if you were thi…

They do allow ssh via a web browser. It may be a "beta" feature, but it doesn't require the client to run anything.
Post reply on HN