项目作者: JohnMcSpedon

项目描述 :
Migrate DNS settings from GoDaddy console to GCP DNS Zone managed via Terraform
高级语言: Python
项目地址: git://github.com/JohnMcSpedon/GoDaddy_DNS_migrator.git
创建时间: 2021-03-01T09:37:20Z
项目社区:https://github.com/JohnMcSpedon/GoDaddy_DNS_migrator

开源协议:MIT License

下载


godaddy-dns-migrator

Package for migrating GoDaddy DNS settings to a Google Cloud Project (GCP) Managed DNS Zone (via Terraform).

Motivation

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:

  1. Users are forced to explain what DNS changes they’re making (via commit messages or Pull Requests).
    Without this, it’s often hard to reverse engineer why certain DNS records exist.
  2. It’s easy to roll-back to a previously working DNS states. This reduces the likelihood of a long-running website
    outage following a DNS change.

Prerequisites

  1. GCP project managed via Terraform (https://cloud.google.com/docs/terraform)
  2. GoDaddy API Key (https://developer.godaddy.com/keys)

Migrating DNS settings

  1. Export your DNS settings to a Terraform config file using this package. (Substitute your own API key, secret, and domain name):

    1. $ GODADDY_API_KEY="your_developer_api_key" \
    2. GODADDY_API_SECRET="you_developer_api_secret" \
    3. python3 godaddy_dns_to_gcp_terraform.py --domain yourdomain.com
  2. Move the resulting Terraform config file, migrated.tf to your GCP projects Terraform directory (feel free to rename).

  3. Run terraform apply. Inspect changes before approving.

  4. (Optional) compare the existing DNS responses with GCP managed DNS responses. For example, you can use dig to compare each entry manually:

    1. # GoDaddy managed
    2. dig subdomain.yourdomain.com CNAME
    3. # GCP managed
    4. 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

  5. In the GoDaddy DNS GUI (https://dcc.godaddy.com/manage/yourdomain.com/dns) change the nameservers from GoDaddy to GCP

    Nameserver Update