# What Actually Happens When You Type google.com and Press Enter

*By Devang Pandya · Cloud Tech by Devang · Cloud • DevOps • AI — Made Simple*

You type `google.com` into your browser and press Enter. Less than a second later, the page is on your screen. It feels like nothing happened. In fact, a small relay race just ran across the internet: your laptop, your router, your internet provider, a DNS resolver, several name servers, and a Google server near you all took part.

"What happens when you type a URL and press Enter?" is one of the most common warm-up questions in cloud, DevOps and backend interviews. It looks simple. But it tests whether you really understand networking, security and caching, the three things that sit under every system you will ever build.

In this post I will walk through the whole journey in simple English, step by step. At the end I will give you a short answer you can say in an interview. I have spent 14+ years in cloud, DevOps and SRE, and almost every production incident I have debugged touched one of these steps: a stale DNS record, an expired certificate, a load balancer health check, or a missing cache.

* * *

## The big picture first

Here is the whole flow in one line:

**DNS → TCP → TLS → HTTP → render**, with **caching at every step**.

1.  **DNS** turns the name `google.com` into an IP address.
    
2.  **TCP** opens a reliable connection to that IP address.
    
3.  **TLS** makes the connection private and proves you are talking to the real Google.
    
4.  **HTTP** sends your request and brings back the page.
    
5.  Your **browser** draws the page, and fetches more files it needs.
    

Modern browsers can also use **HTTP/3**, which runs over **QUIC** on UDP instead of TCP. QUIC combines the connection and encryption steps. I will cover that near the end. First, let's take the classic path, step by step.

* * *

## 1\. DNS: finding the address

Computers do not talk to names. They talk to **IP addresses**, such as `142.250.x.x` (IPv4) or a longer IPv6 address. **DNS** (Domain Name System) is the internet's phone book. It turns a name into an address.

### Step 1a: check the caches close to you

Before asking anyone on the internet, your computer checks what it already knows:

*   **Browser cache.** Browsers keep recent DNS answers for a short time. (In Chrome you can see this at `chrome://net-internals/#dns`.)
    
*   **Operating system cache.** If the browser does not have it, it asks the OS. The part of the OS that does this is called the **stub resolver**.
    

Every DNS answer comes with a **TTL** (time to live). The TTL says how many seconds you may keep that answer before you must ask again. If a cached answer is still within its TTL, the lookup ends right here. That is why the second visit to a site is often faster than the first.

### Step 1b: ask the recursive resolver

If there is no cached answer, your OS sends the question to a **recursive resolver**. This is usually run by your internet provider, or a public resolver like Google Public DNS (`8.8.8.8`) or Cloudflare (`1.1.1.1`).

The resolver's job is to find the answer for you. It also has a big cache. Many people use the same resolver, so popular names like `google.com` are usually already cached there.

### Step 1c: the full walk (when nothing is cached)

If the resolver has nothing cached, it walks down the DNS tree:

1.  It asks a **root name server**: "Who handles `.com`?" The root replies with the addresses of the `.com` servers.
    
2.  It asks a `.com` **TLD (top-level domain) name server**: "Who handles `google.com`?" The TLD server replies with Google's own name servers.
    
3.  It asks **Google's authoritative name server**: "What is the IP address of `google.com`?" This server holds the real record and gives the final answer.
    
4.  The resolver sends the IP address back to your computer, and caches it for next time.
    

In real life, most lookups skip some of these steps because of caching. Resolvers keep the `.com` server list and Google's name server list in cache too, so the full walk is rare for popular sites.

One more thing worth knowing: big companies like Google may return **different IP addresses to different users**, depending on where the user is. This is one way they send you to a nearby server. (I cover this, and anycast, in topic 006 of this series.)

**Lesson for us:** DNS is a cache-heavy system. When you change a DNS record in production, the old answer can live on in caches until its TTL runs out. Lower the TTL *before* a planned migration, not during it.

* * *

## 2\. TCP: opening a reliable connection

Now your browser knows the IP address. Next, it needs a reliable connection to it. The classic way is **TCP** (Transmission Control Protocol), on port **443** for HTTPS.

TCP gives you three promises: data arrives **in order**, **without gaps**, and **without duplicates**. To set this up, both sides first agree on starting sequence numbers. They do this with the famous **three-way handshake**:

1.  **SYN.** Your computer says: "I want to talk. Here is my starting number."
    
2.  **SYN-ACK.** The server says: "OK. I got your number. Here is mine."
    
3.  **ACK.** Your computer says: "Got yours. We are connected."
    

This costs **one round trip** before any useful data can flow. A round trip (RTT) is the time for a message to go to the server and back. If the server is 100 ms away, the handshake alone costs about 100 ms. That is why physical distance matters so much, and why big companies put servers close to users.

**Lesson for us:** reuse connections. Keep-alive connections, connection pooling in your apps, and HTTP/2 multiplexing all exist so you don't pay the handshake cost again and again.

* * *

## 3\. TLS: making it private and proving who you are talking to

The `S` in `HTTPS` means the connection is protected by **TLS** (Transport Layer Security). TLS does two jobs:

1.  **Encryption.** Nobody in the middle (your Wi-Fi, your ISP, anyone else) can read or change the data.
    
2.  **Authentication.** The server shows a **certificate**, signed by a trusted certificate authority. Your browser checks that the certificate is valid and really belongs to `google.com`.
    

With **TLS 1.3** (RFC 8446, published in 2018), a full handshake takes just **one round trip** (often called **1-RTT**). Older TLS 1.2 handshakes needed two round trips. So TLS 1.3 made every new HTTPS connection faster.

In simple terms, the TLS 1.3 handshake goes like this:

*   Your browser sends a "hello" with the encryption options it supports and its share of a key exchange.
    
*   The server replies with its choices, its key share, its certificate and a proof that it owns the certificate.
    
*   Both sides now compute the same secret keys, and encrypted data can flow.
    

TLS 1.3 also has a **0-RTT** mode for repeat visits, where the browser can send some data in its very first message. It is faster, but that early data can be replayed by an attacker, so servers only allow it for safe requests.

**Lesson for us:** a huge number of real outages are simply **expired certificates**. Automate renewal (for example with ACM on AWS, or cert-manager on Kubernetes) and alert well before expiry.

* * *

## 4\. The request reaches Google: the Google Front End

Now your encrypted connection is open. Who is on the other end? Not the server that builds your search page. You are talking to Google's edge.

Google's own security design paper explains that when a service needs to be on the internet, it registers with an infrastructure service called the **Google Front End (GFE)**. The GFE **terminates TLS** with the correct certificates and best practices, and it adds protection against denial-of-service attacks. Then it forwards your request to the right **backend service** inside Google's network.

This pattern is not special to Google. Almost every large website works the same way:

*   A **front end / edge layer** (load balancer, reverse proxy, CDN) that faces the internet.
    
*   **Backend services** that do the real work, hidden behind it.
    

On AWS, you would build the same shape with **CloudFront** and an **Application Load Balancer** in front of your services. On Google Cloud, the external Application Load Balancer runs on the same front-end idea.

**Lesson for us:** never expose your app servers directly to the internet. Put a load balancer or reverse proxy in front. It terminates TLS, absorbs attacks, and lets you add or remove servers without users noticing.

* * *

## 5\. HTTP: the actual request and response

Inside the encrypted connection, your browser sends an **HTTP request**:

```plaintext
GET / HTTP/2
Host: www.google.com
User-Agent: ...
Accept: text/html
Cookie: ...
```

The server sends back an **HTTP response**: a status code (for example `200 OK`, or a `301` redirect from `google.com` to `www.google.com`), some headers, and the HTML of the page.

There are three main versions of HTTP in use today:

| Version | Runs on | Key idea |
| --- | --- | --- |
| HTTP/1.1 | TCP | One request at a time per connection |
| HTTP/2 | TCP | Many requests at once on one connection (multiplexing) |
| HTTP/3 | **QUIC** (on UDP) | Like HTTP/2, but without TCP's "one lost packet blocks everything" problem |

HTTP/3 is defined in RFC 9114. It uses the **QUIC** transport, which handles reliability, streams and flow control itself, and has TLS 1.3 built in. That is why with QUIC the connection setup and the encryption setup happen together, saving a round trip compared with TCP + TLS.

Google created the early version of QUIC, and Google's services widely support HTTP/3. Your browser and the server agree on which version to use. Older networks or browsers fall back to HTTP/2 or HTTP/1.1 over TCP.

* * *

## 6\. The browser draws the page

The HTML is only the start. The browser reads it and finds more things it needs: CSS, JavaScript, images, fonts. It fetches them too, often from the same connection (thanks to HTTP/2 or HTTP/3) or from CDN servers. Then it builds the page structure (the DOM), applies styles, runs scripts, and paints pixels on your screen.

This part is mostly front-end engineering, but it matters for cloud people too: a slow page is often not a slow server, but too many files, no compression, or no caching headers.

* * *

## 7\. Caching at every step

If you remember one thing from this post, remember this. **Every step has a cache, and caching is why the web feels fast.**

| Step | Where the cache lives | What it saves |
| --- | --- | --- |
| DNS | Browser, OS, recursive resolver | The whole DNS walk |
| TCP/TLS | Connection reuse, TLS session resumption | New handshakes |
| HTTP | Browser cache, CDN edge, reverse proxy | The trip to the origin server |
| Backend | In-memory caches (Redis, Memcached) | Database queries |

The first visit pays the full price. The second visit is cheaper at almost every layer.

* * *

## 8\. A simple diagram

The diagrams in the Reel and here are simplified **examples** for teaching. Real flows have more steps (for example CNAME records, redirects and CDN layers).

```plaintext
You type google.com + Enter
   │
   ▼
[Browser cache] → [OS cache] → [Recursive resolver]
                                   │ (if not cached)
                                   ├─► Root server  ("ask .com")
                                   ├─► .com server  ("ask Google's name servers")
                                   └─► Google name server ("here is the IP")
   │
   ▼
TCP handshake (SYN, SYN-ACK, ACK)  ── 1 round trip
   │
   ▼
TLS 1.3 handshake                   ── 1 round trip
   │
   ▼
Google Front End (near you) → backend service → HTML
   │
   ▼
Browser renders the page, fetches CSS/JS/images
```

* * *

## 9\. How to answer this in an interview

**Short answer (30 seconds):**

> "First, DNS turns google.com into an IP address. The browser and OS check their caches, then a recursive resolver asks the root, the .com servers and Google's name servers. Then the browser opens a TCP connection with a three-way handshake, and TLS 1.3 sets up encryption in one round trip. The request reaches a Google Front End near me, which terminates TLS and forwards it to a backend. The response comes back over HTTP/2 or HTTP/3, which runs on QUIC, and the browser renders the page. And there's caching at every step: DNS, connections, CDN and the backend."

**Follow-up questions to expect:**

*   *What is a TTL and why does it matter?* How long a DNS answer can be cached. It controls how fast DNS changes spread.
    
*   *Why is TLS 1.3 faster than TLS 1.2?* One round trip for a full handshake instead of two.
    
*   *Why does HTTP/3 use UDP?* QUIC builds its own reliability on UDP, so one lost packet only blocks its own stream, and it combines the transport and TLS handshakes.
    
*   *Where would you put a load balancer?* At the edge, terminating TLS, in front of stateless app servers.
    
*   *How would you debug a slow page?* Check DNS time, connect time, TLS time and time to first byte separately (for example with `curl -w` or browser dev tools).
    

**A senior touch:** mention failure points. DNS misconfiguration, an expired certificate, an unhealthy backend behind the load balancer, or a cold cache after a deploy. Interviewers love when you connect the theory to real incidents.

* * *

## 10\. Try it yourself

You can see each step on your own machine:

```bash
dig google.com                 # DNS answer and TTL
dig +trace google.com          # the full root → .com → Google walk
curl -so /dev/null -w "dns:%{time_namelookup} connect:%{time_connect} tls:%{time_appconnect} ttfb:%{time_starttransfer}\n" https://www.google.com
```

Run the `curl` command twice and compare. The difference is caching at work.

* * *

### Sources

*   Cloudflare Learning Center, "What is DNS?" (resolution steps, browser/OS caching, TTL): https://www.cloudflare.com/learning/dns/what-is-dns/
    
*   RFC 9293, Transmission Control Protocol (TCP), section 3.5 "Establishing a Connection" (three-way handshake): https://www.rfc-editor.org/rfc/rfc9293
    
*   RFC 8446, The Transport Layer Security (TLS) Protocol Version 1.3 (1-RTT handshake, 0-RTT data and replay): https://www.rfc-editor.org/rfc/rfc8446
    
*   Google Cloud, "Google infrastructure security design overview" (Google Front End terminates TLS and fronts internet-facing services): https://cloud.google.com/docs/security/infrastructure/design
    
*   RFC 9114, HTTP/3 (HTTP over the QUIC transport): https://www.rfc-editor.org/rfc/rfc9114
    
*   Google Public DNS FAQ (anycast resolver): https://developers.google.com/speed/public-dns/faq
    

**Preparing for a Cloud, DevOps or SRE interview?** Book a **Free 15-min Cloud & DevOps Interview Guidance Call** with me: what to study, how to answer system-design and on-call questions, plus a CV and roadmap check 👉 https://topmate.io/cloudtechbydevang/2358399
