gcloud dns record-sets import

NAME
gcloud dns record-sets import - import record-sets into your managed-zone
SYNOPSIS
gcloud dns record-sets importRECORDS_FILE--zone=ZONE,-zZONE[--delete-all-existing][--location=LOCATION][--replace-origin-ns][--zone-file-format][GCLOUD_WIDE_FLAG]
DESCRIPTION
This command imports record-sets contained within the specified record-sets fileinto your managed-zone. Note that NS records for the origin of the zone and theSOA NS field are not imported since name-servers are managed by Cloud DNS. Bydefault, record-sets cannot be imported if there are any conflicts. A conflictexists if an existing record-set has the same name and type as a record-set thatis being imported. In contrast, if the --delete-all-existing flag is used, theimported record-sets will replace all the records-sets currently in themanaged-zone.
EXAMPLES
To import record-sets from a yaml record-sets file, run:
gclouddnsrecord-setsimportYAML_RECORDS_FILE--zone=MANAGED_ZONE

To import record-sets from a zone file, run:

gclouddnsrecord-setsimportZONE_FILE--zone-file-format--zone=MANAGED_ZONE

To replace all the record-sets in your zone with records from a yaml file, run:

gclouddnsrecord-setsimportYAML_RECORDS_FILE--delete-all-existing--zone=MANAGED_ZONE
POSITIONAL ARGUMENTS
RECORDS_FILE
File from which record-sets should be imported. For examples of YAML-formattedand BIND zone-formatted records files, refer tohttps://cloud.google.com/dns/records#importing_and_exporting_record_sets
REQUIRED FLAGS
--zone=ZONE,-zZONE
Name of the managed zone whose record sets you want to manage.
OPTIONAL FLAGS
--delete-all-existing
Indicates that all existing record-sets should be deleted before importing therecord-sets in the records-file.
--location=LOCATION
Specifies the desired service location the request is sent to. Defaults to CloudDNS global service. Use --location=global if you want to target the globalservice.
--replace-origin-ns
Indicates that NS records for the origin of a zone should be imported if defined
--zone-file-format
Indicates that the input records-file is in BIND zone format. If omitted,indicates that the records-file is in YAML format.
GCLOUD WIDE FLAGS
These flags are available to all commands:--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.

Run$gcloud help for details.

NOTES
These variants are also available:
gcloudalphadnsrecord-setsimport
gcloudbetadnsrecord-setsimport

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-06-17 UTC.