The application layer (DNS/HTTP) - look up a name, then talk
People use names, not IP addresses. DNS, the distributed system that turns names into addresses, and HTTP, the language the web speaks over them.
Recap
Through part four, the delivery problem is settled. IP finds the way to the host, and TCP delivers to the process in order and without gaps. On top of the reliable channel the lower layers have built, an application can now concentrate purely on content.
This part has two questions. How does a human-readable name become an address? And what does the web actually say over it?
DNS: from name to address
People remember www.example.com, not 93.184.216.34. The system that turns names into IP addresses is DNS (Domain Name System).
Hierarchical names, distributed administration
No single server can administer every domain in the world. DNS designed the names themselves as a hierarchy. www.example.com. reads from the right: root (.) → top-level domain (com) → example.com → www, and each level delegates only the administration of the level beneath it. It is the layering of part one applied to a namespace rather than to communication.
The resolution process
A host does not search the whole world itself. The question is usually delegated to a recursive resolver run by an ISP or a company.
browser -> resolver: "what's the address of www.example.com?"
resolver -> root server: "...?" -> "ask over there about com"
resolver -> com server: "...?" -> "example.com is over there"
resolver -> example.com nameserver: "...?" -> "93.184.216.34"
resolver -> browser: "93.184.216.34"
Repeating that journey every time would be slow, so there is a cache at every stage. Each answer carries a TTL (Time To Live), and for that duration the resolver, the operating system, and the browser reuse the stored answer.
DNS lookups normally use UDP port 53. It is a short exchange — one question, one answer — so, as part four explained, the cost of establishing a TCP connection is not worth paying.
HTTP: the language of the web
Now that we have the address, it is time to talk. HTTP (HyperText Transfer Protocol) is the web’s request-response protocol, running over TCP. The structure is simple — the client sends a request and the server responds — and the messages are human-readable text.
Request Response
GET /index.html HTTP/1.1 HTTP/1.1 200 OK
Host: www.example.com Content-Type: text/html
Accept: text/html Content-Length: 1256
<!doctype html> ...
The method states the action: GET to retrieve, POST to submit, PUT to replace, DELETE to remove. The status code summarises the result: 2xx is success, 3xx is a redirect, 4xx is the client’s fault (404 Not Found), 5xx is the server’s fault (500 Internal Server Error).
Statelessness and cookies
HTTP is a stateless protocol. The server handles each request independently and does not remember the previous one. That makes scaling easy: you can add more servers and it does not matter which one answers.
But some features, such as logging in, do need state. For those the server sends a cookie in its response, and the browser attaches that cookie to every subsequent request. Instead of the server remembering the state, the client presents it every time — the standard way of layering state onto a stateless protocol.
Today’s web does not expose HTTP directly; it uses HTTPS (port 443), encrypted with TLS, by default. How the encryption layer works is beyond the scope of this series.
Summary
| DNS | HTTP | |
|---|---|---|
| Role | name → IP address | requesting and responding with web resources |
| Transport | mostly UDP 53 | TCP 80 (443 for HTTPS) |
| Structure | hierarchical delegation + caching (TTL) | request-response, stateless |
| State handling | - | supplemented with cookies |
The core point is this.
The application layer deals only with content, over the channel the layers below have built. DNS turns a name into an address, and HTTP talks to that address.
Coming up next
All the pieces are now in place. The final part traces the whole series as a single flow: from the moment you type a URL and press Enter to the moment the page appears on screen.