Open https://www.google.com in Chrome
Opening a URL like https://www.google.com feels effortless, but under the hood, the browser performs a complex series of operations involving DNS, TCP, TLS, and HTTP. This guide walks through each step — and how to inspect them using terminal.
Full Workflow When Opening a URL
Steps performed by the browser:
- URL parsing
- DNS resolution – Resolves
www.google.comto an IP address. - TCP connection – Connects to port 443 (HTTPS).
- TLS handshake – Establishes a secure session.
- HTTP GET request – Requests content from the server.
- HTTP response – Receives data.
- Rendering – Renders HTML/CSS/JS content.
Inspecting Each Step in Terminal
This guide uses www.google.com in all examples.
1. DNS Resolution via dig
Command:
- Why Are There Multiple IPs? (DNS load balancing or round-robin DNS)
- Google has many servers worldwide to handle billions of requests.
- When I access www.google.com, my system picks one IP from this list (often the closest one).
- This improves availability, speed, and redundancy.
- TTL 87
- my system or browser can cache this DNS response for 87 seconds.
- After that, it must ask the DNS server again (could get different IPs next time).
2. DNS + TCP + TLS + HTTP via curl
| Step | What Happened |
|---|---|
| DNS Resolution | Found multiple IPs, used 142.250.4.103 |
| TCP Connection | Connected to IP:443 |
| TLS Handshake | TLS 1.3 used; cipher CHACHA20-POLY1305 negotiated |
| Certificate Check | Issued by Google Trust; matched domain; verified successfully |
| Protocol Negotiation | Chose HTTP/2 via ALPN |
| HTTP Request | Sent GET / with headers over a secure HTTP/2 channel |
CAfile: /etc/ssl/cert.pem:
This line tells me where curl is looking for trusted Certificate Authorities (CAs) to verify the HTTPS server's certificate. This file is a bundle of trusted root certificates, pre-installed by my operating system (usually macOS or Linux). It allows curl (or any SSL/TLS library like OpenSSL or SecureTransport) to say: Do I trust the certificate from www.google.com? Let me check if it's signed by someone I trust (e.g., Google Trust Services
| Item | Explanation |
|---|---|
CAfile: |
Path to the file containing trusted Certificate Authorities (CAs) |
| Used For | Verifying if a server's HTTPS certificate is valid and trusted |
| File Example | /etc/ssl/cert.pem (can vary by OS — e.g., /etc/pki/ca-trust/extracted/ on some distros) |
| Related Option | I can override with curl --cacert /path/to/custom.pem |
* (304) (IN), TLS handshake, Unknown (8):
| Output | Meaning |
|---|---|
TLS handshake, Unknown (8): |
TLS 1.3 server sent an Encrypted Extensions message |
| Why it's “Unknown” | curl -v just doesn’t label it clearly (not a bug, just cosmetic) |
| Is this bad? | ❌ No — it's part of every proper TLS 1.3 connection |
3. View TLS Details via openssl
1 | |
4. Availability via curl
Checking if the server is reachable and what headers it returns: curl -I https://example.com
Debugging the full connection including DNS, TCP, TLS, and HTTP request/response: curl -v https://www.google.com