Pages

Wednesday, April 1, 2020

DNS on AWS / GCP

I have a zone that's hosted by AWS route53 called sysdeseng.com. My goal was to create a few machines on GCP and have them resolve to a delegated subdomain.  For example:

test.scollier-gcp.sysdeseng.com

These are the steps required to do this:

1. Create the zone on "GCPs Network Services", "Cloud DNS"
  • Give it a Zone name
  • Give it a DNS name: scollier-gcp.sysdeseng.com
  • Provide a description
  • Click Create
  • Note the name records, for example:
    • ns-cloud-a1.googledomains.com.
    • ns-cloud-a2.googledomains.com.
    • ns-cloud-a3.googledomains.com.
    • ns-cloud-a4.googledomains.com. 
2. Go to AWS route53 and create a NS record for this zone under the sysdeseng.com domain.
  • Click on the sysdeseng.com zone in route53
  • Create a record set
    • On the right hand side, provide the name: scollier-gcp
    • Change the type to NS
    • Copy the nameservers from GCP and paste into the NS record.
    • Click Create
3. Create the A record on GCP
  • Return to GCP
    • Go to "VPC Network", then "External IP Addresses"
      • Create an external IP address, note it
    • Go back to "GCPs Network Services", "Cloud DNS" and click the zone
    • Add a record set
      • Give it a DNS Name
      • Provide the external IP address 
      • Click Create
4. Test that it works
  • Go to Linux terminal
$ dig +short testing.scollier-gcp.sysdeseng.com.
   34.67.155.244

$ dig +short SOA scollier-gcp.sysdeseng.com
ns-cloud-a1.googledomains.com. cloud-dns-hostmaster.google.com. 1 21600 3600 259200 300

$ dig +short SOA sysdeseng.com
ns-679.awsdns-20.net. awsdns-hostmaster.amazon.com. 1 7200 900 1209600 86400

No comments:

Post a Comment