CloudflareDDNS

Technologies

Description

An opensource project hosted at http://cloudflareddns.com/, I developed a Cloudflare DDNS in Pyhton in order to automate the process of updating DNS records on Cloudflare. The need arose as existing services like Dyno DNS and no-ip were not capable of updating DNS hosted at Cloudflare and I was not going to give up using their CDN. The manual process of logging into Cloudflare and updating each of my domains each time my ISP gave me a new IP was time-consuming and frustrating. My ISP was not willing to give me a static IP unless I upgraded to business internet which did not come with faster speeds, just double the price. I assumed there were many other people with the same issue.

Cloudflare DDNS leverages the Cloudflare API and retrieves the public IP address from IP reporting APIs. It uses a configuration in the form of a hardcoded Python script or an external JSON file, containing the list of domains, their corresponding DNS records, API key, and email address, to perform the updates.

I have installed the script on a small Linux box that controls DNS and DHCP for my house and it is executed by a cronjob every 5 minutes.

While the script is functional, there is room for improvement. Currently, it requires a cron job to run, but I could potentially run it as a service in the future. However, cron handles timing, logging, and other aspects perfectly well, so this may not be necessary for such a small task.