Migrate DNS settings from GoDaddy console to GCP DNS Zone managed via Terraform
Package for migrating GoDaddy DNS settings to a Google Cloud Project (GCP) Managed DNS Zone (via Terraform).
I’ve inherited some GoDaddy managed websites, and found configuration updates on GoDaddy and customer support to be
lacking. Managing DNS via GCP is a smoother experience with faster DNS updates.
Managing your DNS via Terraform (infrastructure as code) has two major benefits:
Export your DNS settings to a Terraform config file using this package. (Substitute your own API key, secret, and domain name):
$ GODADDY_API_KEY="your_developer_api_key" \
GODADDY_API_SECRET="you_developer_api_secret" \
python3 godaddy_dns_to_gcp_terraform.py --domain yourdomain.com
Move the resulting Terraform config file, migrated.tf
to your GCP projects Terraform directory (feel free to rename).
Run terraform apply
. Inspect changes before approving.
(Optional) compare the existing DNS responses with GCP managed DNS responses. For example, you can use dig to compare each entry manually:
# GoDaddy managed
dig subdomain.yourdomain.com CNAME
# GCP managed
dig @ns-cloud-e1.googledomains.com subdomain.yourdomain.com CNAME
You can find the appropriate name server for your GCP Managed DNS zone at https://console.cloud.google.com/net-services/dns/zones
In the GoDaddy DNS GUI (https://dcc.godaddy.com/manage/yourdomain.com/dns) change the nameservers from GoDaddy to GCP