All posts

Blog

What Happens When You Type a URL Into Your Browser? A Step-by-Step Explanation

Illustrated cover for the Hosting Basics guide "What Happens When You Type a URL Into Your Browser? A Step-by-Step Explanation"

You type www.example.com, press Enter, and a page appears, usually in about a second or two. It feels like magic, but behind that moment is a carefully choreographed chain of steps involving your browser, your computer, several servers around the world and the hosting company that runs the site.

Understanding this chain isn't just interesting trivia. It helps you make sense of hosting jargon, troubleshoot error messages and see exactly where speed improvements come from. Here's what happens, step by step.

Step 1: The browser reads what you typed

First, your browser decides whether you typed a web address or a search. If it looks like a URL, the browser breaks it into parts:

https://www.example.com/blog/post?id=7
  • Scheme: https, the protocol to use
  • Host: www.example.com, the server to contact
  • Path: /blog/post, the page you want
  • Query string: ?id=7, extra information for the server

If you left out the https://, modern browsers usually try HTTPS first. Some sites are also on a built-in list (called HSTS preload) that tells browsers to always use HTTPS for them.

Step 2: Check the caches

Before reaching out to the internet, the browser checks whether it already has what it needs. It may have a stored copy of the page or its files from a previous visit, and it may remember the site's IP address. Your operating system keeps its own DNS cache as well.

If cached information is still valid, some steps below can be skipped, which is one reason sites feel faster on repeat visits. Learn more in types of website caching explained.

Step 3: DNS lookup, turning the name into an IP address

Computers find each other using IP addresses, such as 203.0.113.10 (IPv4) or a longer IPv6 address. Domain names exist so people don't have to remember those numbers. The Domain Name System (DNS) translates one into the other.

If the address isn't already cached, the lookup goes roughly like this:

  1. Your device asks a recursive resolver, usually run by your internet provider or a public DNS service.
  2. If the resolver doesn't have the answer cached, it asks a root server where to find information about .com domains.
  3. The root server points it to the .com top-level domain (TLD) servers.
  4. The TLD servers point it to the domain's authoritative nameservers, the ones set at the domain registrar.
  5. The authoritative nameservers return the actual record, such as an A record with the IP address.
  6. The resolver passes the answer back to your device and caches it for a set time, called the TTL.

This all usually takes milliseconds. It also explains why DNS changes aren't instant everywhere: resolvers keep cached answers until their TTL expires. See what DNS propagation is, DNS records explained and nameservers vs DNS records for more.

If this step fails, you'll see an error like "DNS_PROBE_FINISHED_NXDOMAIN" or "This site can't be reached."

Step 4: Open a connection to the server

Now the browser knows which IP address to contact. Next, it opens a connection.

TCP handshake

For traditional HTTP/1.1 and HTTP/2 connections, the browser and server perform a quick TCP handshake, an exchange of messages that sets up a reliable connection. Newer HTTP/3 connections use a protocol called QUIC, which combines some of these steps to save time.

TLS handshake (for HTTPS)

For secure sites, the browser and server then perform a TLS handshake:

  • The server presents its SSL/TLS certificate.
  • The browser checks that the certificate is valid, not expired and issued for that domain by a trusted authority.
  • They agree on encryption keys so everything after this point is private.

If the certificate is wrong or expired, you'll see a security warning instead of the page. Learn more in what SSL and HTTPS are.

Each of these round trips takes time, and the further you are from the server, the longer each one takes. That's why server location and CDNs matter for speed.

Step 5: The browser sends an HTTP request

With a secure connection in place, the browser sends an HTTP request, something like:

GET /blog/post?id=7 HTTP/2
Host: www.example.com
User-Agent: (browser details)
Accept: text/html
Cookie: (if any)

This says, "Please send me this page." It also includes details about the browser, accepted languages and any cookies the site set earlier, such as a login session.

Step 6: The server processes the request

The request arrives at the hosting server, where a web server program such as Apache, LiteSpeed or Nginx handles it.

  • For a static file, like an image or a plain HTML page, the server simply reads it from disk and sends it back.
  • For a dynamic page, like most WordPress pages, the web server passes the request to an application, often written in PHP. That code may query a database for the post content, settings and menus, then build the HTML page.

Server rules can also come into play here. Redirects in an .htaccess file, security filters and caching layers can all intercept or change the response.

This is the step where your hosting has the biggest influence. Fast storage, enough CPU and memory, current software and good caching all reduce the time it takes the server to respond, often measured as Time to First Byte (TTFB).

Step 7: The server sends a response

The server replies with:

  • A status code, such as 200 OK, 301 Moved Permanently, 404 Not Found or 500 Internal Server Error
  • Headers, with information like content type, caching rules and cookies
  • The body, usually the HTML of the page

If the response is a redirect, the browser starts the request again at the new address.

Step 8: The browser renders the page

Receiving the HTML is only the beginning. The browser now:

  1. Parses the HTML and builds a structure of the page called the DOM.
  2. Finds linked resources such as CSS stylesheets, JavaScript files, images and fonts, and requests each one. These may come from the same server, a CDN or other services.
  3. Builds styles from the CSS.
  4. Runs JavaScript, which can change the page or load more content.
  5. Lays out and paints everything on your screen.

A typical page may need dozens of these extra requests. Large images, heavy scripts and too many third-party files slow this stage down, which is why optimizing images and keeping pages lean improves Core Web Vitals.

Step 9: The page keeps working

Even after it appears, the page may keep talking to servers, loading more images as you scroll, sending analytics data or refreshing content. The connection may also stay open briefly so the next click loads faster.

Why this matters for website owners

Knowing this chain helps you pinpoint problems:

  • Site not found? Check DNS and nameservers.
  • Security warning? Check your SSL certificate.
  • Slow before anything appears? Look at server response time and hosting resources.
  • Slow to finish loading? Look at image sizes, scripts and plugins.
  • Error code? The status code tells you which stage went wrong.

Our guide on how to test website speed shows how to see many of these steps in a waterfall chart.

Wrapping up

When you type a URL and press Enter, your browser parses the address, checks its caches, looks up the IP address through DNS, opens a secure connection, sends a request, waits for the server to build a response and finally renders the page. All of that usually happens in a second or two. Every step is a place where things can go right or wrong, and understanding them makes you a far more confident website owner.