Redirecting DNS when server is offline

I have an Apache server running on a Raspberry Pi 4.
I’d like to redirect the DNS to my 1&1 hosting when my Raspberry doesn’t respond or when it’s turned off.
Is that posssible? it would be a good option in case the server fails.

You can use Cloudflare’s load balancing or write a script somewhere to update the DNS entry when the original origin is not available.

https://www.cloudflare.com/learning/performance/what-is-server-failover

I understand that it’s not free, right?

Definitely. Else, you might need to write your own script to check the availability of your Raspberry Pi periodically, then update the DNS record once the health check shows your Raspberry Pi is down.

2 Likes

I found this similar post with info/suggestions