Amazon Route 53
Developer Guide (API Version 2013-04-01)

Making Route 53 the DNS Service for a Domain That's in Use

If you want to migrate DNS service to Amazon Route 53 for a domain that is currently getting traffic—for example, if your users are using the domain name to browse to a website or access a web application—perform the procedures in this section.

Step 1: Get Your Current DNS Configuration from the Current DNS Service Provider (Optional but Recommended)

When you migrate DNS service from another provider to Route 53, you reproduce your current DNS configuration in Route 53. In Route 53, you create a hosted zone that has the same name as your domain, and you create records in the hosted zone. Each record indicates how you want to route traffic for a specified domain name or subdomain name. For example, when someone enters your domain name in a web browser, do you want traffic to be routed to a web server in your data center, to an Amazon EC2 instance, to a CloudFront distribution, or to some other location?

The process that you use depends on the complexity of your current DNS configuration:

  • If your current DNS configuration is simple – If you're routing internet traffic for just a few subdomains to a small number of resources, such as web servers or Amazon S3 buckets, then you can manually create a few records in the Route 53 console.

  • If your current DNS configuration is more complex, and you just want to reproduce your current configuration – You can simplify the migration if you can get a zone file from the current DNS service provider, and import the zone file into Route 53. (Not all DNS service providers offer zone files.) When you import a zone file, Route 53 automatically reproduces the existing configuration by creating the corresponding records in your hosted zone.

    Try asking customer support with your current DNS service provider how to get a zone file or a records list. For information about the required format of the zone file, see Creating Records By Importing a Zone File.

  • If your current DNS configuration is more complex, and you're interested in Route 53 routing features – Review the following documentation to see whether you want to use Route 53 features that aren't available from other DNS service providers. If so, you can either create records manually, or you can import a zone file and then create or update records later:

    • Choosing Between Alias and Non-Alias Records explains the advantages of Route 53 alias records, which route traffic to some AWS resources, such as CloudFront distributions and Amazon S3 buckets, for no charge.

    • Choosing a Routing Policy explains the Route 53 routing options, for example, routing based on the location of your users, routing based on the latency between your users and your resources, routing based on whether your resources are healthy, and routing to resources based on weights that you specify.

    Note

    You can also import a zone file and later change your configuration to take advantage of alias records and complex routing policies.

If you can't get a zone file or if you want to manually create records in Route 53, the records that you're likely to migrate include the following:

  • A (Address) records – associate a domain name or subdomain name with the IPv4 address (for example, 192.0.2.3) of the corresponding resource

  • AAAA (Address) records – associate a domain name or subdomain name with the IPv6 address (for example, 2001:0db8:85a3:0000:0000:abcd:0001:2345) of the corresponding resource

  • Mail server (MX) records – route traffic to mail servers

  • CNAME records – reroute traffic for one domain name (example.net) to another domain name (example.com)

  • Records for other supported DNS record types – For a list of supported record types, see Supported DNS Record Types.

Step 2: Create a Hosted Zone

To tell Amazon Route 53 how you want to route traffic for your domain, you create a hosted zone that has the same name as your domain, and then you create records in the hosted zone.

Important

You can create a hosted zone only for a domain that you have permission to administer. Typically, this means that you own the domain, but you might also be developing an application for the domain registrant.

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. To make Route 53 the DNS service for your domain, you update the registration for the domain to use these four name servers.

Important

Don't create additional name server (NS) or start of authority (SOA) records, and don't delete the existing NS and SOA records.

To create a hosted zone

  1. Sign in to the AWS Management Console and open the Route 53 console at https://console.aws.amazon.com/route53/.

  2. If you're new to Route 53, choose Get Started Now under DNS Management.

    If you're already using Route 53, choose Hosted Zones in the navigation pane.

  3. Choose Create Hosted Zone.

  4. In the Create Hosted Zone pane, enter a domain name and, optionally, a comment. For more information about a setting, pause the mouse pointer over its label to see a tool tip.

    For information about how to specify characters other than a-z, 0-9, and - (hyphen) and how to specify internationalized domain names, see DNS Domain Name Format.

  5. For Type, accept the default value of Public Hosted Zone.

  6. Choose Create.

Step 3: Create Records

After you create a hosted zone, you create records in the hosted zone that define where you want to route traffic for a domain (example.com) or subdomain (www.example.com). For example, if you want to route traffic for example.com and www.example.com to a web server on an Amazon EC2 instance, you create two records, one named example.com and the other named www.example.com. In each record, you specify the IP address for your EC2 instance.

You can create records in a variety of ways:

Import a zone file

This is the easiest method if you got a zone file from your current DNS service in Step 1: Get Your Current DNS Configuration from the Current DNS Service Provider (Optional but Recommended). Amazon Route 53 can't predict when to create alias records or to use special routing types such as weighted or failover. As a result, if you import a zone file, Route 53 creates standard DNS records using the simple routing policy.

For more information, see Creating Records By Importing a Zone File.

Create records individually in the console

If you didn't get a zone file and you just want to create a few records with a routing policy of Simple to get started, you can create the records in the Route 53 console. You can create both alias and non-alias records.

For more information, see the following topics:

Create records programmatically

You can create records by using one of the AWS SDKs, the AWS CLI, or AWS Tools for Windows PowerShell. For more information, see AWS Documentation.

If you're using a programming language that AWS doesn't provide an SDK for, you can also use the Route 53 API. For more information, see the Amazon Route 53 API Reference.

Step 4: Lower TTL Settings

The TTL (time to live) setting for a record specifies how long you want DNS resolvers to cache the record and used the cached information. When the TTL expires, a resolver sends another query to the DNS service provider for a domain to get the latest information.

The typical TTL setting for the NS record is 172800 seconds, or two days. The NS record lists the name servers that the Domain Name System (DNS) can use to get information about how to route traffic for your domain. Lowering the TTL for the NS record, both with your current DNS service provider and with Amazon Route 53, reduces downtime for your domain if you discover a problem while you're migrating DNS to Route 53. If you don't lower the TTL, your domain could be unavailable on the internet for up to two days if something goes wrong.

We recommend that you change the TTL on the following NS records:

  • On the NS record in the hosted zone for the current DNS service provider. (Your current provider might use different terminology.)

  • On the NS record in the hosted zone that you created in Step 2: Create a Hosted Zone.

To lower the TTL setting on the NS record with the current DNS service provider

  • Use the method provided by the current DNS service provider for the domain to change the TTL for the NS record in the hosted zone for your domain.

To lower the TTL setting on the NS record in a Route 53 hosted zone

  1. Sign in to the AWS Management Console and open the Route 53 console at https://console.aws.amazon.com/route53/.

  2. Choose Hosted Zones in the navigation pane.

  3. Choose the name of the hosted zone.

  4. Choose the NS record.

  5. Change the value of TTL (Seconds). We recommend that you specify a value between 60 seconds and 900 seconds (15 minutes).

  6. Choose Save Record Set.

Step 5: Wait for the Old TTL to Expire

If your domain is in use—for example, if your users are using the domain name to browse to a website or access a web application—then DNS resolvers have cached the names of the name servers that were provided by your current DNS service provider. A DNS resolver that cached that information a few minutes ago will save it for almost two more days.

To ensure that migrating DNS service to Route 53 happens all at one time, wait for two days after you lowered the TTL. After the two-day TTL expires and resolvers request the name servers for your domain, the resolvers will get the current name servers and will also get the new TTL that you specified in Step 4: Lower TTL Settings.

Step 6: Update the NS Record with Your Current DNS Service Provider to Use Route 53 Name Servers

To begin using Amazon Route 53 as the DNS service for a domain, update the NS record with the current DNS service provider for the domain. Perform the following procedure:

To update the NS record with your current DNS service provider to use Route 53 name servers

  1. In the Route 53 console, get the name servers for your hosted zone:

    1. Sign in to the AWS Management Console and open the Route 53 console at https://console.aws.amazon.com/route53/.

    2. In the navigation pane, choose Hosted zones.

    3. On the Hosted zones page, choose the radio button (not the name) for the applicable hosted zone.

    4. Make note of the four names listed for Name Servers.

  2. Use the method that is provided by the current DNS service for the domain to update the NS record for the hosted zone. The process depends on whether the current DNS service lets you delete name servers:

    If you can delete name servers
    • Make note of the names of the current name servers in the NS record for the hosted zone. If you need to revert to the current DNS configuration, these are the servers that you'll specify.

    • Delete the current name servers from the NS record.

    • Update the NS record with the names of all four of the Route 53 name servers that you got in step 1 of this procedure.

      Note

      When you're finished, the only name servers in the NS record will be the four Route 53 name servers.

    If you cannot delete name servers
    • Choose the option to use custom name servers.

    • Add all four Route 53 name servers that you got in step 1 of this procedure.

Step 7: Monitor Traffic for the Domain

Monitor traffic for the domain, including website or application traffic, and email:

Step 8: Update the Domain Registration to Use Amazon Route 53 Name Servers

When you're confident that migrating DNS service to Route 53 was successful, you can change the DNS service for your domain to Amazon Route 53. Perform the following procedure to update settings with the domain registrar.

To update the name servers for the domain

  1. In the Route 53 console, get the name servers for your Route 53 hosted zone:

    1. Open the Route 53 console at https://console.aws.amazon.com/route53/.

    2. In the navigation pane, choose Hosted zones.

    3. On the Hosted zones page, choose the radio button (not the name) for the applicable hosted zone.

    4. Make note of the four names listed for Name Servers.

  2. Use the method provided by the registrar for the domain to change the name servers for the domain to use the four Route 53 name servers that you got in step 1 of this procedure.

    If the domain is registered with Route 53, see Adding or Changing Name Servers and Glue Records for a Domain.

Step 9: Change the TTL for the NS Record Back to a Higher Value

In the Amazon Route 53 hosted zone for the domain, change the TTL for the NS record to a more typical value, for example, 172800 seconds (two days). This improves latency for your users because they don't have to wait as often for DNS resolvers to send a query for the name servers for your domain.

To change the TTL for the NS record in the Route 53 hosted zone

  1. Sign in to the AWS Management Console and open the Route 53 console at https://console.aws.amazon.com/route53/.

  2. Choose Hosted Zones in the navigation pane.

  3. Choose the name of the hosted zone.

  4. In the list of records for the hosted zone, choose the NS record.

  5. Change TTL (Seconds) to the number of seconds that you want DNS resolvers to cache the names of the name servers for your domain. We recommend a value of 172800 seconds.

  6. Choose Save Record Set.

Step 10: Transfer Domain Registration to Amazon Route 53

Now that you've transferred DNS service for a domain to Amazon Route 53, you can optionally transfer registration for the domain to Route 53. For more information, see Transferring Registration for a Domain to Amazon Route 53.