What Happens When We Type www.google.com?

What Happens When We Type www.google.com?

Have you ever paused to think about what really happens when you type www.google.com into your web browser and press Enter? What seems like a simple action triggers a complex series of behind-the-scenes events involving networking, server infrastructure, and protocols working in harmony. In this article, we’ll unravel the steps your request goes through and explore key concepts like DNS, IP addresses, ports, server hosting, and scalability strategies in modern web architecture.


1. DNS (Domain Name System)

The Domain Name System (DNS) is essentially the phonebook of the internet. While humans refer to websites using easy-to-remember domain names like www.google.com, computers communicate using IP addresses. DNS translates the human-readable domain name into the machine-readable IP address.

1.1 DNS Resolution Process:

  1. Browser Cache: The browser first checks its local cache to see if it already knows the IP for www.google.com.
  2. OS Cache: If not in the browser cache, it checks the operating system’s DNS cache.
  3. DNS Resolver: If still unresolved, a request is sent to the configured DNS resolver (e.g., your ISP’s or Google’s public resolver at 8.8.8.8).
  4. Root Name Server: The resolver contacts a root server to find which server is authoritative for .com domains.
  5. TLD Server: The .com TLD (Top Level Domain) server directs the resolver to Google's name servers.
  6. Authoritative DNS Server: Finally, Google's DNS server returns the IP address for www.google.com.
  7. Response Propagation: This IP is passed back through the chain to your browser, which now knows where to send the request.

2. IP Addresses

Once the domain name is resolved, your browser now has an IP address — for instance, 142.250.182.132. This is the address of the server that will respond to your HTTP/HTTPS request.

2.1 Types of IP Addresses

  • IPv4: 32-bit numeric addresses (e.g., 192.168.0.1). These are most common but limited in quantity.
  • IPv6: 128-bit alphanumeric addresses (e.g., 2001:db8::ff00:42:8329). Introduced to overcome IPv4 exhaustion.

IP addresses are how data is routed between machines across the internet.

3. Public IPs

Every device that communicates over the internet uses either a public or private IP address:

  • Public IP: Assigned by your ISP, this is the address visible to other machines on the internet.
  • Private IP: Used within internal networks. These are non-routable outside your local network (e.g., 192.168.x.x, 10.x.x.x).

When you visit a site like Google, your request originates from your private IP but appears to Google as coming from your public IP due to NAT (Network Address Translation) on your router.

4. Static vs Dynamic IPs

  • Static IPs: Permanently assigned and never change. Often used for servers and important infrastructure.
  • Dynamic IPs: Temporarily assigned using DHCP. Common for home users, they can change after lease expiry or router reboot.

Google’s servers use static IPs or DNS load balancing to consistently respond to user requests, ensuring high availability and reliability.

5. Hosting a Server on Your Machine

You can host a web server on your local machine if you want to serve content or build a web application. Here’s how:

5.1 Steps to Host:

  1. Install a web server (e.g., Apache, Nginx, or Node.js).
  2. Assign your system a static local IP.
  3. Configure the server to listen on a port (typically 80 for HTTP, 443 for HTTPS).
  4. Use port forwarding on your router to expose this server to the internet.
  5. Obtain a static public IP from your ISP (optional, but preferred for consistent access).
  6. Update your firewall to allow inbound requests on required ports.
  7. (Optional) Link a domain to your public IP using DNS A or CNAME records.

5.2 What Happens After Getting a Static Public IP?

Once you have a static public IP:

  • Anyone on the internet can reach your server using that IP.
  • When a client types your domain (linked to that IP), DNS resolves it, and the request is routed to your public IP.
  • Your router uses port forwarding rules to send the traffic to your local machine’s IP and specific port (e.g., port 80).
  • Your web server receives the request and processes it (e.g., serves an HTML page).

⚠️ Security Warning: Make sure your machine is secured:

  • Keep the OS and software updated
  • Use firewalls, rate limiting, and request validation
  • Regularly monitor access logs


Making own machine server Sequence Diagram

6. Socket Address and Ports

When your request reaches the server, it needs to know which process or application should handle it. This is where ports come in.

A socket address is made up of:

  • IP address: Identifies the host machine.
  • Port number: Identifies the specific application on that machine.

Common Ports:

  • 80 – HTTP (unsecured web traffic)
  • 443 – HTTPS (secured web traffic)
  • 22 – SSH

When you access https://www.google.com, your browser sends the request to port 443 on Google’s server. The operating system on the server uses this port number to forward the request to the correct process — typically a web server like Apache or Nginx.

7. Handling Increased Traffic

Websites like Google serve millions of users every second. Here’s how they manage that scale:

7.1 Scalability Strategies

  • Horizontal Scaling: Adding more servers to distribute the load.
  • Vertical Scaling: Increasing the hardware capacity of a single server.
  • Caching: Use of in-memory caches (like Redis, Memcached) to serve repeat requests faster.
  • Database Optimization: Sharding, indexing, replication.
  • Content Delivery Networks (CDNs): Serve static assets from geographically distributed nodes closer to the user.
  • Auto-Scaling: Automatically add/remove servers based on demand using cloud platforms like AWS, GCP, or Azure.

8. Load Balancers

A load balancer acts as a traffic director, sitting between clients and servers.

8.1 How It Works:

  • Accepts incoming requests.
  • Distributes them to one of several backend servers.
  • Keeps track of server health and removes unhealthy instances.

8.2 Load Balancing Algorithms:

  • Round Robin: Distributes requests in rotation.
  • Least Connections: Sends request to the server with the fewest active connections.
  • IP Hashing: Routes based on client's IP.

8.3 The Load Balancer Bottleneck

While load balancers enhance scalability and reliability, they can themselves become a single point of failure (SPOF).

How to Mitigate:

  • Use redundant load balancers in active-passive or active-active configuration.
  • Leverage DNS-level load balancing.
  • Deploy Global Server Load Balancing (GSLB) to manage traffic across data centers.


Final Thoughts

The simple act of typing www.google.com kicks off a fascinating orchestration of technology involving name resolution, IP routing, port targeting, and multi-layered architecture to deliver content reliably and securely.

Understanding this process is not just intellectually satisfying, but also essential for developers, SREs, DevOps engineers, and anyone building internet-scale applications.

Next time you hit Enter on a URL, you’ll know that a whole world of protocols and systems just sprang into action to serve your request — in a matter of milliseconds.


Read this Far? Feel free to comment your queries and also do follow if you love to read Real World System Design articles!


To view or add a comment, sign in

Others also viewed

Explore topics