Unit 4 · Networks · Lesson 4 of 10
DNS, HTTP versions and TLS
Builds on
Step 1: Learn the ideas
- Stub, recursive and authoritative DNS servers
- Record types (A, AAAA, CNAME, NS) and TTLs
- Negative caching and DNS-based failover
- HTTP semantics versus wire versions
- HTTP/1.1 persistent connections and pipelining limits
- HTTP/2 streams, binary framing and header compression
- HTTP/3 over QUIC
- TLS 1.3 handshake and certificate validation
- Session resumption and 0-RTT replay risk
- Connection pooling and keep-alive
Why it matters
Explaining what happens when you load a URL exercises every layer at once. In real systems the same pieces cause incidents: a DNS change that takes hours to take effect because of a long TTL, an expired certificate, a client that opens a new TLS connection per request and burns CPU and round trips, or a proxy that silently downgrades HTTP/2 to HTTP/1.1.
Core ideas
DNS resolution. An application asks the stub resolver in the OS, which asks a recursive resolver (ISP, corporate or public). With an empty cache, the recursive resolver walks the hierarchy: a root server refers it to the top-level-domain servers, which refer it to the domain's authoritative servers, which return the records (A and AAAA for addresses, CNAME for aliases, NS for delegation, plus MX, TXT and others). Every record carries a TTL and is cached at each level, and negative answers such as NXDOMAIN are cached too. Consequences: lowering a TTL helps only after the old, longer TTL has expired everywhere; some clients and runtimes cache longer than the TTL; DNS-based failover is never instant. DNS mostly runs over UDP port 53 and falls back to TCP for large answers; DNS over TLS or HTTPS changes who can observe the queries.
HTTP versions. Semantics (methods, status codes, headers, caching rules) are shared across versions; the wire format differs. HTTP/1.1 sends text messages one at a time per connection. Persistent connections (keep-alive) avoid a new handshake per request, but a slow response blocks the next one on that connection, so browsers open several connections per origin. HTTP/2 multiplexes many concurrent streams over one TCP connection with binary framing and header compression; that removes blocking between requests at the HTTP layer, but one lost TCP segment still stalls every stream. HTTP/3 maps HTTP onto QUIC over UDP, where streams are independent in the transport and the transport and TLS handshakes are combined.
TLS 1.3. The client sends a ClientHello with supported versions, cipher suites and a key share. The server answers with a ServerHello and its key share, and everything after that is encrypted: its certificate, a CertificateVerify signature proving it holds the private key, and Finished. The client validates the certificate chain up to a trusted root and checks that the certificate covers the requested name. A full handshake adds one round trip on top of TCP's. Resumption with a pre-shared key skips certificate work, and 0-RTT lets the client send data in its first flight, at the price of possible replay, so only idempotent requests should use it. TLS 1.3 removed static RSA key exchange, so every full handshake provides forward secrecy.
Connection reuse. A new HTTPS connection over TCP costs a DNS lookup, one round trip for TCP and one for TLS 1.3 before the request can leave; on a path with a 100 ms RTT, that is about 200 ms plus DNS time before the first request byte is even sent. Connection pools and keep-alive amortize this, and HTTP/2 lets one connection carry many concurrent requests. Pool sizes, idle timeouts and load-balancer behavior then determine tail latency and correctness.
Common misconceptions
- "DNS changes propagate." Nothing is pushed: caches expire on their own TTLs, and some clients ignore TTLs.
- "HTTP/2 eliminates head-of-line blocking." It removes blocking between requests at the HTTP layer; TCP loss still blocks every stream on the connection.
- "TLS hides which site I am visiting." The server name in the ClientHello is visible unless Encrypted Client Hello is used, and DNS queries may reveal it too.
- "0-RTT is a free speedup." Early data can be replayed by an attacker, so servers restrict it to idempotent requests or add anti-replay measures.
- "HTTP/3 is HTTP/2 over UDP." It relies on QUIC for streams, loss recovery, encryption and connection migration, and uses its own header compression (QPACK).
How to approach it
Narrate a cold HTTPS request with a round-trip budget, then explain which round trips disappear with caching, keep-alive, TLS resumption and HTTP/3. Use dig +trace and curl -v to see real exchanges. Mid and senior questions cover DNS-based failover and TTL tradeoffs, certificate rotation, connection pooling under load, and when HTTP/2 multiplexing helps or hurts.
Suggested order
- 1Read Computer Networks: A Systems Approach Section 9.3 (Infrastructure Applications) on name service, then run dig +trace for a domain you use and match each step to the hierarchy.
- 2Read the High Performance Browser Networking chapters "HTTP/1.X" and "HTTP/2" for connection management and multiplexing; remember that the book predates HTTP/3.
- 3Read the MDN guide "Evolution of HTTP" for a version-by-version overview through HTTP/3.
- 4Read RFC 8446 Section 2 (Protocol Overview) and draw the full handshake, resumption and 0-RTT flows.
- 5Walk through The Illustrated TLS 1.3 Connection next to your own capture from the HTTPS packet-trace project.
- 6Use the request-timing project to compare a cold request with requests on a reused connection.
Step 2: Check off what you can do
Tap each one you can genuinely do or explain. Each earns 10 XP.
Step 3: Go deeper
Computer Networks: A Systems ApproachStart here
Systems Approach (open online edition)Section: 9.3 Infrastructure Applications
Main reading on DNS: name hierarchy, resolution and caching.
Open(opens in a new tab)Link responded, 5 Oct 2026High Performance Browser NetworkingStart here
O'Reilly (free online edition)Section: HTTP/1.X
Keep-alive, pipelining and connection limits, then the HTTP/2 chapter for multiplexing; predates TLS 1.3 and HTTP/3.
Open(opens in a new tab)Link responded, 5 Oct 2026RFC 8446: The Transport Layer Security (TLS) Protocol Version 1.3
IETF (RFC Editor)Section: Section 2: Protocol Overview
Authoritative overview of the TLS 1.3 full handshake, resumption and 0-RTT.
Open(opens in a new tab)Not checkable automatically, 5 Oct 2026The Illustrated TLS 1.3 Connection: Every Byte Explained
xargs.org (author site)Byte-by-byte walkthrough of a real TLS 1.3 handshake to compare with your own capture.
Open(opens in a new tab)Link responded, 5 Oct 2026MDN Web Docs: HTTP guides
MDN Web Docs (Mozilla)Section: Evolution of HTTP
Short overview of how HTTP changed from 1.1 to HTTP/2 and HTTP/3.
Open(opens in a new tab)Link responded, 5 Oct 2026
Step 4: Practice
For the packet-trace project, set SSLKEYLOGFILE so Wireshark can decrypt the session, then label the DNS query and answer, the TCP handshake, ClientHello, ServerHello, the encrypted handshake messages and the first HTTP request. For the timing project, compare curl -w timings for a cold request and for two URLs fetched by one curl command (which reuses the connection). Finish by explaining the round trips you observed, without notes, in under three minutes.
- Capture and annotate one HTTPS request end to end (DNS, TCP, TLS 1.3, HTTP)Open(opens in a new tab)Not attemptedHands-on project (Wireshark User's Guide as reference)
- Decompose request latency with dig and curl timingOpen(opens in a new tab)Not attemptedHands-on project (Everything curl as reference)
Record attempts on each problem’s page (+15 XP, +10 more when solved on your own).
Step 5: Test yourself
Answer each one out loud or on paper before you finish the lesson.
- Question 1What is the difference between a recursive resolver and an authoritative server?
- Question 2A record had a TTL of 86400 seconds and you lower it to 60 now. When can you rely on clients seeing a change?
- Question 3Which TLS 1.3 handshake messages can a passive observer read?
- Question 4Why should 0-RTT data be limited to idempotent requests?
- Question 5Why did browsers open several HTTP/1.1 connections per origin, and why does HTTP/2 prefer one?
- Question 6How many round trips does a cold HTTPS request over TCP need before the server sees the request?
- Question 7What does HTTP/3 change about head-of-line blocking compared with HTTP/2?
You’re done when you can
- Narrate a cold HTTPS request from DNS lookup to first response byte with a round-trip budget, in under three minutes.
- Annotate a captured TLS 1.3 handshake and identify which messages are encrypted.
- Explain why lowering a DNS TTL just before a migration may not be enough.
- Compare head-of-line blocking in HTTP/1.1, HTTP/2 and HTTP/3 in two sentences each.
Finish the lesson
Unlocks next: Proxies, load balancing and CDNs, Head-of-line blocking, QUIC and HTTP/3, Network troubleshooting and measurement


