Route 53 as DNS service for an existing domain
If you’re transferring one or more domain registrations to Route 53, and you are using a domain registrar that doesn’t provide (paid) DNS service, you need to migrate the DNS service before you migrate the domain to prevent downtime.
To do this perform the steps in this section.
Get current DNS records
When you migrate DNS service from another provider to Route 53, you reproduce your current DNS configuration in Route 53. The DNS configuration consists of DNS record, where each record indicates how you want to route traffic for a specified domain name or subdomain name.
Create a hosted zone
To tell Route 53 how you want to route traffic for your domain, you create a hosted zone that has the same zone name as your domain. In the hosted zone you will replicate the existing DNS configuration.
// Create public hosted zone to manage DNS records of domain
PublicHostedZone.Builder.create(this, "example-hosted-zone")
.zoneName("example.com")
.comment("Hosted zone for domain `example.com`")
.build();When you create a hosted zone, Route 53 automatically creates a name server (NS) record and a start of authority (SOA) record for the zone. The NS record identifies the four name servers that Route 53 associated with your hosted zone.
Create records
ARecord.Builder.create(scope, "IPv4AliasRecord")
.zone(hostedZone)
.target(...)
.build();https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/MigratingDNS.html