‹ Return to How tos

Creating a DNS zone to manage your domain’s DNS records in Amazon Lightsail

Last updated: September 21, 2018

To map your domain name, such as example.com, to your Amazon Lightsail instance, you add a record to the Domain Name System (DNS) of your domain. You can manage domain DNS records at the registrar where the domain name was registered, or manage them separately using another DNS hosting provider, such as Lightsail.

We recommend that you transfer management of your domain's DNS records to Lightsail. This allows you to efficiently administer all of your instance resources in one place—the Lightsail console. This topic shows you how to create a DNS zone in the Lightsail console so that you can transfer management of your domain’s DNS records to Lightsail.

Note

You continue to manage renewals and billing for your domain at your domain registrar, even after transferring management of your domain's DNS records to Lightsail.

Transferring management of your domain's DNS records to Lightsail requires specific prerequisites and the following steps:

  1. Create a DNS zone in the Lightsail console

  2. Add records to the DNS zone

  3. Change the name servers at your domain’s current DNS hosting provider

Prerequisites

Before you create a DNS zone in Lightsail:

  1. Register a domain name. Then confirm that you have administrative access to edit your domain's name servers.

    Note

    If you need a registered domain name, get one through a domain registrar, such as Amazon Route 53. For more information, see Registering a New Domain in the Amazon Route 53 documentation.

  2. Confirm that the necessary DNS record types for your domain are supported by the DNS zone in Lightsail. The DNS zone currently supports these records: address (A), canonical name (CNAME), mail exchanger (MX), name server (NS), service locator (SRV), and text (TXT). For NS records, you can use wildcard DNS record entries.

    Note

    If the DNS record types required for your domain are not supported by the DNS zone in Lightsail, then you may want to use Amazon Route 53 as your DNS hosting provider. For more information, see Supported DNS Record Types and Making Amazon Route 53 the DNS Service for an Existing Domain.

  3. Create a Lightsail instance to which you will point your domain. For more information, see Create an Amazon Lightsail instance.

  4. Create a static IP and attach it to your Lightsail instance. For more information, see Create a static IP and attach it to an instance in Amazon Lightsail.

Step 1: Create a DNS zone in the Lightsail console

To create a DNS zone in Lightsail, specify the domain name that the DNS zone applies to.

    To create a DNS zone

  1. Sign in to the Lightsail console.

  2. Choose the Networking tab, and then choose Create DNS zone.

  3. Enter your registered domain name, such as example.com, into the text box.

    Note

    It isn’t necessary to include www when entering your domain name. You can add the www using an address (A) record as part of the Step 2: Add records to the DNS zone section later in this guide.

  4. Choose one of the following options to add tags to your DNS zone:

    1. Add key-only tags or Edit key-only tags (if tags have already been added). Enter your new tag into the tag key text box, and press Enter. Choose Save when you’re done entering your tags, or choose Cancel to not add them.

      Key-only tags in the Lightsail console.
    2. Create a key-value tag, then enter a key into the Key text box, and a value into the Value text box. Choose Save when you’re done entering the tag, or choose Cancel to not add the tag.

      Key-value tags can only be added one at a time. To add more than one key-value tag, repeat the previous steps.

      Key-value tags in the Lightsail console.

    Note

    For more information about key-only and key-value tags, see Tags in Amazon Lightsail.

  5. Choose Create DNS zone.

    On the DNS zone management page, add DNS records or delete the DNS zone. Note the Lightsail name servers that are listed on this page; you need these later in this guide.

    The DNS zone management page in the Lightsail console.

Step 2: Add records to the DNS zone

Add records to your domain’s DNS zone to specify how you want internet traffic routed. For example, you could route traffic for the apex of your domain, such as example.com, to one instance, while routing traffic for a subdomain, such as blog.example.com, to another instance.

    To add records to the DNS zone

  1. On the DNS zone management page, choose Add record.

  2. Choose one of the following record types:

    Note

    Time to live (TTL) for DNS records cannot be configured in the Lightsail DNS zone. Instead, all Lightsail DNS records default to a TTL of 60 seconds. For more information, see Time to live on Wikipedia.

    Address (A) record

  3. An A record maps a domain, such as example.com, or a subdomain, such as blog.example.com, to a web server’s IP address.

    1. In the Subdomain text box, enter the target subdomain for the record, or enter an @ symbol to define the apex of your domain.

    2. In the Resolves to text box, enter the target IP address for the record, select your running instance, or configured load balancer. When you select a running instance, the public IP address of that instance is automatically added.

      Note

      We recommend that you attach a static IP to your Lightsail instance before pointing your domain to that instance. For more information, see Create a static IP in Amazon Lightsail.

  4. Canonical name (CNAME) record

  5. A CNAME record maps an alias or subdomain, such as blog.example.com, to another domain or subdomain.

    1. In the Subdomain text box, enter the subdomain for the record.

    2. In the Maps to text box, enter the target domain or subdomain for the record.

  6. Mail exchanger (MX) record

  7. An MX record maps a subdomain, such as mail.example.com, to an email server address with values for priority when multiple servers are defined.

    1. In the Subdomain text box, enter the subdomain for the record.

    2. In the Priority text box, enter the priority for the record. This is important when adding records for multiple servers.

    3. In the Maps to text box, enter the target domain or subdomain for the record.

  8. Service locator (SRV) record

  9. An SRV record maps a subdomain, such as service.example.com, to a service address with values for priority, weight, and port number. Telephony or instant messaging are a couple of the services typically associated with SRV records.

    1. In the Subdomain text box, enter the subdomain for the record.

    2. In the Priority text box, enter the priority for the record.

    3. In the Weight text box, enter a relative weight for SRV records with the same priority.

    4. In the Port text box, enter the port number in which a connection to the service can be made.

  10. Text (TXT) record

  11. A TXT record maps a subdomain to plain text. You create TXT records to confirm ownership of your domain to a service provider.

    1. In the Subdomain text box, enter the subdomain for the record.

    2. In the Responds with text box, enter the text response that is given when the subdomain is queried.

  12. When you're done adding the record, choose the Save icon to save your changes.

    The record is added to the DNS zone. Repeat the above steps to add multiple records to your domain's DNS zone.

Step 3: Change the name servers at your domain’s current DNS hosting provider

To transfer management of your domain's DNS records to Lightsail, sign in to the website of your domain’s current DNS hosting provider. Then change your domain’s name servers to the Lightsail name servers.

For detailed steps for completing this process, see the documentation from your domain’s current DNS hosting provider. The following steps are provided only for general guidance.

Important

If web traffic is currently being routed to your domain, make sure that all of the existing DNS records are present in the Lightsail DNS zone before changing the name servers at your domain’s current DNS hosting provider. This way, traffic continually flows uninterrupted after the transfer to the Lightsail DNS zone.

    To change the name servers at your domain’s current DNS hosting provider

  1. Write down the Lightsail name servers that are listed in on your domain's DNS zone management page.

    The DNS zone name servers in the Lightsail console.
  2. Sign in to your domain’s current DNS hosting provider’s website.

  3. Find the page where you can edit your domain's name servers.

    Note

    For more information about locating this page, see the documentation from your domain’s current DNS hosting provider.

  4. Enter the Lightsail name servers, and remove other name servers listed.

  5. Save your changes.

    Note

    Allow time for the name server change to propagate through the internet's DNS, which may take several hours.

Next steps