Tech & AI

What Happens When You Type a URL

What Happens When You Type a URL

Between pressing Enter and seeing a page, about eight things happen in under a second. Understanding them explains most of the internet problems you will ever debug.

πŸ“š
Recommended reading: the ideas here are covered in depth in Designing Data-Intensive Applications. Check the book β†’

You type an address, press Enter, and a page appears. The gap between those two events is about half a second and involves at least six separate systems, any of which can fail independently.

Knowing the sequence is what turns a vague sense that the internet is broken into a specific diagnosis.

Step one: the name means nothing to the network

Computers do not route traffic by name. They route by number β€” an IP address. So the first task is translation: turning the name you typed into a number.

That is DNS, the domain name system, and it is best understood as a distributed phone book. Your computer asks a resolver, the resolver asks higher authorities, and the answer comes back as an address.

This is why a site can be "down" while its server is perfectly healthy. If DNS is broken, you never reach the server at all.

Step two: the connection

With an address in hand, your computer opens a connection to that machine. For a normal website this is TCP, which handles the unglamorous work of getting bytes across the network in order and without gaps.

Then TLS layers encryption on top, which is the padlock in the address bar. TLS also verifies that the server is who it claims to be, using a certificate signed by an authority your browser already trusts.

A certificate error is therefore a statement about identity, not about the content. The browser is saying it could not confirm who it is talking to.

Step three: the request

Now the browser sends an HTTP request. In its simplest form it names three things: a method β€” usually GET for reading β€” a path such as /library.html, and a header block containing cookies, the browser version, and what formats it will accept.

The method matters. GET asks for something and should not change anything. POST submits data. A site that changes data on a GET request is a site that will eventually break, because browsers and crawlers retry GETs freely.

Step four: the server decides

On the other end, a server receives the request and produces a response. It might read a file, query a database, run application code, or forward the request somewhere else.

The status code it returns is the single most useful diagnostic in web debugging:

  • 200 β€” fine, here is the content.
  • 301 or 302 β€” it moved, follow this other address.
  • 404 β€” nothing here at this address.
  • 500 β€” the server broke while handling your request.

The difference between 404 and 500 is the difference between "you asked for the wrong thing" and "we failed to answer correctly", and knowing which one you have halves the work.

Step five: the response body

For a normal page the body is HTML: the structure of the document, plus links to CSS for appearance and JavaScript for behaviour.

The browser parses the HTML, discovers the CSS and JavaScript references, and requests those too. This is why one page load produces dozens of requests in the developer tools β€” and why a single slow external script can delay a page that otherwise arrived instantly.

Step six: rendering

The browser builds a model of the page, calculates the position and size of everything, and paints it to the screen. JavaScript can then modify the page after it is drawn, which is how modern sites update without a full reload.

A page that looks blank and then fills in is doing exactly this. A page that never appears at all failed somewhere before this step.

Step seven: caching, which is everywhere

Almost every step so far has a cache. Your browser caches DNS answers and files. Your network caches DNS. The server caches responses. Content delivery networks cache copies of pages close to you geographically.

This is why "it works on my machine" and "it is broken for the client" can both be true, and why a hard refresh or a cache clear is such a common fix.

When something works for some people and not others, suspect caching before you suspect the code.

Step eight: the browser asks again, quietly

Many requests you did not make. The browser requests a favicon, analytics scripts fire, and browsers increasingly pre-resolve DNS for links you might click.

This is also how most tracking works: third-party requests that go to a different domain than the one in the address bar.

The bottom line

DNS resolves the name, TCP and TLS open a secure connection, HTTP carries the request, the server produces a status code and a body, and the browser renders it. Eight steps, and each one fails in a recognisable way. Learning to tell them apart is what makes you able to debug a website instead of guessing β€” and Designing Data-Intensive Applications is where the server side of this story continues.

πŸ“š Recommended reading

Print editions of books covered on this site that go deeper into this topic.

See all 10 books ranked in β€œBest Programming Books for Developers” β†’

Related articles

Practical Prompt Engineering for AI Tools

Practical Prompt Engineering for AI Tools

Better prompts are less about magic words and more about clear thinking. Here are the habits that reliably get more useful answers from AI tools.

πŸ“ Tech & AI πŸ—“ September 30, 2026 ⏱ 8 min read
Using ChatGPT at Work Without Losing Your Edge

Using ChatGPT at Work Without Losing Your Edge

AI assistants can save real hours each week β€” if you use them for the right tasks. A practical guide to weaving them into everyday work.

πŸ“ Tech & AI πŸ—“ October 1, 2026 ⏱ 8 min read
Cybersecurity Basics: Protecting Your Accounts and Devices

Cybersecurity Basics: Protecting Your Accounts and Devices

Most breaches do not start with brilliant hackers. They start with a reused password, an ignored update, or a link that should not have been clicked. Here is how to close those gaps.

πŸ“ Tech & AI πŸ—“ October 2, 2026 ⏱ 8 min read

Suggested summaries

Tech & AI The Innovator's Dilemma book cover

The Innovator's Dilemma

Clayton M. Christensen Β· 1997
β˜…β˜…β˜…β˜…β―¨ 4.5

Why do well-managed companies lose to small entrants with worse products? Christensen's answer is that the same decisions that make them successful are the problem.

Tech & AI
Tech & AI Homo Deus book cover

Homo Deus

Yuval Noah Harari Β· 2016
β˜…β˜…β˜…β˜…β―¨ 4.5

Harari looks past famine, plague and war to ask what humanity will chase next: immortality, engineered happiness and god-like power over life itself.

Tech & AI
Tech & AI Life 3.0 book cover

Life 3.0

Max Tegmark Β· 2017
β˜…β˜…β˜…β˜…β―¨ 4.5

Max Tegmark maps the choices ahead for artificial intelligence β€” utopia, catastrophe or something in between β€” and why values matter as much as code.

Tech & AI