Skip to content
Software capabilities
Cloudflare

Import DNS records from a BIND zone file

Upload a BIND-format zone file to import DNS records into a Cloudflare zone.

Documentation reviewed · 2 methods with sources

Ways to do it

  1. API: POST /zones/{zone_id}/dns_records/import
  2. SDK: client.dns.records.import()
API

POST /zones/{zone_id}/dns_records/import

Upload a BIND-format zone file to a Cloudflare zone.

Read source: Cloudflare API: Import DNS Records
Requirements
A zone ID, an API token with DNS Write when using token auth, and a multipart body containing the file field. The optional proxied field takes a string value of true or false.
Limitations
The upload limit is 32 MiB. Cloudflare also limits parsing by the record quota plus a buffer, and caps $GENERATE expansion at 1,000,000 records per import.
SDK

client.dns.records.import()

Call client.dns.records.import to upload BIND-format content and read the import report.

Read source: Generated Cloudflare TypeScript DNS method: POST /zones/{zone_id}/dns_records/import
Requirements
An authenticated Cloudflare TypeScript client, zone_id, and the zone contents in the file string. proxied is an optional string.
Limitations
The SDK sends multipart form data. The API’s file size and record expansion limits apply.