How internet traffic is routed to your website in Lightsail - Amazon Lightsail

How internet traffic is routed to your website in Lightsail

All computers on the internet, including smart phones, laptops, and website servers, communicate with one another by using unique strings of characters. These strings, known as IP addresses, are in one of the following formats:

  • Internet Protocol version 4 (IPv4) format, such as

  • Internet Protocol version 6 (IPv6) format, such as 2001:DB8::/32

When you open a browser and go to a website, you don't have to remember and enter a long string of characters like that. Instead, you can enter a domain name like and still end up in the right place. This is achieved through the Domain Name System (DNS), which functions as a directory that maps registered domain names to IP addresses.


Overview of how you configure Lightsail to route internet traffic for your domain

This overview explains how to use Lightsail to register and configure a domain that routes internet traffic to your website or web application.

  1. Register your domain name. For an overview, see Domain registration.

  2. After you register your domain name, Lightsail automatically creates a DNS zone that has the same name as the domain.

  3. The Lightsail console allows you to easily assign a domain to a Lightsail resource, such as an instance or load balancer. You can also create DNS records in your DNS zone to route traffic to your resources. Each record includes information about how you want to route traffic for your domain, such as the following:


    The name of the record corresponds with the domain name ( or subdomain name (, The name of every record in a DNS zone must end with the name of the DNS zone. For example, if the name of the DNS zone is, all record names must end in


    The record type usually depends on the type of resource that you want traffic to be routed to. For example, to route traffic to an email server, you specify MX for Type. To route traffic for your domain name to your Lightsail instance, you add an A record that points your domain name to the static IPv4 address of your instance, or a AAAA record that points to the IPv6 address of your instance.

  4. Target

    The target is where you want traffic to be routed to. You can create alias records that route traffic to Lightsail instances, Lightsail container services, and other Lightsail resources. For more information, see DNS.

How traffic is routed for your domain

After you configure Lightsail to route your internet traffic to your resources, such as instances, load balancers, distributions, or container services, here’s what happens when someone requests content for

  1. A user opens a web browser, enters in the address bar, and presses Enter.

  2. The request for is routed to a DNS resolver, which is typically managed by the user's internet service provider (ISP). ISPs can be cable internet providers, DSL broadband providers, or corporate networks.

  3. The DNS resolver for the ISP forwards the request for to a DNS root name server.

  4. The DNS resolver forwards the request for again, this time to one of the TLD name servers for .com domains. The name server for .com domains responds to the request with the names of the four name servers that are associated with the domain.

    The DNS resolver caches (stores) the four name servers. The next time someone browses to, the resolver skips steps 3 and 4 because it already has the name servers for The name servers are typically cached for two days.

  5. The DNS resolver chooses a name server and forwards the request for to that name server.

  6. The name server looks in the DNS zone for the record and gets the associated value, such as the IP address for a web server ( Then, the name server returns the IP address to the DNS resolver.

  7. The DNS resolver finally has the IP address that the user needs. The resolver returns that value to the web browser.

  8. The web browser sends a request for to the IP address that it got from the DNS resolver. This is where your content is, for example, a web server running on an Lightsail instance or container service that's configured as a website endpoint.

  9. The web server or other resource at returns the web-page for to the web browser, and the web browser displays the page.

Next steps