Cloudflare DNS icon

Cloudflare DNS

Interact with Cloudflare DNS API

Actions4

Overview

This node interacts with the Cloudflare DNS API to manage DNS records within a specified zone. The "Get All" operation for the DNS Record resource retrieves a list of DNS records from a given Cloudflare zone, optionally filtered by record type, name, or content, and supports pagination.

Common scenarios where this node is beneficial include:

  • Auditing or monitoring DNS records in a Cloudflare-managed domain.
  • Automating DNS record management workflows by retrieving current DNS configurations.
  • Integrating DNS data retrieval into broader automation pipelines, such as syncing DNS records with other systems.

For example, you can use this node to fetch all A and CNAME records for a specific zone to verify their existence or to export them for backup purposes.

Properties

Name Meaning
Zone ID The unique identifier of the Cloudflare zone (domain) to perform the DNS record query on.
Options Collection of optional filters and settings:
  Record Type Filter DNS records by type. Options: All Types, A, AAAA, CNAME, MX, TXT, NS, SRV, PTR.
  Record Name Filter DNS records by their name (e.g., "www", "@").
  Content Filter DNS records by their content (e.g., IP address or target).
  Limit Number of records to return per page. Minimum 5, maximum 5000. Default is 20.

Output

The output is an array of JSON objects representing DNS records retrieved from the specified zone. Each object corresponds to a DNS record and includes fields such as:

  • id: The unique identifier of the DNS record.
  • type: The DNS record type (e.g., A, CNAME).
  • name: The DNS record name.
  • content: The content of the DNS record (e.g., IP address).
  • Other metadata fields provided by the Cloudflare API, such as TTL, proxied status, priority, etc.

No binary data is output by this operation.

Dependencies

  • Requires an API key credential for authenticating with the Cloudflare DNS API.
  • The node uses the Cloudflare API base URL: https://api.cloudflare.com/client/v4.
  • Proper configuration of the API authentication token in n8n credentials is necessary.

Troubleshooting

  • Common issues:

    • Invalid or missing Zone ID will cause the API request to fail.
    • Incorrect or expired API authentication token will result in authorization errors.
    • Filtering parameters that do not match any records will return an empty result set.
    • Requesting more than the allowed limit (over 5000) will be rejected.
  • Error messages:

    • Errors returned by the Cloudflare API are thrown with details, e.g., Cloudflare API Error: [...].
    • To resolve, verify the Zone ID, API credentials, and filter parameters.
    • Ensure network connectivity to the Cloudflare API endpoint.

Links and References

Discussion