Unit 1 · How the web works
What DNS does when you type a web address
DNS turns a domain name into the IP address of the server that hosts it. The browser has to ask DNS first, because computers on the internet find each other by number, not by name.
The mix-up
What people often think
“The browser already knows where every website is.”
What the tutor says
Computers find each other by number, not by name. The browser asks DNS to turn cornerbakery.ca into a number before it can reach the server.
How do you call a friend when you only know their name?
How it works
When you type cornerbakery.ca/menu and press Enter, the browser does not know where cornerbakery.ca lives. It asks a DNS resolver, which answers with a number such as 76.76.21.21. Only then can the browser send its request to that server.
The order matters. Each step needs the answer from the one before: no address, no request; no request, no page. A domain cannot look itself up; DNS is the separate service that does it.
DNS answers are cached for a while, which makes the web fast but also explains why a DNS change can take time to reach everyone.
An example
1. Browser: where is cornerbakery.ca?
2. DNS: 76.76.21.21
3. Browser → 76.76.21.21: GET /menu
4. Server → Browser: 200 OK + the pageClose cousins of this mix-up
The tutor watches for these in the same lesson.
“The domain name looks up its server by itself.”
A name cannot look itself up. DNS is the separate service that matches the name to the server's number.
“The order of the stops does not matter as long as all are visited.”
Each stop needs the answer from the one before. The server cannot be reached until DNS has given its address.
Practise it with a tutor watching
The request journey
Trace a request from the address bar to a server and back.
Free with an account. The first two units need no account.