Ravindra BagaleCourses & study guides

Chapter 9: Domain Names, DNS and Subdomains

9.2 How DNS resolution works

  1. The browser checks its own cache, then the OS cache and the hosts file.
  2. If not found, it asks the recursive resolver (your ISP, a public resolver like 8.8.8.8 / 1.1.1.1, or on EC2 the VPC resolver).
  3. The resolver asks a root server → "ask the .com servers".
  4. The .com TLD server → "the name servers for example.com are ns51.domaincontrol.com...". These NS entries come from what you set at the registrar.
  5. The authoritative name server replies with the record, e.g. A 13.233.10.25, along with a TTL.
  6. The resolver caches the answer for TTL seconds and gives it to the browser, which then connects to the IP and sends Host: example.com.

DNS normally uses UDP port 53 (TCP 53 for large answers and zone transfers). See also section 2.4 on opening a website step by step.