AWS Builder Center

# What Happens When You Type a URL into Your Browser? A Journey Behind Every Web Request

Have you ever wondered what happens behind the scenes when you type a website address into your browser and press Enter? From DNS lookup and TCP connections to HTTP requests, web servers, and browser rendering, discover the step-by-step journey that makes a webpage appear on your screen. A beginner-friendly guide to understanding how the internet works.

What Happens When You Type a URL into Your Browser? A Journey Behind Every Web Request

Introduction

Have you ever wondered what happens when you type  www.example.com  into your browser and press Enter?
Within seconds, the website appears on your screen. It feels simple, but several processes take place behind the scenes to make this happen.
Your browser communicates with DNS servers, establishes network connections, sends HTTP requests, receives responses from web servers, and finally displays the webpage.
In this article, let's explore this complete journey step by step in a beginner-friendly way.

1. Understanding a URL

A URL (Uniform Resource Locator) is the address used to access a resource on the internet.
For example:
 https://www.example.com/products 
A URL generally contains these parts:
  • Protocol: HTTPS defines how the browser communicates securely with the server.
  • Domain name:  www.example.com  identifies the website.
  • Path:  /products  identifies the requested resource.
The browser uses this information to understand where and how to send the request.

2. DNS Lookup – Finding the Server's IP Address

Computers communicate with each other using IP addresses, but humans find domain names easier to remember.
For example, we type  www.example.com  instead of remembering an IP address.
This is where DNS (Domain Name System) comes in.
DNS works like the phonebook of the internet. It translates domain names into IP addresses.
The browser and operating system may first check their existing DNS caches. If the address is not available, a DNS query is sent to a DNS resolver, which helps locate the correct IP address.
Once the IP address is found, the browser knows where to send the request.

3. Establishing a Connection

After discovering the server's IP address, the browser establishes a connection.
For traditional HTTPS over TCP, this involves two important processes.
TCP Three-Way Handshake
TCP (Transmission Control Protocol) establishes a reliable connection between the browser and the server.
It involves three steps:
  1. SYN – The browser requests a connection.
  1. SYN-ACK – The server acknowledges the request.
  1. ACK – The browser confirms the connection.
Now, a TCP connection is established.
TLS Handshake
Since the website uses HTTPS, the browser and server also perform a TLS handshake.
TLS (Transport Layer Security) helps establish encryption and verify the server's identity using its digital certificate.
This protects information exchanged between the browser and server.
Note: Some websites use HTTP/3, which uses QUIC over UDP instead of TCP. The connection setup differs in that case.

4. Sending an HTTP Request

Once the connection is ready, the browser sends an HTTP request to the server.
HTTP stands for Hypertext Transfer Protocol.
For example:
 GET /products HTTP/1.1 
This request tells the server that the browser wants to retrieve the products page.
An HTTP request may contain:
  • Request method (GET, POST, PUT, DELETE).
  • Request URL or path.
  • Headers containing additional information.
  • An optional request body.
The server receives the request and determines what response should be returned.

5. Server Processing

The web server receives the HTTP request and processes it.
Depending on the application, it may:
  • Identify the requested resource.
  • Execute backend application logic.
  • Retrieve information from a database.
  • Validate user information.
  • Generate the appropriate response.
For example, when you open an online shopping website, the backend may retrieve product details and prices from a database.
The server then prepares an HTTP response.

6. Receiving the HTTP Response

After processing the request, the server sends a response to the browser.
An HTTP response generally contains:
  • Status code.
  • Response headers.
  • Response body.
Some common HTTP status codes include:
  • 200 OK: The request was successful.
  • 301 Moved Permanently: The resource has a new permanent URL.
  • 403 Forbidden: Access to the resource is not allowed.
  • 404 Not Found: The requested resource could not be found.
  • 500 Internal Server Error: Something went wrong on the server.
If the request succeeds, the response may contain HTML content that describes the webpage.

7. Browser Rendering – Displaying the Webpage

This is the stage where the browser turns the received content into something users can see and interact with.
The browser:
  1. Parses HTML to build the DOM (Document Object Model).
  1. Parses CSS to build the CSSOM (CSS Object Model).
  1. Combines them to create the render tree.
  1. Calculates the layout and positions of elements.
  1. Paints pixels on the screen.
  1. Composites the different visual layers.
JavaScript may also execute during this process to add dynamic functionality and update the webpage.
The browser may make additional requests for images, fonts, stylesheets, scripts, and other resources.
Finally, the webpage becomes visible and interactive.

8. How AWS Fits into This Process

Cloud platforms such as Amazon Web Services (AWS) provide services that support different stages of delivering a website.
Some useful AWS services include:
  • Amazon Route 53: Provides DNS services to help route domain name requests.
  • Amazon CloudFront: A content delivery network (CDN) that delivers content from edge locations closer to users.
  • Elastic Load Balancing: Distributes incoming application traffic across multiple targets.
  • Amazon EC2: Provides virtual servers to host web applications.
  • AWS Lambda: Runs application code without requiring users to manage servers.
  • Amazon RDS: Provides managed relational database services for storing application data.
These services can work together to build scalable, reliable, and secure web applications.

9. Complete Web Request Flow

Let's summarize the entire process:
  1. User enters a URL in the browser.
  1. Browser identifies the domain and protocol.
  1. DNS resolves the domain name into an IP address.
  1. Browser establishes a network connection.
  1. TLS secures the HTTPS communication.
  1. Browser sends an HTTP request.
  1. Web server processes the request.
  1. Server sends an HTTP response.
  1. Browser processes HTML, CSS, and JavaScript.
  1. The webpage is rendered on the screen.

Conclusion

A simple action like entering a URL involves multiple technologies working together.
DNS helps locate servers, TCP and TLS help establish communication, HTTP enables data exchange, web servers process requests, and browsers transform the received resources into webpages.
Understanding this process provides a strong foundation for learning web development, networking, backend engineering, and cloud computing.
The next time you open a website, remember that an entire journey happens behind that single press of the Enter key!
Keep learning, keep exploring, and keep building! 🚀
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article