DEV Community

Cover image for What Really Happens When You Type a URL in Your Browser?
Narendra | SRE
Narendra | SRE

Posted on

What Really Happens When You Type a URL in Your Browser?

You type a URL. Press Enter. A beautiful website appears in milliseconds. But behind that single action, an entire chain of networking, security, and system-level operations takes place.

If you're learning DevOps, SRE, Backend Engineering, Networking, or System Design - this is one of the most important flows to understand.

🌍 Example

Suppose you type:

🌍https://google.com

what happens internally?
Let's break it down step-by-step.

⚑ High-Level Flow

Enter URL
↓
Browser Cache Check
↓
DNS Resolution
↓
TCP Handshake
↓
TLS/SSL Handshake
↓
HTTP Request Sent
↓
Load Balancer / Server
↓
Application Processing
↓
HTTP Response
↓
Browser Rendering

1. Browser Checks Cache First

Before contacting any server, the browser checks whether it already knows the IP address.
It checks:

βœ” Browser cache
βœ” OS DNS cache
βœ” Router cache
βœ” ISP cache
If found:

Use cache IP address

This avoids unnecessary DNS lookups and makes websites load faster.

2. DNS Resolution Happens

Humans remember names. Computer communicates using IP addresses.

So the browser asks:

What is the IP address of google.com?

The DNS server responds with something like:

142.250.xxx.xxx

This process is called DNS Resolution.

3. TCP Connection is Established

Now the browser knows the server IP.

Next step:

🀝 TCP 3-Way Handshake

Client β†’ SYN
Server β†’ SYN-ACK
Client β†’ ACK

Now a reliable connection is established.

πŸ“Œ Why TCP?

TCP guarantees:

βœ” Reliable delivery
βœ” Ordered packets
βœ” Error checking
βœ” Retransmission

This is extremely important for web applications.

4. TLS/SSL Handshake (HTTPS)

Since the URL starts with:

https://

A secure encrypted connection must be created.

During TLS handshake:

βœ” Certificate validation
βœ” Encryption negotiation
βœ” Session key exchange
βœ” Secure communication setup

Now communication becomes encrypted.

5. Browser Sends HTTP Request

Now the browser sends:

GET / HTTP/1.1
Host: google.com

The request also contains:

βœ” Headers
βœ” Cookies
βœ” Authentication tokens
βœ” User-Agent
βœ” Compression support

6. Request Travels Across the Internet

The request moves through multiple layers:

Browser

β†’ Operating System
β†’ Router
β†’ ISP
β†’ Internet
β†’ CDN / Load Balancer
β†’ Web Server

In modern production systems:

Requests usually hit CDN or Load Balancer first

7. Server Processes the Request

Now the backend application starts working.

Possible operations:

βœ” Run application logic
βœ” Authenticate user
βœ” Query databases
βœ” Read cache
βœ” Call microservices
βœ” Fetch files

The server then prepares a response.

8. Server Sends HTTP Response

Example response:

HTTP/1.1 200 OK

The server may return:

βœ” HTML
βœ” CSS
βœ” JavaScript
βœ” Images
βœ” JSON data

9. Browser Renders the Webpage

Now the browser starts rendering.

Internally it:

βœ” Parses HTML
βœ” Builds DOM tree
βœ” Downloads CSS
βœ” Executes JavaScript
βœ” Paints pixels on screen

Finally:

πŸŽ‰ The webpage appears

🎯 Interview Keywords You Must Know

DNS

TCP Handshake
TLS Handshake
HTTP Request/Response
Caching
CDN
Load Balancer
Browser Rendering
Latency
Microservices

πŸ”₯ If You Found This Useful

Follow for more content on:

DevOps
SRE
Linux
Kubernetes
Networking
System Design
Production Engineering

Happy Learning

Top comments (0)