DEV Community

Cover image for What Really Happens After You Enter a URL in Your Browser? A Complete Breakdown
Ajay Kumbham
Ajay Kumbham

Posted on • Originally published at blog-ajaykumbham.vercel.app

What Really Happens After You Enter a URL in Your Browser? A Complete Breakdown

1. What a URL Actually Represents

A URL acts as an instruction set for the browser. It describes how to reach a resource and where that resource lives. A typical URL can include:

• Scheme (Protocol)
Examples: http://, https://
This tells the browser what communication rules to follow.

• Domain Name
Example: example.com
A readable name that must be translated into a numerical IP address.

• Path
Example: /products/
Shows the location of a section or directory on the server.

• Specific Resource
Examples: index.html, logo.png, main.js
Indicates the exact file the browser should retrieve.

All these elements work together to point the browser to a unique item on a remote machine.


2. DNS Resolution: Mapping the Domain to an IP

Browsers can’t connect using domain names directly. They need an IP address.
This is where DNS (Domain Name System) comes in — it acts like a global address directory.

The lookup sequence generally follows this order:

  1. Browser Cache — checks if the IP is already stored from a previous visit
  2. OS Cache — the operating system may have the mapping saved
  3. DNS Resolver — typically provided by your ISP or a public resolver
  4. DNS Hierarchy
  • Root servers
  • TLD servers (.com, .net, .org, etc.)
  • Authoritative DNS server for the domain

Once the resolver finds the correct IP, the browser can move forward.


3. Creating a TCP Connection

With the IP known, the next step is establishing a communication link.
Most websites rely on TCP, a protocol designed for reliable data transfer.

A TCP connection is created using a three-step negotiation called the three-way handshake:

  1. Browser → Server: SYN
  2. Server → Browser: SYN-ACK
  3. Browser → Server: ACK

Modern browsers often keep these connections alive so future requests reuse the same link, reducing latency.


4. HTTPS: Setting Up Encryption (TLS Handshake)

If the URL uses HTTPS, the browser must secure the connection.
This involves an additional process known as the TLS handshake:

  • The server presents its SSL/TLS certificate
  • The browser validates it
  • Both sides agree on encryption methods
  • A shared session key is generated

After this, all communication is encrypted end-to-end.


5. Sending an HTTP Request

Once the connection is ready, the browser submits an HTTP request.
The request includes:

  • Method (GET, POST, etc.)
  • Target path
  • Headers (cookies, accepted formats, browser details)
  • Body (for POST/PUT requests)

Example:

GET /index.html HTTP/1.1
Host: example.com
Enter fullscreen mode Exit fullscreen mode

6. How the Server Handles the Request

The server receives the request and decides how to respond:

  1. Retrieves the requested file or runs backend logic
  2. Prepares the response body (HTML, JSON, images, etc.)
  3. Adds relevant headers
  4. Sends it back to the browser with a status code like
  • 200 OK
  • 404 Not Found
  • 500 Internal Server Error

7. Browser Rendering Pipeline

Once the response arrives, the browser begins turning raw data into a visible webpage.

Step-by-step:

• HTML Parsing → DOM Creation
The browser constructs the Document Object Model.

• Fetching Linked Resources
CSS, JavaScript, images, fonts — each may generate additional requests.

• CSS Parsing → CSSOM Creation
Used to apply styling.

• JavaScript Execution
Scripts can modify the DOM, change styles, or fetch more data.

• Layout and Painting
The browser calculates positions, applies styles, and finally renders the pixels on the screen.


8. The Final Result

What looked like a simple URL entry actually triggered caching checks, DNS lookups, secure handshakes, request/response cycles, multiple resource fetches, and a rendering pipeline — all executed in milliseconds.


Quick Recap

When a URL is entered, the browser:

  1. Interprets the URL components
  2. Resolves the domain name into an IP
  3. Establishes a TCP connection
  4. Sets up encryption (for HTTPS)
  5. Sends an HTTP request
  6. Receives and processes the server’s response
  7. Loads additional resources
  8. Renders everything into a functional webpage

This is the entire behind-the-scenes mechanism that powers the modern web.


Top comments (0)