How Software Works · Concept
What Happens When You Enter a URL?
Trace a web request from the address bar through naming, transport, servers, and the browser’s rendering pipeline.
On this page
The short answer
Typing a URL starts a chain of cooperating systems. The browser interprets the URL, looks for a response it can reuse, discovers where the host lives, establishes a suitable connection, sends an HTTP request, receives an HTTP response, and turns the returned bytes into something you can see and use.
That sentence is a map, not a universal packet trace. A service worker may answer before the public network is contacted. A CDN may answer without reaching the application. HTTP/3 uses QUIC rather than TCP. A client-rendered application may return a small HTML shell and fetch most of its useful data later.
Mental model
Picture the journey as a sequence of questions: What does this address mean? Where is the destination? Can we communicate securely? What resource is being requested? Who can produce it? How should the browser present the response? Debugging becomes easier when you identify the first question the system failed to answer.
- BrowserParse and request
- DNSFind an address
- ConnectionTransport and TLS
- EdgeCDN or proxy, when used
- ApplicationRun logic
- DataCache or database, when needed
- BrowserParse and render
Start with the URL
Consider this illustrative address:
https://example.com/products/42?currency=INR
IANA reserves example.com for documentation; this lesson is not claiming that the domain runs a product application.See IANA’s example-domain guidance.2
- Scheme —
https: tells the client that this is an HTTP resource reached through a secured connection. - Host —
example.com: identifies the network host name associated with the origin. - Path —
/products/42: identifies a location within that origin. Its meaning is decided by the server-side application, not by the URL syntax itself. - Query —
currency=INR: supplies additional input. Here it could ask an illustrative product page to express a price in Indian rupees.
The browser parses these parts according to URL rules before it decides how to fetch the resource.The WHATWG URL Standard defines the parser and URL components.1 A fragment such as #reviews would usually be handled inside the client after the resource is loaded; it is not part of the HTTP request target sent to the server.
Key takeaway
Browser checks before the network request
“The browser sends a request” is often true, but it is not always the first observable event.
The browser may already have a reusable HTTP response in its cache, subject to HTTP caching rules and freshness checks.RFC 9111 defines reuse, freshness, and validation for HTTP caches.12 It may also reuse an existing network connection rather than opening a new one. If the site controls the navigation with an active service worker, that worker can intercept the request and return a cached or generated response, forward the request to the network, or combine both strategies.MDN documents the service worker’s position between an application, browser, and network.9
Browser implementation details, privacy modes, extensions, operating-system caches, and policy can change the exact early path. The durable idea is that fetching begins with a decision: can an acceptable response or connection already be reused? A cache hit can skip several later steps; a stale response may require validation with the server.
DNS resolves the domain
If the browser needs the network, it needs an address to contact. Humans use host names such as example.com; Internet routing ultimately needs an IP address. DNS is the distributed naming system that can associate a domain name with address records and other information.
The answer may already exist in a browser, operating-system, or recursive resolver cache. Otherwise, a resolver follows DNS referrals until it reaches a name server with an authoritative answer, then returns the relevant record. DNS was designed as a distributed database with caching, so “the browser asks one DNS server” is a useful first approximation, not the complete architecture.RFC 1034 defines resolvers, name servers, referrals, and caching.3
DNS answers where a named service can be reached. It does not download the web page, negotiate encryption, or decide what HTML the application should produce.
The next lesson, DNS and IP Addresses, explains recursive resolvers, authoritative servers, record types, and cache lifetimes. For this end-to-end model, the important boundary is simply that naming produces information the browser can use for a connection.
Common misconception
Incorrect: DNS connects the browser to the website.
Better model: DNS returns information—commonly an IP address—that helps the browser choose a network destination. Connection establishment happens afterward.
The browser establishes a network connection
After naming supplies an address, the browser needs a transport connection. For HTTP/1.1 and HTTP/2, the common transport is TCP, which provides a reliable, in-order byte stream.RFC 9293 specifies TCP’s service and connection establishment.4 HTTP/3 instead carries HTTP semantics over QUIC, and QUIC packets travel in UDP datagrams.RFC 9114 maps HTTP to QUIC.7RFC 9000 defines QUIC and its use of UDP datagrams.8
The careful high-level rule is:
- HTTP/1.1 and HTTP/2 commonly travel over TCP.
- HTTP/3 travels over QUIC, which uses UDP underneath.
- The URL does not normally tell you which HTTP version will be selected; client and server capabilities, prior knowledge, and protocol negotiation influence that choice.
TCP, HTTP, and HTTPS separates the transport, security, and application-protocol layers in detail.
TLS secures an HTTPS connection
Because the scheme is https, the client and server establish cryptographic protection before ordinary HTTP application data is exchanged. During the TLS handshake, they negotiate parameters and derive traffic keys. The server presents credentials that the client validates for the requested host according to its trust policy.
TLS is responsible for several different properties: authenticating the server under the certificate model, keeping application data confidential from network observers, and detecting modification in transit.RFC 8446 describes the TLS 1.3 handshake, authentication, confidentiality, and integrity goals.5 It does not prove that the application is honest, bug-free, or safe to give personal data. It secures the channel to the authenticated endpoint.
With HTTP/1.1 or HTTP/2, TLS normally runs over TCP. With HTTP/3, QUIC integrates the TLS 1.3 handshake into connection establishment. HTTP meaning, cryptographic protection, and transport behavior remain distinct responsibilities even when an implementation combines some of their setup work.
Key takeaway
The browser sends the HTTP request
Once an appropriate secure connection exists, the browser expresses what it wants as an HTTP request. Conceptually, that request includes:
- a method, such as
GET; - a target, including the path and query;
- fields (often called headers) describing the host, acceptable representations, cookies, caching conditions, and other context;
- sometimes a body, especially for methods used to submit data.
GET /products/42?currency=INR HTTP/1.1
Host: example.com
Accept: text/htmlThe on-the-wire representation differs across HTTP versions: HTTP/1.1 uses a textual message format, while HTTP/2 and HTTP/3 use binary framing. The underlying semantics—request method, target, fields, content, and a corresponding response—remain recognizable.RFC 9110 defines the shared HTTP semantics.6
Cookies or authorization fields may identify a session. Content-negotiation fields may influence whether the response is HTML, JSON, or another representation. The server must still decide what those values mean for its application.
APIs and JSON explains how an application defines that request-and-response contract. Authentication and Sessions explains how a later request carries acceptable identity evidence.
The request reaches infrastructure such as a CDN, load balancer, or reverse proxy
The IP address from DNS does not necessarily belong to the application process that creates the page. Depending on the architecture, the first HTTP-speaking system may be:
- a CDN edge, which can serve a cached response near the user or forward a miss;
- a load balancer, which selects from multiple healthy service instances;
- a reverse proxy, which terminates client connections, applies routing or policy, and forwards requests to upstream services;
- or the application server itself.
These roles can overlap in one product or be split across several systems. Some small applications use none of them. They are common architectural options, not mandatory stations on every request.
Deployment and Cloud Servers explains how application code becomes a reachable running process. Reverse Proxies, Logs, and Debugging Production Failures returns to this infrastructure boundary with production diagnostics.
Behind the scenes
An intermediary can complete one secure connection from the browser and open another connection to an upstream service. That creates a useful failure boundary: the browser may successfully reach the proxy even when the proxy cannot get a valid response from the application behind it.
The application server processes the request
If the request reaches application code, a framework or server usually parses it and selects a handler from the method, host, and path. This is the backend responsibility introduced in Frontend, Backend, and Database. For the illustrative /products/42 route, the handler might:
- validate that product identifier
42has the expected shape; - read session or authorization information;
- interpret
currency=INRas optional input; - call business logic or another service;
- ask for product data;
- construct HTML, JSON, a redirect, or an error response.
This is an architecture-dependent example. A static host might map the path to a prebuilt file. A serverless platform might invoke a function. A monolith might perform all work in one process, while a distributed system might call several internal services.
How a Backend Processes a Request expands this application-side stage without assuming one framework structure.
The server may read from a cache or database
Applications commonly need data that is not embedded in the running code. The handler may check an application cache for a reusable value, query a database, read object storage, or call another service.
A cache is usually an optimization: it avoids repeating work or reduces a slower data lookup. A database is commonly a durable system of record, but even that wording depends on the design. The request might need neither. A public static page can be returned without a user database; a personalized page may require several reads and authorization checks.
The useful debugging boundary is not simply “backend.” Ask which dependency the application was waiting for, what input it sent, and what response or timeout came back.
How Databases Store and Retrieve Data examines the persistent-data branch in detail.
The HTTP response travels back
The responding server sends an HTTP response containing a status code, response fields, and usually content. A successful document response might carry HTML with a 200 status and a Content-Type describing it as HTML. Other responses may redirect the browser, report that a resource is missing, or describe a server-side failure.
The response traverses the selected connection and any intermediaries on the return path. A CDN or proxy may add fields, compress content, cache an eligible response, or stream bytes as they arrive. TCP or QUIC handles transport details; HTTP tells the client what the response means.
Receiving the first bytes does not require the browser to wait for every byte before doing useful work. Browsers can begin processing a streamed HTML response while more data is still arriving.
The browser parses and renders the page
For an HTML response, the browser’s HTML parser converts the byte stream into nodes in the Document Object Model, or DOM.The HTML Standard defines the parsing rules used to generate DOM trees.10 As the parser encounters external stylesheets, scripts, fonts, images, and other resources, it may schedule more fetches.
CSS is parsed into a CSS Object Model, or CSSOM. At a high level, the browser combines content and style information, calculates layout, paints pixels, and may composite visual layers. JavaScript can read and change the DOM, request data, attach event handlers, and trigger more style, layout, or paint work.MDN’s critical-rendering-path guide summarizes DOM, CSSOM, render tree, layout, and paint.11
This is intentionally a high-level rendering model. Modern browser engines pipeline and overlap work, and scripts or styles can block or reorder parts of the process. “HTML arrives, then the browser renders” is directionally correct; the real process is incremental and interdependent.
How Browsers Turn HTML and CSS Into Pixels follows that browser-side work in detail.
Additional resources and JavaScript requests
The first document response is often only the beginning. The HTML can reference stylesheets, JavaScript modules, images, fonts, video, and preloaded resources. Each resource has its own URL and fetch decision, though connections and cached responses may be reused.
After JavaScript runs, the page may make API requests for JSON, submit analytics, open a WebSocket, or lazily load code for an interaction. Those are additional request lifecycles, not hidden parts of the original HTML response.
This explains a common debugging surprise: a document can load successfully with status 200 while a later API request fails. “The page loaded” and “every dependency required by the interface succeeded” are different claims.
What changes in a client-rendered application
In a client-rendered application, the initial HTML may contain a root element, links to CSS, and scripts rather than the finished interface. After the JavaScript bundle downloads and executes, it builds UI in the browser and commonly requests application data from an API.
That is a variation of the same model, not a replacement for it. DNS, connection establishment, TLS, and HTTP still happen. The major change is where and when the useful representation is assembled:
- server-rendered HTML arrives with more of the page already described;
- client rendering moves more construction work and data fetching into the browser;
- many production systems mix server rendering, static generation, hydration, and client updates.
Avoid the universal claim that a browser always receives a complete HTML page or that every modern app begins as an empty shell. Both patterns exist.
Common failure points
The sequence gives you a practical diagnostic map:
- URL or policy: invalid URL, blocked mixed content, browser extension, or service-worker behavior.
- DNS: name not found, stale record, misconfigured resolver, or unreachable DNS service.
- Connection: route failure, refused port, packet loss, or protocol negotiation failure.
- TLS: expired or mismatched certificate, untrusted chain, or incompatible settings.
- HTTP edge: redirect loop, access policy, rate limit, or cached error.
- Proxy to upstream: unhealthy application, wrong port, timeout, or invalid upstream response.
- Application: exception, failed validation, dependency timeout, or authorization decision.
- Data layer: unavailable database, slow query, exhausted connection pool, or stale cache.
- Browser rendering: missing asset, JavaScript exception, incompatible content, or layout bug.
Do not start by guessing the component you most recently changed. Find the last boundary that definitely succeeded, then inspect the next one.
A realistic debugging scenario
Debugging scenario
The domain resolves to an IP address. The browser completes HTTPS successfully. The response is 502 Bad Gateway and identifies the reverse proxy as the responding server.
Where did the request succeed? It passed URL parsing, DNS resolution, network connection establishment, and TLS to the proxy. It also reached an HTTP-speaking gateway that could generate a response.
Where is the likely boundary? Between that proxy and an upstream service. RFC 9110 defines 502 as a gateway or proxy receiving an invalid response from an inbound server while trying to fulfill the request.See the HTTP status-code definition.6 Common investigations include upstream health, the configured host and port, connection refusal, protocol mismatch, premature connection closure, and proxy logs.
A 502 does not prove one universal cause, and it does not automatically mean DNS or the browser is broken. It narrows the initial investigation to a gateway/upstream exchange while leaving several possible root causes.
Common misconceptions
The server is one machine
A hostname can lead to a CDN, load balancer, proxy, application fleet, and several data services. “The server” is convenient shorthand, not a reliable architecture diagram.
HTTPS means the site is trustworthy
HTTPS protects transport to an authenticated endpoint. A securely delivered application can still be malicious, compromised, or incorrect.
DNS is queried for every resource
DNS results and connections are cached and reused under defined lifetimes and browser policy. A new subresource fetch does not necessarily repeat every earlier step.
The browser waits for all HTML before doing anything
HTML parsing and resource discovery are incremental. Browsers can begin building the DOM and requesting discovered resources while the document is still arriving.
Check your understanding
Reflect, then reveal each answer.
What is DNS responsible for in this journey?
DNS supplies naming information—commonly the IP address associated with the host. It does not establish TLS, send the HTTP request, or render the page.
What protection does TLS add to an HTTPS connection?
TLS authenticates the endpoint under the certificate model, encrypts application data for confidentiality, and protects its integrity in transit. It does not guarantee that the application itself is trustworthy or bug-free.
What information does an HTTP request communicate?
It communicates a method and target plus request fields, and sometimes content. Together these express what operation the client wants and relevant context for the server.
If HTTPS succeeds but a reverse proxy returns 502, which boundary should you inspect first?
Start with the proxy-to-upstream boundary: upstream health, routing configuration, ports, timeouts, protocol agreement, and logs. The request already reached the proxy securely.
What major browser structures are involved before pixels appear?
At a high level, HTML becomes the DOM, CSS becomes the CSSOM, visible content and styles inform a render tree, layout determines geometry, and paint produces pixels. JavaScript can affect several stages.
Concepts to learn next
Knowing the complete journey gives each deeper topic a place to attach.
How this connects
- DNS and IP addresses
Understand recursive resolution, record types, caching, and how names lead to routable destinations.
- TCP, HTTP, and HTTPS
Separate reliable transport, HTTP semantics, and TLS security into clear responsibility layers.
- APIs and JSON
See how application contracts give HTTP paths, fields, and representations their product-specific meaning.
- Backend and database
Open the application and persistent-data stages while keeping their responsibilities distinct.
Key takeaway
References & further reading
References & further reading12 sourcesPrimary standards and official documentation used for this lesson.
- Example Domains (opens in a new tab)
Internet Assigned Numbers Authority (IANA)
Reserved use of example.com in documentation
- RFC 1034: Domain Names — Concepts and Facilities (opens in a new tab)
Internet Engineering Task Force (IETF)
DNS resolvers, name servers, caching, and host-address records
- RFC 9293: Transmission Control Protocol (TCP) (opens in a new tab)
Internet Engineering Task Force (IETF)
TCP connection establishment and reliable byte streams
- RFC 8446: The Transport Layer Security (TLS) Protocol Version 1.3 (opens in a new tab)
Internet Engineering Task Force (IETF)
TLS authentication, confidentiality, and integrity
- RFC 9110: HTTP Semantics (opens in a new tab)
Internet Engineering Task Force (IETF)
HTTP requests, responses, intermediaries, and status codes
- RFC 9000: QUIC — A UDP-Based Multiplexed and Secure Transport (opens in a new tab)
Internet Engineering Task Force (IETF)
QUIC packets, streams, TLS integration, and UDP carriage
- Service Worker API (opens in a new tab)
MDN Web Docs
Browser request interception and cache-controlled responses
- HTML Standard — Parsing HTML documents (opens in a new tab)
WHATWG
HTML parsing and DOM tree construction
- RFC 9111: HTTP Caching (opens in a new tab)
Internet Engineering Task Force (IETF)
Response reuse, freshness, and validation