Yes. We use the Cloudflare API to change the DNS record to failover to your backup server.
And for now you can only create checks for DNS entries in your Cloudflare account.
A check monitors a single website hostname (virtual host) i.e. "www.example.com". The DNS entry line in Cloudflare DNS settings (pointing to the IP address of the primary server) is used. If you have multiple subdomains you want to check/failover, you also need multiple checks.
You can define 2 backup servers for the check (IP addresses). If the check fails for the primary server, Cloudflare settings for that DNS entry are updated with the IP of a (working) backup server.
If a failback delay of i.e. 60 seconds is set, a transition from error state to ok state (and failback) is delayed until the time has passed. Checks waiting for failback are shown with pending state in notifications.
If check fails again, a transition to error is made and all is restarted. A server has to be stable for the set period.
The table shows the timestamp, hostname, and server name (as configured in SERVERS section), check result and stat columns.
Result column OK means the check for the hostname+server combination was OK for this check run.
There are different failing states, i.e.: open/read timeout, connection error, page too large.
The result is followed by check state column with possible value: ok, failover, remove, error.
This is only a logfile style overview. For details and current state go to the 'Checks' list.
The default notification is by email to your login email address. You can also set up slack in your profile settings to receive instant notifications via messaging.
Yes, but it is still experimental and incomplete. Here are some example API calls using the curl command:
curl -H 'Content-Type: application/json' -H 'X-Auth-Email: YOUR@EMAIL' -H 'X-Auth-Key: SECRET_KEY' "https://failover.cc/api/servers"
curl -H 'Content-Type: application/json' -H 'X-Auth-Email: YOUR@EMAIL' -H 'X-Auth-Key: SECRET_KEY' -X PUT -d '{"ip":"","name":" "}' "https://failover.cc/api/servers/ " # example call: curl -H 'Content-Type: application/json' -H 'X-Auth-Email: [email protected]' -H 'X-Auth-Key: 7M1IiGcMjnc4U5IhH9HF' -X PUT -d '{"ip":"127.0.0.1","name":"backup1"}' "http://localhost:3000/api/servers/Qlp9EY"
This will *NOT* update the current active IP in Cloudflare. Only use to update backup server IPs.
Get your Secret API key from Profile settings.
If you are using a firewall to restricted access to Cloudflare IP ranges only, you also need to whitelist our IP addresses to get the checks working. We currently send out check requests from these IP addresses:
176.9.3.240 46.4.114.176 104.131.140.219 139.59.112.160 2a01:4f8:151:3282::2 2a01:4f8:141:33e5::2 2a01:4f8:141:126c::2
Yes, you can use the API (see above) to update the address of the backup server with i.e. a curl call from your crontab or dialup script.
Warning: if failed over to the backup server, API calls will NOT update the current active server address. So if you redial while the backup server is active, connection is lost.
Most probably, the Cloudflare DNS entries were changed. Please use the update button in dashboard to get the current DNS entries from Cloudflare and go through your checks and replace empty or wrong DNS records.
To avoid problems like that, please do not change (especially delete and recreate) DNS entries in Cloudflare that are set up in failover.cc - Id reference will be lost and on next update (failover) there is an error.
Yes, read below about the check modes.
check only: only run the checks and send notifications about server state changes. No further action is taken (changing of Cloudflare DNS entries)
automatic failover (to 2nd/3rd): Use this if you want to point a DNS entry to another server in failover case. The value part (IP address) of the DNS entry is replaced with the IP address of the Server 2 or Server 3 entry of your check. Only working backup servers are used.
automatic failover (remove DNS record): Use this if you have multiple DNS lines with the same name entry (examples.com 10.0.0.1, example.com 10.0.0.2; aka round-robin DNS setup). If a server fails, the DNS name part is changed to remove the failed server from the pool.
Note: if the entry is the last working one for the DNS name, it will NOT be removed. This is to make sure your domain name always resolves.
yes, response codes are checked. All 2XX and 3XX result codes are OK. Everything greater or equal to 400 is considered failed and leads to ERROR state.
Connection and timeout errors also lead to ERROR state (timeouts can be configured in Advanced settings of your check).