DEV Community

Ishan Bagchi for Byte-Sized News

Posted on

What Actually Happens When You Type a URL in the Browser?

Imagine you’re at your desk, maybe with a little mug of tea, and you open your browser. You type www.google.com, hit Enter, and in what feels like a heartbeat, you’re staring at the Google homepage.

Simple, right?

Here’s the thing: behind that one keystroke lies a chain reaction, a series of machines, protocols, translations, negotiations, all secretly working together so you can see a web page. It’s less magic, more engineering, but still pretty magical when you think about it.


Step 1: The URL — Your Digital Address

When you typed https://www.google.com, you essentially said:

“Browser, take me to the house called google.com using the secure road (HTTPS).”

Breaking it down:

  • Protocol: https:// – tells the browser how to speak to the server (securely).
  • Domain name: www.google.com – tells it where to go.
  • Path/query (might be something like `/search?q=…” but not in our simple example) – tells it what exactly to fetch inside that domain.

Once you hit Enter, your browser thinks: “Okay, got the address. Now how do I get there?”


Step 2: DNS – The Internet’s Phonebook

Image of DNS

Your browser doesn’t know “google.com” as a house, it knows numbers (IP addresses). So it uses the Domain Name System (DNS) to translate the friendly name into an IP.
Here’s a link diving into how DNS works: What is DNS – Cloudflare
And another good read: How DNS works – freeCodeCamp

Roughly this happens:

  1. The browser checks its cache to see if it already knows the IP.
  2. If not found, the OS checks its cache.
  3. If still no, the request goes to the ISP’s DNS resolver which starts querying the DNS hierarchy (root servers → TLD servers → authoritative name servers) to find the IP. (GeeksforGeeks)
  4. Once the IP is found, your browser has a destination.

Step 3: Establishing a Connection – TCP Handshake

With the IP in hand, your browser knocks on the server’s door using TCP (Transmission Control Protocol). It’s a three-way handshake: browser says “hi,” server replies “hi,” browser says “let’s talk.” This establishes reliable communication.
We often gloss over this, but the handshake ensures both sides are ready and synchronised.


Step 4: Adding a Layer of Security – TLS Handshake

Since we used https://, there’s another handshake: the Transport Layer Security (TLS) handshake. This explains:

  • The server presents a certificate to prove “I am who I say I am.”
  • Browser and server agree on encryption keys so the data transfer is private and secure.

Once that’s done, your browser and the server can talk securely.


Step 5: Making the Request – The HTTP Request

Image of the HTTP request

Now we’re ready. Your browser says something like:

“Server at the IP I found, please send me your homepage.”

That’s an HTTP request (Hypertext Transfer Protocol). If you’re curious, check this link: HTTP Requests and Responses: A Beginner’s Guide
And a more canonical source: MDN – HTTP Messages

The request includes:

  • Method (GET, POST, etc)
  • Path (which page or resource)
  • Headers (browser type, language, cookies)
  • Possibly a body (for POST requests)

Step 6: Server Response – The HTML Arrives

The server processes your request and sends back an HTTP response. It includes:

  • A status code (200 = OK, 404 = Not Found, etc.)
  • Response headers (type of content, caching rules, etc)
  • The body (which, for our case, is the HTML of the Google homepage) You can explore What is HTTP? – W3Schools for details.

Step 7: Rendering – Painting the Page

Image of Rendering

Your browser now has a blueprint (the HTML, CSS, JS, images…) and it starts building:

  1. Parse the HTML to build the DOM (Document Object Model).
  2. Parse CSS to figure out layout and styles.
  3. Run JS to add interactivity.
  4. Download images/fonts/videos as needed.
  5. Render all of this visually so you see the page.

This is where the magic of “appears instantly” happens.


Step 8: Optimization, Caching & the Background Work

Even after you see the page, work continues:

  • The browser caches resources (so next time it'll load faster).
  • DNS entries may be kept in cache too.
  • The server might have chosen a data-centre close to you (via load-balancing/CDNs) so the journey was short. These optimisations are why websites feel snappy.

Step 9: Click, New URL, Repeat

When you click a link or type another URL, the process essentially repeats — but thanks to caching and persistent connections, parts of it are faster now.


Final Thought

Typing a URL is deceptively simple. Under the hood it triggers a global ballet of protocols, machines, translation services and security layers, so you can get your webpage, often within milliseconds. Next time a page loads with no hiccup, take a moment to appreciate how many invisible actors just did their job.

Top comments (0)