Migrate Domain DNS from DigitalOcean to GCP Cloud DNS
I had to recently migrate the DNS configurations (A
, AAAA
CNAME
, TXT
, MX
, etc. records) for a particular domain from DigitalOcean to Google Cloud Platform Cloud DNS. Doing it is really simple – you just need to export the zone file from DO and then import the same into GCP Cloud DNS (using the gcloud
cli).
Exporting DNS Zone File in DO
- Login to your DigitalOcean control panel.
- In the main menu, click on
Networking > Domains
. - Open the
More
menu and click onDownload zone
link. This should download your zone file.

Import DNS Zone File into GCP Cloud DNS
Before importing the downloaded zone file into Cloud DNS, I personally got rid of the SOA and main NS records from it because the corresponding records already existed in my pre-created Cloud DNS zone. You might want to do the same.
If your DNS zone in Cloud DNS is not already created, then create a managed zone with the gcloud
cli (can also do it from the GCP web console):
gcloud dns managed-zones create EXAMPLE_ZONE_NAME \
--dns-name=example.com.
--description=A_ZONE
Once the zone is created, import the downloaded (and optionally modified) zone file from the previous step:
gcloud dns record-sets import -z=EXAMPLE_ZONE_NAME --zone-file-format path-to-example-zone-file
That should be it!
References: