Skip to content

Create DNS Zone

POST
/enum.api.v1.DnsService/CreateZone
object
projectId
string
name
string
deletionProtected

Protect the zone from deletion; it must be unprotected before it can be deleted. Defaults to true when omitted, so zones are protected unless deletion protection is explicitly set to false.

boolean

OK

object
zone
object
id
string
projectId
string
name

Apex domain name (e.g. example.com).

string
verifiedAt

Set once ownership is proven and the zone is served.

string format: date-time
nameservers

Nameservers to set at the registrar to delegate the zone. Assigned per zone and stable for its lifetime; other zones may be assigned a different pair.

Array<string>
createdAt
string format: date-time
updatedAt
string format: date-time
status
string format: enum
Allowed values: RESOURCE_STATUS_UNSPECIFIED RESOURCE_STATUS_PROVISIONING RESOURCE_STATUS_READY RESOURCE_STATUS_FAILED RESOURCE_STATUS_DELETING
deletionProtected

When true, the zone cannot be deleted until unprotected.

boolean
dnssec

DNSSEC status when online signing is enabled.

object
enabled
boolean
algorithm
string
ds

DS records for registrar handoff (presentation format).

Array<string>
dsPublished
boolean
dsPublishedAt
string format: date-time
dnskey

Zone signing keys in DNSKEY presentation format (“flag protocol algorithm public_key”), for registrars that take a key instead of a DS digest.

Array<string>
observedNameservers

Nameservers the domain is currently delegated to at its registrar, as last observed. Compare against nameservers to see whether delegation is in place.

Array<string>

invalid_argument: the zone name or another field is invalid.

Messages:

  • validation error: <field>: <reason>
  • "<name>" is not a registrable domain
  • "<name>" is not a root domain; register the zone "<root domain>" and manage subdomains as records

failed_precondition: the project has no nameservers assigned.

Messages:

  • project has fewer than 2 assigned nameservers
object
code

Error code, such as invalid_argument or not_found.

string
message

Human-readable error message.

string

unauthenticated: the token is missing, invalid, or expired.

Messages:

  • missing authorization header
  • invalid authorization header format
  • authentication failed
object
code

Error code, such as invalid_argument or not_found.

string
message

Human-readable error message.

string

permission_denied: the token has no access to this project or method.

Messages:

  • not authorized
object
code

Error code, such as invalid_argument or not_found.

string
message

Human-readable error message.

string

already_exists: a resource with this name already exists.

Messages:

  • resource already exists
object
code

Error code, such as invalid_argument or not_found.

string
message

Human-readable error message.

string

resource_exhausted: a rate limit or quota is reached.

Messages:

  • rate limit exceeded: wait for the number of seconds in Retry-After.
  • dns.zones quota exceeded: limit <n>, in use <n>, requested 1: the project has reached its zone quota.
  • no nameserver pair is available for this name: no nameservers are free for this zone name.
object
code

Error code, such as invalid_argument or not_found.

string
message

Human-readable error message.

string

internal: something failed on our side.

Messages:

  • internal error
object
code

Error code, such as invalid_argument or not_found.

string
message

Human-readable error message.

string