<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Every Time You Type google.com, This Happens in Under 120ms]]></title><description><![CDATA[A visual breakdown of what happens under the hood every time you type a domain — from browser cache to root nameservers to authoritative DNS, explained for backend engineers.]]></description><link>https://shubhamgore.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6747726d0bcdde3801d3b8fc/071b6c61-f29c-43c9-bead-bb5925b1a64f.png</url><title>Every Time You Type google.com, This Happens in Under 120ms</title><link>https://shubhamgore.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Wed, 09 Sep 2026 15:30:07 GMT</lastBuildDate><atom:link href="https://shubhamgore.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Every Time You Type google.com, This Happens in Under 120ms]]></title><description><![CDATA[Most developers use DNS every single day and never think about it. They type a domain, the page loads, and life goes on.
But when something breaks in production — a deployment that isn't reflecting, a]]></description><link>https://shubhamgore.hashnode.dev/every-time-you-type-google-com-this-happens-in-under-120ms</link><guid isPermaLink="true">https://shubhamgore.hashnode.dev/every-time-you-type-google-com-this-happens-in-under-120ms</guid><dc:creator><![CDATA[Shubham Gore]]></dc:creator><pubDate>Tue, 10 Mar 2026 11:07:49 GMT</pubDate><content:encoded><![CDATA[<p>Most developers use DNS every single day and never think about it. They type a domain, the page loads, and life goes on.</p>
<p>But when something breaks in production — a deployment that isn't reflecting, a service that's suddenly unreachable, a load balancer misconfiguration — DNS is almost always involved. And the engineers who understand it deeply are the ones who debug it in 2 minutes while everyone else is panicking.</p>
<p>This is that breakdown.</p>
<hr />
<h2>The Journey Starts Before Any Network Call</h2>
<p>When you type <code>google.com</code> and hit enter, your browser doesn't immediately go to the internet. It checks closer to home first.</p>
<p><strong>Step 1: Browser Cache</strong></p>
<p>Your browser maintains its own DNS cache. If you visited google.com recently, the answer is already sitting there. No network call happens at all. This is why clearing your browser cache sometimes fixes weird DNS issues.</p>
<p><strong>Step 2: OS Resolver and /etc/hosts</strong></p>
<p>If the browser cache misses, it asks your operating system. The OS first checks the <code>/etc/hosts</code> file — a plain text file on your machine that maps hostnames to IPs manually. This is actually how developers run services locally. You've probably seen entries like:</p>
<pre><code class="language-plaintext">127.0.0.1   localhost
127.0.0.1   myapp.local
</code></pre>
<p>If <code>/etc/hosts</code> has no answer either, the OS hands the query to a recursive resolver.</p>
<hr />
<h2>The Recursive Resolver — The Real Worker</h2>
<p>The recursive resolver is usually your ISP's DNS server, or a public one like Google's <code>8.8.8.8</code> or Cloudflare's <code>1.1.1.1</code>. This is the component that does all the heavy lifting so your browser doesn't have to.</p>
<p>Think of it as a librarian. You ask for a book, and instead of sending you to find it yourself across a massive library, the librarian goes and finds it for you.</p>
<p>Here's how the recursive resolver finds the answer:</p>
<hr />
<h2>The Three-Level Lookup</h2>
<h3>Level 1: Root Nameservers</h3>
<p>The recursive resolver first contacts a Root Nameserver. Here's a fact most engineers don't know — there are only <strong>13 sets</strong> of root nameservers in the entire world, operated by organisations like ICANN, Verisign, and NASA.</p>
<p>But here's the thing — root nameservers don't know the IP of <code>google.com</code>. They don't need to. They only know one thing: who is responsible for <code>.com</code> domains. They point the resolver to the TLD nameserver.</p>
<h3>Level 2: TLD Nameservers</h3>
<p>The TLD (Top Level Domain) nameserver handles all <code>.com</code> domains. Again, it doesn't know the IP of <code>google.com</code> specifically. But it knows which <strong>Authoritative Nameserver</strong> is responsible for <code>google.com</code>. It returns that information to the resolver.</p>
<h3>Level 3: Authoritative Nameserver</h3>
<p>This is where the actual answer lives. The Authoritative Nameserver for <code>google.com</code> holds the DNS records — including the A record that maps <code>google.com</code> to an IP address like <code>142.250.80.46</code>.</p>
<p>This IP address travels back through the chain to the recursive resolver, which caches it, and then sends it back to your browser. Your browser now has an IP address and can make the actual HTTP connection.</p>
<p><strong>Total round trip: 20 to 120ms.</strong></p>
<p>After that, the result is cached based on TTL so future lookups skip most of this entirely.</p>
<hr />
<h2>What Backend Engineers Actually Need to Know</h2>
<p>Understanding the mechanics is one thing. Knowing how it affects your day-to-day work is another.</p>
<h3>1. TTL Is a Double-Edged Sword</h3>
<p>TTL (Time To Live) controls how long DNS results are cached at every layer — browser, OS, recursive resolver.</p>
<p>Set it too <strong>high</strong> and your deployments take hours to propagate to users. You push a fix, but users are still hitting the old IP because every resolver on the internet has cached the old answer.</p>
<p>Set it too <strong>low</strong> and you're generating excessive load on your nameservers. Every lookup skips the cache and hits the authoritative server directly.</p>
<p><strong>The practical rule:</strong> Lower your TTL to 300 seconds (5 minutes) a few hours before any major deployment or IP migration. After it's stable, raise it back to 3600 or higher.</p>
<h3>2. DNS Record Types You Touch Every Day</h3>
<table>
<thead>
<tr>
<th>Record</th>
<th>Purpose</th>
<th>When You Use It</th>
</tr>
</thead>
<tbody><tr>
<td>A</td>
<td>Maps domain → IPv4 address</td>
<td>Pointing your domain to a server IP</td>
</tr>
<tr>
<td>AAAA</td>
<td>Maps domain → IPv6 address</td>
<td>IPv6 support</td>
</tr>
<tr>
<td>CNAME</td>
<td>Maps domain → another domain</td>
<td>Subdomains, CDN configuration</td>
</tr>
<tr>
<td>MX</td>
<td>Mail exchange server</td>
<td>Email routing</td>
</tr>
<tr>
<td>TXT</td>
<td>Arbitrary text</td>
<td>SSL verification, SPF, DKIM</td>
</tr>
</tbody></table>
<p>Every time you deploy on AWS, configure a load balancer, or set up CloudFront, you're creating or modifying these records. Understanding what each one does stops you from blindly following documentation and actually understanding what you're configuring.</p>
<h3>3. GeoDNS — DNS as a Traffic Router</h3>
<p>Here's where DNS gets powerful at scale. GeoDNS allows authoritative nameservers to return <strong>different IP addresses</strong> based on where the request is coming from geographically.</p>
<p>A user in Mumbai hits <code>api.yourapp.com</code> and gets routed to a server in Singapore. A user in New York gets routed to a server in Virginia. Same domain, different IPs, automatic routing based on location.</p>
<p>This is how global companies serve low-latency responses worldwide without users configuring anything.</p>
<h3>4. Debugging DNS in Production</h3>
<p>When something is "down" in production, before you start restarting services and checking logs — check DNS first. Two commands will tell you the truth faster than any dashboard:</p>
<p>bash</p>
<pre><code class="language-bash"># Check what IP a domain resolves to
dig google.com

# Query a specific nameserver directly
dig @8.8.8.8 google.com

# Check DNS propagation across the world
dig google.com +trace

# Old school but still useful
nslookup google.com
</code></pre>
<p>The <code>+trace</code> flag on <code>dig</code> is especially powerful — it shows you the full resolution chain from root nameserver down to authoritative nameserver. If something is broken in that chain, <code>dig +trace</code> will show you exactly where.</p>
<hr />
<h2>Why This Matters More Than You Think</h2>
<p>DNS failures are silent and brutal. Your application code can be perfect. Your servers can be healthy. But if DNS is misconfigured or propagating slowly, users see nothing.</p>
<p>Every backend engineer who has done an on-call rotation has a DNS story. A deployment that didn't propagate. A CNAME pointing to a deleted resource. A TTL set to 86400 seconds that made a migration take a full day instead of an hour.</p>
<p>Understanding DNS at this level means you debug faster, deploy more confidently, and design systems with DNS as a first-class concern rather than an afterthought.</p>
<p>Next time you type <code>google.com</code>, you'll know exactly what's happening in those 120 milliseconds.</p>
<hr />
<p><em>If this was useful, I write about backend engineering, distributed systems, and things I learn building production systems. Follow along.</em></p>
<hr />
<p><strong>Tags:</strong> #SystemDesign #DNS #BackendEngineering #Java #DistributedSystems #LearningInPublic</p>
]]></content:encoded></item></channel></rss>