What Happens When You Type a URL? DNS, TCP, TLS and HTTP Step by Step

When you type a URL and press Enter, the browser first parses the address and checks whether it must use HTTPS. It then finds the server’s IP address through DNS, using caches first and a resolver if needed. Next it opens a transport connection: TCP for HTTP/1.1 and HTTP/2, or QUIC over UDP for HTTP/3. A TLS 1.3 handshake verifies the server’s certificate and agrees encryption keys.

May 15, 2025 - 12:41
Updated: 
105k

Networking in IT Infrastructure · Lab / project

What Happens When You Type a URL? DNS, TCP, TLS and HTTP Step by Step

Quick answer: When you type a URL and press Enter, the browser first parses the address and checks whether it must use HTTPS. It then finds the server’s IP address through DNS, using caches first and a resolver if needed. Next it opens a transport connection: TCP for HTTP/1.1 and HTTP/2, or QUIC over UDP for HTTP/3. A TLS 1.3 handshake verifies the server’s certificate and agrees encryption keys. The browser sends an HTTP request, the server replies with HTML, and the browser fetches extra files, builds the page and paints it on screen. Each step has its own security checks.

Key takeaways

  • A URL has parts (scheme, host, path, query) defined in RFC 3986.
  • DNS turns the host name into an IP address, often from a cache.
  • HTTP/1.1 and HTTP/2 use TCP; HTTP/3 uses QUIC over UDP.
  • TLS 1.3 proves the server’s identity and encrypts everything after the handshake.
  • Rendering starts as soon as HTML arrives, then pulls in CSS, scripts and images.

Table of Contents

What Does the Browser Do With the URL First?

The browser decides whether you typed a web address or a search phrase. If it is an address, it splits it according to RFC 3986: in https://www.example.com/blog?id=7, the scheme is https, the host is www.example.com, the path is /blog and the query is id=7. If the site is on the browser’s HTTP Strict Transport Security list (RFC 6797), the browser upgrades to HTTPS before sending anything.

How Does DNS Find the Server?

Computers connect to IP addresses, not names. The browser checks its own cache, then the operating system cache. If neither has an answer, a recursive resolver (from your ISP, company or a public service) asks the root servers, then the .com servers, then the domain’s authoritative server, as described in RFC 1035. The answer is cached for its time-to-live. Many browsers can send these queries encrypted using DNS over HTTPS (RFC 8484). Our DNS and DNSSEC guide explains this step in depth.

You can watch a lookup yourself:

nslookup www.example.com
dig www.example.com A +noall +answer

How Is the Connection Opened?

HTTP versionTransportSetup
HTTP/1.1, HTTP/2TCP (RFC 9293)SYN, SYN-ACK, ACK, then a separate TLS handshake
HTTP/3 (RFC 9114)QUIC over UDP (RFC 9000)Transport and TLS 1.3 handshake combined

Browsers usually start with TCP and learn that a server supports HTTP/3 from an Alt-Svc header or a DNS HTTPS record, then switch to QUIC on later connections.

What Happens During the TLS Handshake?

With TLS 1.3, the browser sends a ClientHello with supported cipher suites and a key share. The server replies with its key share, certificate and a signature proving it holds the private key. The browser checks that the certificate chains to a trusted authority, matches the host name and has not expired. Both sides derive the same session keys, and application data is encrypted after one round trip. For more on this part, see our HTTPS step-by-step guide.

What Do the HTTP Request and Response Contain?

Under RFC 9110, a request has a method (GET, POST), a target, and headers such as Host, Accept and Cookie. The response has a status code and headers such as Content-Type, Cache-Control and security headers, followed by the body.

Status classMeaningExample
2xxSuccess200 OK
3xxRedirect301 Moved Permanently
4xxClient error404 Not Found
5xxServer error503 Service Unavailable

To see these headers safely on any public site:

curl -sI https://www.example.com

How Does the Browser Turn the Response Into a Page?

The browser parses HTML into the DOM and CSS into style rules, then fetches linked scripts, fonts and images, often over the same connection. It calculates layout and paints pixels. Scripts can change the page after it loads, which is why some sites keep making requests after the first paint.

Where Can Things Go Wrong, and How Is Each Step Protected?

  • Typosquatted domains: check the address bar; HSTS cannot help with a wrong name.
  • DNS spoofing: DNSSEC and encrypted DNS reduce tampering.
  • Interception: TLS certificate checks stop most attackers in the middle; never click through certificate warnings.
  • Malicious content: browser sandboxing, Content Security Policy and updates limit damage.

To understand each layer through hands-on labs, see our networking and web security training.

References

Frequently Asked Questions

The browser parses the address into scheme, host and path, and checks whether HSTS requires it to use HTTPS.

Computers connect using IP addresses, so DNS translates a human-friendly host name into the IP address of the server.

No. Browsers and operating systems cache DNS answers for their time-to-live, so repeat visits often skip the full lookup.

No. HTTP/3 runs over QUIC, which uses UDP and combines the transport and TLS 1.3 handshakes into one step.

It checks that the server certificate is trusted, matches the host name and is valid, then agrees keys for encryption.

A three-digit number in the response, such as 200 for success or 404 for not found, that tells the browser the result.

HTTPS hides page content and paths, but DNS queries and the server name can still reveal the site unless encrypted.

No. A certificate warning can mean someone is intercepting the connection, so do not enter data or click through it.

What's Your Reaction?

Like Like 0
Dislike Dislike 0
Love Love 0
Funny Funny 0
Wow Wow 0
Sad Sad 0
Angry Angry 0
Vaishnavi

Vaishnavi is a skilled tech professional at the Ethical Hacking Training Institute in Pune, responsible for managing and optimizing the technical infrastructure that supports advanced cybersecurity education. With deep expertise in network security, backend operations, and system performance, she ensures that practical labs, online modules, and assessments run smoothly and securely. Her behind-the-scenes contributions play a vital role in delivering a seamless and secure learning experience for aspiring ethical hackers.