Skip to Content

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

The parts of a domain name in http://api.www.example.com.: the protocol http://, the subdomain api.www., the second-level domain example, the top-level domain .com and the root, the final dot; everything after the protocol is the fully qualified domain name The parts of a domain name in http://api.www.example.com.: the protocol http://, the subdomain api.www., the second-level domain example, the top-level domain .com and the root, the final dot; everything after the protocol is the fully qualified domain name

A domain name, read from right to left.
  • Root: the final dot, usually hidden. Every name hangs from it.
  • Top-level domain (TLD): .com, .org, .gov, .us, .in and so on.
  • Second-level domain (SLD): the registered name, such as example.com, amazon.com.
  • Subdomain: anything to the left, such as www. or api.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

How a name is resolved: the browser asks its local DNS resolver for example.com; the resolver asks a root name server, which points to the .com servers; the .com top-level domain server points to the authoritative servers for example.com; the authoritative server answers with the IP address 9.10.11.12, which the resolver caches and returns How a name is resolved: the browser asks its local DNS resolver for example.com; the resolver asks a root name server, which points to the .com servers; the .com top-level domain server points to the authoritative servers for example.com; the authoritative server answers with the IP address 9.10.11.12, which the resolver caches and returns

Three questions to find one address.

When a browser wants example.com:

  1. It asks the local DNS resolver, run by the user's company or ISP (or a public one).
  2. 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 .com name servers (an NS record).
  3. The resolver asks the TLD name server for .com (managed by IANA, part of ICANN): "Who knows about example.com?" It answers with the name servers for example.com.
  4. The resolver asks the authoritative name server for example.com (run by the domain's DNS service, such as Route 53). It answers: example.com is 9.10.11.12.
  5. 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:

AWS documentation

On this page

Open notes

Spotted a mistake?

These notes are open source. Suggest a fix, or star the repo if they helped you.

Suggest an edit

For AI agents: llms.txt · llms-full.txt