DNS basics
What DNS does, the parts of a domain name, the common terms, and how a name is resolved step by step.
What it is
Computers find each other by IP address, such as 172.217.18.36. People prefer names, such as www.google.com. The Domain Name System (DNS) translates the human-friendly names into the machine addresses.
DNS is the backbone of the internet: almost every connection starts with a DNS lookup. It uses a hierarchy of names, read from right to left: .com, then example.com, then www.example.com or api.example.com.
The parts of a name
- Root: the final dot, usually hidden. Every name hangs from it.
- Top-level domain (TLD):
.com,.org,.gov,.us,.inand so on. - Second-level domain (SLD): the registered name, such as
example.com,amazon.com. - Subdomain: anything to the left, such as
www.orapi.www.. - Fully qualified domain name (FQDN): the complete name down to the root, such as
api.www.example.com.. - The protocol (
http://) and path are part of the URL, not of the domain name.
DNS terms
- Domain registrar: the company a domain is bought (registered) from, such as Amazon Route 53 or GoDaddy.
- DNS records: entries that say what a name points to, such as A, AAAA, CNAME and NS records (see records).
- Zone file: the set of DNS records for a domain.
- Name server: a server that answers DNS queries. An authoritative name server holds the real records for a domain; a non-authoritative one (a resolver) answers from what it learned and cached.
How a name is resolved
When a browser wants example.com:
- It asks the local DNS resolver, run by the user's company or ISP (or a public one).
- If the resolver doesn't have the answer cached, it asks a root name server (managed by ICANN): "Who knows about
.com?" The root answers with the.comname servers (an NS record). - The resolver asks the TLD name server for
.com(managed by IANA, part of ICANN): "Who knows aboutexample.com?" It answers with the name servers forexample.com. - The resolver asks the authoritative name server for
example.com(run by the domain's DNS service, such as Route 53). It answers:example.comis9.10.11.12. - The resolver caches the answer for the record's TTL and returns it to the browser, which also caches it. The browser then connects to
9.10.11.12.
Because of caching, most lookups are answered in step 1 without asking anyone else.
Amazon Route 53
Route 53 is AWS's DNS service:
- a highly available, scalable, fully managed authoritative DNS: authoritative means the customer controls and can update the records;
- also a domain registrar;
- able to check the health of resources;
- the only AWS service with a 100% availability SLA.
The name comes from port 53, the traditional DNS port.
Exam tips
- "Authoritative DNS where you manage the records" → Route 53 hosted zone.
- "Changes to DNS take time to reach users" → resolvers cache answers for the TTL.
- "Which AWS service has a 100% availability SLA?" → Route 53.
Common traps
- "Route 53 is only a registrar." It's also the DNS service and does health checks.
- "A DNS change is seen by everyone instantly." Clients keep cached answers until the TTL expires.
Check yourself
DNS concepts are easiest to see from a terminal. In CloudShell (no cost), run dig example.com and dig +trace example.com; the second shows the root, .com and authoritative steps. Then try these:
TLD .com; second-level domain example.com; subdomain api.www.
Their resolvers cached the old answer and will keep it until the record's TTL runs out. Lowering the TTL before a planned change makes it take effect faster.
AWS documentation
DNS & Content Delivery
The global services that sit in front of an application, Route 53, CloudFront and Global Accelerator, and the map of this group.
Records and hosted zones
What a Route 53 record contains, the record types to know, public and private hosted zones, and how TTL trades freshness against cost.