Manage dynamic IPs in Cloudflare DNS programmatically

This article describes the methods available for programmatically updating dynamic DNS at Cloudflare without relying upon manual changes via the Cloudflare dashboard UI.


Overview

Some hosting providers dynamically update their customer's IP addresses. These customers must then update the new origin server IPs in their Cloudflare DNS.  Below are several methods for automatically updating dynamic IPs in Cloudflare DNS.


Cloudflare API

Cloudflare DNS can be updated via the Cloudflare API. For example, a Cloudflare customer can create a script to monitor for IP address changes and then have the script push those changes to the Cloudflare API.


ddclient

ddclient is a third-party Perl client used to update dynamic DNS entries for accounts on various DNS providers.  Learn how to install ddclient for a Cloudflare domain. Also, refer to the ddclient documentation on sourceforge.net


DNS-O-Matic

DNS-O-Matic is a third-party tool that provides a way to announce dynamic IP changes to multiple services. DNS-O-Matic allows a user to pick and choose what Dynamic DNS services to notify about the update and is configurable from a UI. Refer to the documentation for DNS-O-Matic. 

Address questions or feedback to the email address for OpenDNS staff provided in the aforementioned documentation.

Configuration of DNS-O-Matic requires prior knowledge of the following information. Content within <> brackets below must be determined for the particular domain:

  • Email: <CLOUDFLARE ACCOUNT EMAIL ADDRESS>
  • API Token: <CLOUDFLARE GLOBAL API KEY>
  • Domain: <example.com>
  • Hostname: dynamic

Email is the email address corresponding to the account used to log in to Cloudflare. If using Cloudflare’s Multi-user account feature, this email address must have sufficient privileges for managing DNS.

To find your API Token the Cloudflare UI:

  1. Log in to the Cloudflare dashboard.
  2. Select My Profile from the dropdown located in the top right.
  3. Under API Keys, click View beside Global API Key.

 

Not finding what you need?

95% of questions can be answered using the search tool. This is the quickest way to get a response.

Powered by Zendesk