What happens when you type a URL and press enter
It is the classic interview question, and it is worth knowing for real. Between pressing enter and seeing a page, your machine runs through several distinct stages, and almost every web problem you will ever debug lives in one of them.
Step one: turn the name into an address
Computers route to IP addresses, not names, so the first job is resolving example.com to something like 93.184.216.34. Your browser checks its own cache, then the operating system cache, then asks a resolver (usually your router or a public resolver like Cloudflare's 1.1.1.1). If none of them know the answer, the resolver walks the DNS hierarchy: root servers point it at the .com servers, which point it at the domain's authoritative nameservers, which return the record.
This is also where a surprising share of outages live. A wrong record, an expired one still cached by its TTL, or a missing AAAA record can all break a site that is otherwise perfectly healthy.
Step two: open a connection
With an IP in hand, the browser opens a TCP connection to port 443 (for HTTPS) or 80. TCP starts with a three way handshake: SYN, SYN-ACK, ACK. Those three packets establish that both sides can send and receive before any real data moves.
Step three: negotiate encryption
For HTTPS, a TLS handshake follows. The server presents its certificate, the two sides agree on a cipher, and they derive the keys that encrypt everything afterward. The browser checks that the certificate is valid, unexpired, and signed by a trusted authority. A failure here is the source of most of the scary security warnings users see.
Step four: the request and response
Now the browser sends an HTTP request: a method (GET), a path, and headers describing what it wants and who it is. The server replies with a status code, response headers, and usually a body of HTML.
Step five: render
The browser parses the HTML, discovers it needs CSS, JavaScript, images, and fonts, and fires off more requests for each, often reusing the same connection. As the resources arrive it builds the page and paints it.
When something breaks, work down this list in order. If the name does not resolve, nothing else matters. You can check the very first step with the DNS Lookup tool, which shows exactly what a domain resolves to right now.