Sobes.tech
Senior

What happens when a URL is entered into a browser? How does DNS resolution work?

sobes.tech AI

Answer from AI

Entering a URL in a browser involves several sequential steps:

  1. Parsing the URL — the browser breaks down the entered address into parts: protocol (http/https), domain name, path, parameters.

  2. DNS resolution — the browser needs to find out the IP address of the server by the domain name:

    • First, it checks the local DNS cache.
    • If not found, a request is sent to the configured DNS server (usually the provider's).
    • DNS servers recursively search for the IP, starting from root servers, then top-level domain (TLD) servers, and finally authoritative DNS servers for the domain.
    • The obtained IP is returned to the browser.
  3. Establishing a TCP connection with the server using the obtained IP and port (usually 80 for HTTP or 443 for HTTPS).

  4. TLS handshake (if HTTPS) — a secure connection is established.

  5. Sending an HTTP request — the browser sends a request to the server.

  6. Receiving a response — the server returns HTML, CSS, JS, and other resources.

  7. Rendering the page — the browser processes the received data and displays the page.

DNS resolution is the process of converting a domain name into an IP address, necessary for establishing a network connection. It is based on a hierarchical system of DNS servers and caching to speed up repeated requests.

What happens when a URL is entered into a browser… - sobes.tech