Member-only story

What Happens When You Press Enter? A Journey Through HTTP Requests

Dev Diwan
4 min readDec 22, 2024

--

Introduction

You type a URL into your browser, hit Enter, and — almost magically — the webpage appears in a split second. But have you ever wondered what really happens behind the scenes? What systems, protocols, and processes work in harmony to transform your request into a fully rendered webpage?

This article takes you on an enlightening journey through the intricate world of HTTP requests. From DNS lookups and TCP handshakes to rendering content in your browser, we’ll break down the entire process in a developer-friendly way.

Step 1: DNS Resolution — Translating Domain Names to IP Addresses

When you hit Enter, the browser first needs to know the IP address of the server hosting the website. This is where the Domain Name System (DNS) comes into play.

  1. Cache Lookup: The browser checks if it already knows the IP address from:
  • Browser cache
  • Operating system cache
  • Local DNS server cache

Recursive Query: If the IP isn’t cached, the browser sends a DNS query to a recursive DNS resolver, which works through:

  • Root DNS servers: Point to the TLD (e.g., “ .com ”) name servers.
  • TLD name servers: Direct the query to the authoritative name servers for the domain.
  • Authoritative name

--

--

Dev Diwan
Dev Diwan

Written by Dev Diwan

🌱 Aspiring developer, coding enthusiast, and perpetual learner on the tech odyssey. Let's conquer bugs! 💻. Learning to be a better Human Being✨

No responses yet