<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: MITESH KUMAR  ANSHU</title>
    <description>The latest articles on DEV Community by MITESH KUMAR  ANSHU (@miteshanshu).</description>
    <link>https://dev.to/miteshanshu</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3513981%2F78ef4537-e6c9-4e62-a128-edbc18aeaa0c.jpg</url>
      <title>DEV Community: MITESH KUMAR  ANSHU</title>
      <link>https://dev.to/miteshanshu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/miteshanshu"/>
    <language>en</language>
    <item>
      <title>What happens when you enter a URL in your browser?</title>
      <dc:creator>MITESH KUMAR  ANSHU</dc:creator>
      <pubDate>Sat, 31 Oct 2026 04:01:56 +0000</pubDate>
      <link>https://dev.to/miteshanshu/what-happens-when-you-enter-a-url-in-your-browser-4a4a</link>
      <guid>https://dev.to/miteshanshu/what-happens-when-you-enter-a-url-in-your-browser-4a4a</guid>
      <description>&lt;p&gt;You type &lt;code&gt;dev.to&lt;/code&gt;, press Enter, and the page is there in about a second. It feels instant, so we never think about it. But a lot happens in that small gap, and it is worth knowing, because this one question quietly covers DNS, TCP, TLS, HTTP and how browsers paint pixels.&lt;/p&gt;

&lt;p&gt;Let us go through it step by step. Everything below comes from a real test run against &lt;code&gt;dev.to&lt;/code&gt;, and every command is included, so you can run the same checks on any site you like.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: The browser reads the URL
&lt;/h2&gt;

&lt;p&gt;Before any network work, the browser parses what you typed.&lt;/p&gt;

&lt;p&gt;A URL like &lt;code&gt;https://dev.to/some-article&lt;/code&gt; has three parts: the scheme (&lt;code&gt;https&lt;/code&gt;), the host (&lt;code&gt;dev.to&lt;/code&gt;) and the path (&lt;code&gt;/some-article&lt;/code&gt;). The scheme tells the browser which port to use by default. HTTPS means port 443, plain HTTP means port 80.&lt;/p&gt;

&lt;p&gt;The browser also checks two local things first. Does it already have this page cached? And does this site insist on HTTPS? Browsers ship with a preload list of sites that must only load over HTTPS, and a site can also tell the browser the same thing with a response header called HSTS. Either way, even typing &lt;code&gt;http://&lt;/code&gt; can get quietly upgraded to &lt;code&gt;https://&lt;/code&gt; before anything leaves your machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: DNS, or turning a name into an address
&lt;/h2&gt;

&lt;p&gt;Computers do not talk to names. They talk to IP addresses. So the browser needs to resolve &lt;code&gt;dev.to&lt;/code&gt; into an IP, and that job belongs to DNS.&lt;/p&gt;

&lt;p&gt;The lookup usually ends in a cache. Typically the browser checks its own DNS cache, then asks the operating system, which checks its cache and the hosts file, then the router, then a recursive resolver, usually run by your ISP or a public service like 1.1.1.1 or 8.8.8.8. Most lookups are answered somewhere along that chain and never go further. Browsers can also skip some of these layers, for example when they use DNS over HTTPS and ask a resolver directly.&lt;/p&gt;

&lt;p&gt;If nobody has it cached, the resolver does the full walk itself: it asks a root server which servers handle &lt;code&gt;.to&lt;/code&gt;, asks the &lt;code&gt;.to&lt;/code&gt; servers which ones handle &lt;code&gt;dev.to&lt;/code&gt;, then asks that authoritative server for the records.&lt;/p&gt;

&lt;p&gt;Here is the real answer for &lt;code&gt;dev.to&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ dig dev.to A

;; ANSWER SECTION:
dev.to.   300  IN  A  151.101.66.217
dev.to.   300  IN  A  151.101.130.217
dev.to.   300  IN  A  151.101.2.217
dev.to.   300  IN  A  151.101.194.217
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Four IP addresses, not one. The &lt;code&gt;300&lt;/code&gt; is the TTL, the number of seconds this answer may be cached before anyone asks again. Those addresses belong to Fastly, a content delivery network, so the request will typically be routed to a Fastly edge location close to you rather than one far-away server. The infrastructure is already working in the site's favour before a single page byte has moved.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: TCP says hello
&lt;/h2&gt;

&lt;p&gt;Now the browser opens a connection to one of those IPs on port 443. Classic TCP does this with a three-way handshake:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Your machine sends a SYN packet. "I want to talk."&lt;/li&gt;
&lt;li&gt;The server replies with SYN-ACK. "Heard you, I am ready."&lt;/li&gt;
&lt;li&gt;Your machine sends ACK. "Great, let us begin."&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That is one full round trip before any real data moves. If the server is 50 milliseconds away, the handshake alone costs 50 milliseconds. This is why connection reuse matters so much on the web.&lt;/p&gt;

&lt;p&gt;One note: HTTP/3 skips this. It runs over QUIC, which is built on UDP and folds the transport and encryption setup together. But the connection in our test was classic TCP, so let us stay on that path.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: TLS makes it private
&lt;/h2&gt;

&lt;p&gt;HTTPS means the connection gets encrypted with TLS before any HTTP happens. The short version of the handshake:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your browser sends a Client Hello: the TLS versions and cipher suites it supports.&lt;/li&gt;
&lt;li&gt;The server replies with a Server Hello and its certificate. The browser checks that the name on the certificate matches the host it asked for, that the certificate is still valid, and that its signatures chain up to a certificate authority the browser already trusts. Only then does it treat the other end as the real &lt;code&gt;dev.to&lt;/code&gt; and not someone pretending.&lt;/li&gt;
&lt;li&gt;Both sides run a key exchange such as ECDHE and derive the same session keys. Once the handshake completes, the actual page data travels encrypted with those keys.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;From the real test run, using &lt;code&gt;curl -sv https://dev.to&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;* SSL connection using TLSv1.2 / ECDHE-RSA-CHACHA20-POLY1305
* ALPN, server accepted to use h2
*  subject: CN=dev.to
*  issuer: C=BE; O=GlobalSign nv-sa; CN=GlobalSign Atlas R46 DV TLS CA 2026 Q4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Those four lines cover most of the story. The encryption is TLS 1.2 with the ECDHE key exchange and the ChaCha20-Poly1305 cipher. The certificate says &lt;code&gt;CN=dev.to&lt;/code&gt;, issued by GlobalSign. Modern sites usually negotiate TLS 1.3, which finishes in fewer round trips, but 1.2 is still common and correct.&lt;/p&gt;

&lt;p&gt;One more detail hides in there: &lt;code&gt;ALPN, server accepted to use h2&lt;/code&gt;. During the handshake, the browser and server also agreed to speak HTTP/2. They negotiated the protocol inside TLS, with no extra round trip.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: The actual HTTP request
&lt;/h2&gt;

&lt;p&gt;Only now does the browser ask for the page. On HTTP/2 the request is not sent as plain text but as binary frames, though what it means is simple enough to write down:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;:method: GET
:scheme: https
:authority: dev.to
:path: /
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;plus headers: what formats the browser accepts, cookies if you are logged in, and so on.&lt;/p&gt;

&lt;p&gt;The server answers with a status, headers, and then the HTML. The real response from the test:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="k"&gt;HTTP&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt; &lt;span class="m"&gt;200&lt;/span&gt;
&lt;span class="na"&gt;content-type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;text/html; charset=utf-8&lt;/span&gt;
&lt;span class="na"&gt;server&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Heroku&lt;/span&gt;
&lt;span class="na"&gt;via&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;1.1 heroku-router, 1.1 varnish, 1.1 varnish&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;200&lt;/code&gt; means success. The interesting part is the last two lines. &lt;code&gt;via: ... varnish&lt;/code&gt; says the response passed through Varnish caches, which is the software Fastly's CDN runs on, and &lt;code&gt;server: Heroku&lt;/code&gt; points at where the application itself is hosted. Headers like these are written by the servers in the chain, so they are not proof of the exact route. But they do line up with what DNS suggested in step 2: a Fastly cache in front, an app on Heroku behind it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6: The browser renders the page
&lt;/h2&gt;

&lt;p&gt;The HTML arrives, 279 KB of it in this test, and the browser starts rendering. It does not wait for the whole file. It parses as it downloads:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The HTML is parsed into the DOM, a tree of elements.&lt;/li&gt;
&lt;li&gt;The CSS is parsed into the CSSOM, a tree of styles.&lt;/li&gt;
&lt;li&gt;The two combine into the render tree, which is what actually gets shown.&lt;/li&gt;
&lt;li&gt;Layout works out where every element sits on the screen.&lt;/li&gt;
&lt;li&gt;Paint fills in the pixels, and compositing stacks the layers together.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Meanwhile the HTML points to more resources: stylesheets, scripts, fonts, images. Over HTTP/2 these share the one connection and load in parallel, which is why the ALPN negotiation in step 4 matters. The response even came with &lt;code&gt;Link: ... rel=preload&lt;/code&gt; headers, the server telling the browser which CSS files to start fetching before the HTML parser reaches them.&lt;/p&gt;

&lt;p&gt;One thing can still block all of this: JavaScript. By default, when the parser hits a script tag, it stops, downloads the script and runs it, because the script might change the page. That is why &lt;code&gt;defer&lt;/code&gt; and &lt;code&gt;async&lt;/code&gt; exist.&lt;/p&gt;

&lt;h2&gt;
  
  
  The whole thing, measured
&lt;/h2&gt;

&lt;p&gt;Here is the real timing from the test, with the exact command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;curl &lt;span class="nt"&gt;-so&lt;/span&gt; /dev/null https://dev.to &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-w&lt;/span&gt; &lt;span class="s1"&gt;'dns: %{time_namelookup}s\n'&lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="s1"&gt;'tcp: %{time_connect}s\n'&lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="s1"&gt;'tls: %{time_appconnect}s\n'&lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="s1"&gt;'first_byte: %{time_starttransfer}s\n'&lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="s1"&gt;'total: %{time_total}s\n'&lt;/span&gt;

dns: 0.000590s
tcp: 0.002930s
tls: 0.025648s
first_byte: 0.031225s
total: 0.047441s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One thing trips people up here: these numbers are cumulative checkpoints, not separate stages. So read them as differences. DNS finished in under a millisecond in this run. The TCP handshake took about 2 ms on top of that. TLS added about 23 ms, because it needs its own round trips. The gap from the end of the handshake to the first response byte was about 6 ms, and that gap covers the request travelling out, the server doing its work and the answer starting back. The rest of the HTML took another 16 ms to download.&lt;/p&gt;

&lt;p&gt;Also keep the scope straight: 47 ms is only the HTML document as curl saw it. A real page load also fetches stylesheets, scripts and images and paints the pixels, none of which curl measures here, though a browser overlaps much of that with the HTML download. And the next click on the same site is usually cheaper still, because the browser keeps the connection open and reuses whatever it has already cached.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where this becomes useful
&lt;/h2&gt;

&lt;p&gt;The next time a site feels slow, this sequence is your checklist. Is DNS dragging? The TLS handshake? Is the server slow to send the first byte, or is the page heavy after that? The timing tab in your browser's dev tools breaks a load into exactly these stages, and now you know what each stage is actually doing. That is usually enough to point at the right layer before you change any code.&lt;/p&gt;

&lt;p&gt;It also explains half the performance advice you see around. Keep connections alive, cache aggressively, preload the CSS that matters, defer the JavaScript that does not. Each of those tricks maps to one step in this list.&lt;/p&gt;

&lt;p&gt;Next time a page loads, you will have a decent idea of what those milliseconds were doing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources and further reading
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/Performance/Guides/How_browsers_work" rel="noopener noreferrer"&gt;Populating the page: how browsers work - MDN&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.rfc-editor.org/rfc/rfc9113" rel="noopener noreferrer"&gt;RFC 9113: HTTP/2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.rfc-editor.org/rfc/rfc8446" rel="noopener noreferrer"&gt;RFC 8446: TLS 1.3&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.rfc-editor.org/rfc/rfc6797" rel="noopener noreferrer"&gt;RFC 6797: HTTP Strict Transport Security (HSTS)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>http</category>
      <category>dns</category>
    </item>
  </channel>
</rss>
