Himanshu SharmaSoftware engineer
Let’s talk

How the Web Works · Lesson 15 of 15

Project: trace one web request with DevTools, dig and curl

A guided project that follows one request to example.com from URL to rendered page using only browser DevTools, dig, curl and openssl, and records the findings.

40 minPracticeUpdated 14 November 2026

Awaiting technical review. This lesson is readable but not yet listed in search engines.

By the end of this lessonTrace one real request through URL, DNS, connection, TLS, HTTP, caching and rendering using free tools, and write a short report that explains each step with evidence.

This project ties the whole course together. You will pick one request, trace it from the address you type to the pixels on screen, and gather proof at each step with tools you already have: a browser, dig, curl and openssl. You do not need to install anything beyond what comes with most computers. On Windows, nslookup replaces dig, and curl is included in current versions.

Ground rules

Use https://example.com/. It is a domain reserved for documentation, so it is meant to be probed this way. Alternatively use a site you own. Run only the read-only commands below, keep to a handful of requests, and never share captured cookies or tokens. If a command is not installed or the network is down, write what you expected to see and mark it clearly as expected, not observed.

Create a note, in any text editor, with these seven headings and fill it in as you go: URL, DNS, Connection, TLS, HTTP, Caching, Rendering.

Stage 1: the URL

Write the address you will request and split it into its parts, using URLs explained: scheme, host, port (the default for the scheme if none is written), path, query and fragment. For https://example.com/ the scheme is https, the host is example.com, the port is the default 443, and the path is /. Note which parts are sent to the server and which are not. The fragment, for example, stays in the browser.

Stage 2: DNS

Ask the DNS for the host's addresses, as in DNS:

text
dig example.com A
dig example.com AAAA
dig example.com NS

Example output captured on 2026-11, trimmed to the answer lines; yours will differ (addresses, TTLs and name servers can change, and different networks get different answers):

text
example.com.   288   IN   A      172.66.147.243
example.com.   288   IN   A      104.20.23.154
example.com.    45   IN   AAAA   2606:4700:90d5:72db:f29e:47e:ef6b:ff98
elliott.ns.cloudflare.com.
hera.ns.cloudflare.com.

Record: how many addresses, which record types, what the TTL is and what it means (how long a resolver may keep the answer), and which name servers are authoritative for the zone. Run dig example.com A twice. The TTL on the second answer is often lower, because your resolver is counting down a cached answer, which is caching in action. Note the resolver's own response time from the Query time line.

Stage 3: the connection

Now find which address your computer actually used, and how long each stage took. curl can print a timing summary:

text
curl -s -o /dev/null -w "dns=%{time_namelookup} connect=%{time_connect} tls=%{time_appconnect} firstbyte=%{time_starttransfer} total=%{time_total} ip=%{remote_ip} http=%{http_version}\n" https://example.com/

Example output captured on 2026-11; yours will differ (every run, location and network gives different timings):

text
dns=0.002780 connect=0.018297 tls=0.041687 firstbyte=0.152182 total=0.152355 ip=2606:4700:90d5:72db:f29e:4d5:ef6b:ff98 http=2

These are seconds since the start. The time between dns and connect is the TCP connection, between connect and tls the handshake, and between tls and firstbyte the wait for the server. This run was on an IPv6 address, and one of the AAAA answers above is similar but not identical, because the answer set can vary. Look at your own numbers and say which stage took longest. Remember from IP addresses and ports that the port used here is 443.

Stage 4: TLS

Look at the certificate and the negotiated protocol, following HTTPS and TLS:

text
openssl s_client -connect example.com:443 -servername example.com

Example output captured on 2026-11, trimmed (the issuer chain, dates and cipher can differ):

text
Certificate chain
 0 s:CN=example.com
   i:C=US, O=SSL Corporation, CN=Cloudflare TLS Issuing ECC CA 3
   v:NotBefore: Sep 26 22:49:11 2026 GMT; NotAfter: Dec 25 22:56:35 2026 GMT
Protocol: TLSv1.3
Verification: OK

Record the subject, the issuer, when the certificate expires, the TLS version and whether verification succeeded. Then say in a sentence what this proves (the server holds a certificate for this name that chains to a trusted root, and the connection is private) and one thing it does not prove.

Stage 5: HTTP

Make the request visible with verbose mode. Lines starting with > are what curl sent, and lines starting with < are what the server returned:

text
curl -sv -o /dev/null https://example.com/

Example output captured on 2026-11, trimmed to the request and response lines; yours will differ (date, headers and server name):

text
> GET / HTTP/2
> Host: example.com
> User-Agent: curl/8.7.1
> Accept: */*
< HTTP/2 200
< date: Sat, 14 Nov 2026 21:37:48 GMT
< content-type: text/html; charset=utf-8
< server: cloudflare
< last-modified: Thu, 12 Nov 2026 21:56:22 GMT
< age: 813
< cf-cache-status: HIT

Record the method, the path, the Host header, the status code with its meaning from methods and status codes, and the content type. Add two response headers you find interesting and what each does, using headers and cookies. Then try a second request on the plain-HTTP address, curl -sI http://example.com/, and note whether it redirected or answered directly. On the day of capture it answered 200 without redirecting, but you should write what you see.

Stage 6: caching

Use the headers above, plus what you know from caching and CDNs. Answer: Does the response include Cache-Control or an ETag? Is there an Age header, which would suggest that a shared cache answered? Which header names look specific to the provider rather than the web standard? Then, if you want a response you fully control, run the small server from the caching lesson and repeat the request with If-None-Match to get a 304, and compare.

Stage 7: rendering in the browser

Finally, do the same in the browser, as in watching requests in the Network tab:

  1. Open DevTools, go to the Network tab and tick Preserve log.
  2. Load https://example.com/.
  3. Click the document row. Compare its status, headers and protocol with your curl results. Differences are expected in some headers, such as accept and user-agent, because the browser sends its own.
  4. Check the Timing tab and compare the phases with your curl figures. Do not expect identical numbers.
  5. List every request the page made. For a tiny page this may be just the HTML and the icon. For each other request, find what caused it.
  6. Switch to the Elements panel and find the DOM tree. Match it with the page source. Use how browsers turn code into a page to name the steps between the document's bytes and what you see.

Write the report

Make it a page of plain text, no more. For each of the seven stages, include the exact command or action, a trimmed copy of the output labelled with the date, and two or three sentences that explain it in your own words. Finish with answers to three questions: Which step was the slowest in your run? Which header or record surprised you? What would change if the site were behind a different CDN or used a different registrar?

A strong report separates observed facts (what your command printed) from explanations (what you believe caused it), and says plainly where it is guessing. If you publish it, redact IP addresses of your own networks and any tokens first.

Common mistakes

  • Pasting sample output from this lesson as if it were your own.
  • Running the commands against a site you do not own or have permission to test.
  • Recording times from a single run and calling them typical.
  • Forgetting to explain what each result means, so the report is only a pile of output.
  • Sharing cookies, tokens or a full HAR export.
  • Mixing up the DNS TTL with how long the page itself is cached.

Exercise

Repeat the whole trace for a second target and compare. Choose https://example.org/ or a small site you own. Produce one table with the two sites in columns, and rows for number of addresses, TLS version, certificate issuer, HTTP version, status code and caching headers. Write three sentences about the biggest difference.

Show one possible answer

A good answer has a table of observed values, for example whether each site returns IPv6 records, which certificate authority issued each certificate, whether either shows an age header, and which side redirects http to https. The three sentences should name a difference, such as different name servers or issuers, and say what it implies in terms of hosting, without guessing at things the output does not show.

When you can explain every line of your own report, you understand how a request travels the web.

Key points

  • The project follows one request to example.com through seven stages, using evidence from dig, curl, openssl and the browser Network tab.
  • Every stage maps to a lesson in this course, so each finding checks your understanding of one idea.
  • The output you capture will differ from the samples, because addresses, dates, servers and timings change; what matters is that you can explain yours.
  • A good report is short, shows the real commands and output, and says what each piece of evidence proves and what it does not.
  • Only test example.com or sites you own, and never include cookies or tokens when you share your results.

Check yourself

1. Which tool shows the address that a domain name currently resolves to?
2. In the curl timing figures, why is the TLS time larger than the connect time?
3. You find that curl and the browser show the same status and headers for a request. What can you conclude?
4. What should you remove before sharing a copied request or HAR file from a site where you are logged in?

Final exam and certificate

Finish all 15 lessons to unlock a 15-question exam on How the Web Works. Pass it and you get a certificate with a public link you can share.

Sign in to take the exam