Chapter 9: Domain Names, DNS and Subdomains
9.2 How DNS resolution works
- The browser checks its own cache, then the OS cache and the
hostsfile. - 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). - The resolver asks a root server → "ask the
.comservers". - The
.comTLD server → "the name servers forexample.comarens51.domaincontrol.com...". These NS entries come from what you set at the registrar. - The authoritative name server replies with the record, e.g.
A 13.233.10.25, along with a TTL. - 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.