<?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[What is DNS and why DNS resolution exist]]></title><description><![CDATA[What is DNS and why DNS resolution exist]]></description><link>https://what-is-dns-and-why-dns-resolution-exist.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Fri, 26 Jun 2026 16:34:25 GMT</lastBuildDate><atom:link href="https://what-is-dns-and-why-dns-resolution-exist.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[What is DNS and why name resolution exists]]></title><description><![CDATA[We use browsers in our day-to-day life to search for websites, but we rarely think about how a browser loads a website in milliseconds. How does the browser know where a website is hosted?What really happens behind the scenes when you type a URL?
In ...]]></description><link>https://what-is-dns-and-why-dns-resolution-exist.hashnode.dev/what-is-dns-and-why-name-resolution-exists</link><guid isPermaLink="true">https://what-is-dns-and-why-dns-resolution-exist.hashnode.dev/what-is-dns-and-why-name-resolution-exists</guid><category><![CDATA[#DNS Resolution]]></category><category><![CDATA[dns server]]></category><category><![CDATA[dig]]></category><dc:creator><![CDATA[Amardeep Kumar]]></dc:creator><pubDate>Thu, 22 Jan 2026 13:34:37 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769780624951/44cfc21c-ed67-4616-8bdb-a2bd0e0930c0.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<hr />
<p>We use browsers in our day-to-day life to search for websites, but we rarely think about <strong>how a browser loads a website in milliseconds</strong>. How does the browser know <strong>where a website is hosted</strong>?<br />What really happens behind the scenes when you type a URL?</p>
<p>In this blog, we’ll understand <strong>how a browser finds a website</strong>, what <strong>DNS</strong> is, and <strong>why DNS resolution exists</strong>. We’ll also look at <strong>why DNS is called a recursive system</strong>, step by step, in simple way.</p>
<p>Let’s begin.</p>
<h2 id="heading-what-is-dns-and-why-do-we-use-it">What Is DNS and Why Do We Use It?</h2>
<p>DNS stands for (Domain Name System) it is the heart of the browser. without DNS using the web would be extremely difficult.</p>
<h3 id="heading-why-dns-exists">Why DNS Exists</h3>
<ul>
<li><p>Computers do not understand domain names like <a target="_blank" href="http://google.com"><code>google.com</code></a></p>
</li>
<li><p>Computers only understand IP addresses like <code>142.250.190.14</code></p>
</li>
</ul>
<p>Human can’t remember the IP, So DNS acts as a translator between the Human-readable domain names to Machine-readable IP addresses</p>
<p>When you type a domain name into a browser, DNS answers this question:</p>
<blockquote>
<p><strong>“What is the IP address of this domain?”</strong></p>
</blockquote>
<p>Once the browser gets the IP address, it can connect to the server using HTTP or HTTPS and load the website.</p>
<h3 id="heading-why-dns-is-called-the-phonebook-of-the-internet">Why DNS is called the Phonebook of the Internet</h3>
<p>let’s understand it using an example:</p>
<p>Whenever you call someone, you type their name, but your phone understands the person's number. You save a number with a name in your phone.</p>
<p>The same thing happens with the internet; it only understands IP addresses. That's why DNS is used to find the IP of a domain; it acts as the internet's phonebook.</p>
<h2 id="heading-how-does-dns-resolution-happen">How Does DNS Resolution Happen?</h2>
<p>Now the big question:</p>
<blockquote>
<p>DNS does not store all IP addresses — so how does it find them?</p>
</blockquote>
<p>DNS works in layers, using a process called <strong>DNS Resolution</strong>.</p>
<h3 id="heading-step-1-browser-cache">Step 1: Browser cache</h3>
<p>When you enter a domain (e.g., <a target="_blank" href="http://example.com"><code>google.com</code></a>). The browser first checks: Have I visited this site before? If the IP is cached, the process stops here, browser directly render from here.</p>
<h3 id="heading-step-2-recursive-dns-server">Step 2: Recursive DNS Server</h3>
<p>If the IP not found in cached, then Browser goes to the Recursive DNS server.</p>
<p>It usually provided by:</p>
<ul>
<li><p>ISP</p>
</li>
<li><p>Public DNS (Google, Cloudflare, etc.)</p>
</li>
</ul>
<p>That’s why it’s called Recursive DNS because it keeps asking other servers until the IP is found.</p>
<p>The browser does not talk to root or TLD servers directly — the recursive DNS does this work.</p>
<h3 id="heading-step-3-root-dns-server">Step 3: Root DNS Server</h3>
<p>The recursive DNS server first contacts a Root DNS Server and asks:</p>
<blockquote>
<p>“What is the IP address of <a target="_blank" href="http://google.com"><code>google.com</code></a>?”</p>
</blockquote>
<p>The root server replies:</p>
<ul>
<li><p>“I don’t know the IP address”</p>
</li>
<li><p>“But I know where <code>.com</code> domains are managed”</p>
</li>
</ul>
<p>It returns the <strong>Name Servers (NS)</strong> of the <code>.com</code> TLD.</p>
<h3 id="heading-step-4-tld-top-level-domain-server">Step 4: TLD (Top Level Domain) Server</h3>
<p>Next, the recursive DNS server contacts the <code>.com</code> TLD server and asks:</p>
<blockquote>
<p>“What is the IP address of <a target="_blank" href="http://google.com"><code>google.com</code></a>?”</p>
</blockquote>
<p>The TLD server replies:</p>
<ul>
<li><p>“I don’t owner this domain”</p>
</li>
<li><p>“But here are the authoritative name servers for <a target="_blank" href="http://google.com"><code>google.com</code></a>”</p>
</li>
</ul>
<h3 id="heading-step-5-authoritative-dns-server">Step 5: Authoritative DNS Server</h3>
<p>Finally, the recursive DNS server contacts the Authoritative DNS Server and asks:</p>
<blockquote>
<p>“What is the IP address of <a target="_blank" href="http://google.com"><code>google.com</code></a>?”</p>
</blockquote>
<p>This server replies with the real DNS record, for example:</p>
<pre><code class="lang-apache"><span class="hljs-attribute">A</span> record → <span class="hljs-number">142.250.190.14</span>
</code></pre>
<p>This server is the <strong>source of truth</strong> and stores all DNS records, such as:</p>
<ul>
<li><p>A / AAAA records</p>
</li>
<li><p>NS records</p>
</li>
<li><p>MX records</p>
</li>
<li><p>TXT records</p>
</li>
</ul>
<h3 id="heading-step-6-response-to-browser">Step 6: Response to Browser</h3>
<p>After finding the IP of the Domain (<code>google.com</code>) then Recursive DNS send back IP to the Browser</p>
<p>And Browser makes an HTTP/HTTPS request</p>
<ul>
<li><p>Receives the response</p>
</li>
<li><p>Renders the webpage</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769088582072/beca2f6c-9f44-4b15-92fc-17e94b594caa.png" alt class="image--center mx-auto" /></p>
<p>So, this is the process of finding the IP address of a domain name. Now we understand the <code>dig</code> command.</p>
<h2 id="heading-what-is-dig">What is dig?</h2>
<p>Until now, we have seen how DNS resolution works internally.<br />But how can we inspect this process and see, how an IP address is actually found?</p>
<p><code>dig</code> stands for (Domain Information Groper) allows you to:</p>
<ul>
<li><p>Query DNS servers directly</p>
</li>
<li><p>See how a domain name is resolved</p>
</li>
<li><p>Inspect DNS records (A, NS, MX, TXT, etc.)</p>
</li>
<li><p>Understand the DNS hierarchy</p>
</li>
</ul>
<h3 id="heading-why-use-dig">Why Use <code>dig</code>?</h3>
<p>When you type a domain name in a browser, DNS resolution happens silently in the background.<br /><code>dig</code> reveals this hidden process and shows what each DNS server returns.</p>
<p>Example:</p>
<h3 id="heading-dig-ns"><code>dig . NS</code></h3>
<p><strong>This command gives Root Name Servers (The Top of DNS)</strong></p>
<pre><code class="lang-apache"><span class="hljs-attribute">dig</span> . NS
</code></pre>
<p><strong>What this command means</strong></p>
<ul>
<li><p><code>.</code> represents the root zone</p>
</li>
<li><p><code>NS</code> asks: <em>“Who are the name servers for the root?”</em></p>
</li>
</ul>
<p>You’ll get results like:</p>
<pre><code class="lang-apache"><span class="hljs-attribute">a</span>.root-servers.net
<span class="hljs-attribute">b</span>.root-servers.net
<span class="hljs-attribute">c</span>.root-servers.net
...
</code></pre>
<h3 id="heading-dig-com-ns"><code>dig com NS</code></h3>
<p><strong>This command gives TLD Name Servers (</strong><code>.com</code><strong>)</strong></p>
<pre><code class="lang-apache"><span class="hljs-attribute">dig</span> com NS
</code></pre>
<p><strong>What this command means</strong></p>
<ul>
<li><p><code>com</code> = Top-Level Domain</p>
</li>
<li><p><code>NS</code> asks: <em>“Who manages the</em> <code>.com</code>?”</p>
</li>
</ul>
<p>You see the Output like:</p>
<pre><code class="lang-apache"><span class="hljs-attribute">a</span>.gtld-servers.net
<span class="hljs-attribute">b</span>.gtld-servers.net
<span class="hljs-attribute">c</span>.gtld-servers.net
...
</code></pre>
<h3 id="heading-dig-googlecom-ns"><code>dig google.com NS</code></h3>
<p><strong>This command gives Authoritative Name Servers</strong></p>
<pre><code class="lang-apache"><span class="hljs-attribute">dig</span> google.com NS
</code></pre>
<p><strong>What this command means</strong></p>
<p>It asks: <em>“Who is authoritative for google.com?”</em></p>
<p>You see the Output like:</p>
<pre><code class="lang-apache"><span class="hljs-attribute">ns1</span>.google.com
<span class="hljs-attribute">ns2</span>.google.com
<span class="hljs-attribute">ns3</span>.google.com
<span class="hljs-attribute">ns4</span>.google.com
</code></pre>
<h3 id="heading-dig-googlecom"><code>dig google.com</code></h3>
<p><strong>This command gives only the final answer about the domain google.com.</strong> It basically returns the <strong>I</strong>P address (A / AAAA record), Query time, DNS server used and TTL</p>
<pre><code class="lang-apache"><span class="hljs-attribute">dig</span> google.com
</code></pre>
<p>You see the Output like:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769021742368/4116124c-4f57-4023-81ef-8ba216e0f4a8.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-what-ns-records-do-and-why-they-are-important">What NS records do and why they are important</h2>
<p><strong>NS (Name Server) records</strong> are one of the most important DNS records.<br />It is responsible for navigation inside the DNS system.</p>
<p>In simple words:</p>
<blockquote>
<p>NS records tell DNS which server is responsible for a domain.</p>
</blockquote>
<p>Without NS records, DNS resolution cannot move forward, and the IP address of a domain can never be found.</p>
<hr />
<p>DNS resolution works like a chain.<br />At each level, DNS servers do not give the IP address directly they say:</p>
<blockquote>
<p>“I am not the owner of that domain, but I know who is.”</p>
</blockquote>
<p>That information is provided using <strong>NS records</strong>.</p>
<p>If NS records did not exist: Recursive DNS server does not know where to go next, DNS resolution would stop immediately. The browser would never get an IP address</p>
<p>So, DNS resolution would never start properly without NS records.</p>
<h2 id="heading-conclusion">Conclusion</h2>
<p>DNS is crucial because, without it, browsers can't find the IP address of a domain. Converting a domain name into an IP address, known as DNS resolution, involves multiple steps and layers to ensure users can access websites efficiently. The DNS system acts like the internet's phonebook, guiding browsers to the correct servers. Tools like <code>dig</code> help us inspect the DNS resolution process.</p>
<p>If you want to learn about DNS records, you can check out this blog: <a target="_blank" href="https://dns-records-how-websites-are-found.hashnode.dev/">DNS Records: How Websites Are Found</a>.</p>
]]></content:encoded></item></channel></rss>