dns.zones.importAdd records from a zone file, replacing sets with the same name and type
SOA and apex NS lines are skipped. Any invalid line fails the whole import.
Request syntax
POST /dns/api/zones/{id}/import
{
"zoneFile": "string"
}Path parameters
idRequiredstring
Constraints: uuid
Request body
zoneFileRequiredstring
RFC 1035 master-file text, 1 to 1,000,000 characters. $ORIGIN and $TTL are honoured (TTL 300 until a $TTL line); other $ directives, SOA and apex NS lines are skipped and reported
Constraints: 1-1000000 chars
Response
200 with { imported, skipped }: imported is the number of record sets written, skipped the lines left out with the reason for each. 400 "Nothing imported: …" naming up to five invalid lines, or a CNAME next to other records at one name; 409 when the zone would pass 10,000 record sets. Nothing is written on a refusal.
A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.
Errors
- 400The request does not pass the schema above. The body is { "error": …, "issues": […] }, one issue per field.
- 401No credentials, or an access key that is unknown, revoked or expired.
- 403The caller's policies do not allow dns:ImportZone on this resource. The body names the action and the resource, and the refusal is recorded in the audit log.
- 404The resource does not exist in your organization.
Examples
The required parameters only, with example values. Replace id and the other placeholders with your own.
dcloud dns zones import id --zone-file examplecurl -X POST "https://console.platform-development.deutschecloud.app/dns/api/zones/id/import" \
-H "Authorization: EWS-ACCESS-KEY $ACCESS_KEY" \
-H "Content-Type: application/json" \
-d '{"zoneFile":"example"}'Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_dns_zones_import.