You are migrating to Cloud DNS and want to import your BIND zone file.
Which command should you use?
Click on the arrows to vote for the correct answer
A. B. C. D.C.
Once you have the exported file from your other provider, you can use the gcloud dns record-sets import command to import it into your managed zone.
To import record-sets, you use the dns record-sets import command.
The --zone-file-format flag tells importto expect a BIND zone formatted file.
If you omit this flag, import expects a YAML-formatted records file.
https://medium.com/@prashantapaudel/gcp-certification-series-2-4-planning-and-configuring-network-resources-8045ac2cc2acTo migrate to Cloud DNS and import your BIND zone file, you should use the gcloud dns record-sets import
command. This command allows you to import records from a BIND zone file into a Cloud DNS managed zone.
Out of the four options given, the correct command to use is Option C: gcloud dns record-sets import ZONE_FILE --zone-file-format --zone MANAGED_ZONE
.
Here's a breakdown of each of the options:
Option A: gcloud dns record-sets import ZONE_FILE --zone MANAGED_ZONE
This option only specifies the managed zone but does not provide information about the format of the zone file being imported. As a result, the command will fail to import the zone file.
Option B: gcloud dns record-sets import ZONE_FILE --replace-origin-ns --zone MANAGED_ZONE
This option uses the --replace-origin-ns
flag, which replaces the origin name server of the zone file with the Cloud DNS name server. However, it does not specify the format of the zone file being imported. Therefore, this option will also fail to import the zone file.
Option C: gcloud dns record-sets import ZONE_FILE --zone-file-format --zone MANAGED_ZONE
This option specifies the format of the zone file being imported using the --zone-file-format
flag. This flag is required to correctly parse the zone file and import its records. Therefore, this is the correct command to use.
Option D: gcloud dns record-sets import ZONE_FILE --delete-all-existing --zone MANAGED ZONE
This option uses the --delete-all-existing
flag, which deletes all existing records in the managed zone before importing the new records. However, it does not specify the format of the zone file being imported. Therefore, this option will also fail to import the zone file.
In summary, the correct command to import a BIND zone file into a Cloud DNS managed zone is:
pythongcloud dns record-sets import ZONE_FILE --zone-file-format --zone MANAGED_ZONE
Where ZONE_FILE
is the path to the BIND zone file you want to import, and MANAGED_ZONE
is the name or ID of the Cloud DNS managed zone you want to import the records into.