<?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[Networks and DNS]]></title><description><![CDATA[Networks and DNS]]></description><link>https://domain-name-systems.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Mon, 07 Sep 2026 08:38:58 GMT</lastBuildDate><atom:link href="https://domain-name-systems.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Inside TCP: The 3-Way Handshake and Reliable Data Transfer]]></title><description><![CDATA[What happens if we send data with no rules at all?
What happens if we send data without any rules?
Suppose we start sending data on a network without any agreement, rules or order.
Some messages may come in the wrong order.Some messages may not reach...]]></description><link>https://domain-name-systems.hashnode.dev/inside-tcp-the-3-way-handshake-and-reliable-data-transfer</link><guid isPermaLink="true">https://domain-name-systems.hashnode.dev/inside-tcp-the-3-way-handshake-and-reliable-data-transfer</guid><category><![CDATA[TCP]]></category><category><![CDATA[3-way handshake]]></category><category><![CDATA[SYN SYN-ACK ACK]]></category><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Pramith R]]></dc:creator><pubDate>Mon, 26 Jan 2026 14:17:14 GMT</pubDate><content:encoded><![CDATA[<hr />
<h2 id="heading-what-happens-if-we-send-data-with-no-rules-at-all">What happens if we send data with no rules at all?</h2>
<p>What happens if we send data without any rules?</p>
<p>Suppose we start sending data on a network without any agreement, rules or order.</p>
<p>Some messages may come in the wrong order.<br />Some messages may not reach at all.<br />The receiver may not be ready to receive the data.<br />We also won’t know which data was received correctly.</p>
<p>This type of communication works only when accuracy is not important.<br />But in most cases, accuracy is important — like in websites, APIs, online payments, logins, and file sharing.</p>
<p>That is why TCP is used.</p>
<hr />
<h2 id="heading-what-is-tcp-and-why-it-is-needed">What is TCP and why it is needed?</h2>
<p>TCP is like a reliable delivery service for your data. It makes sure everything sent between two computers arrives safely, in the right order, with nothing missing or duplicated. You can think of it as a dependable middleman for any online conversation.</p>
<p>So basically jab bhi two systems data exchange karte hain (like your browser and a website), TCP makes sure data sahi, poora, aur sahi order mein pahuche.</p>
<hr />
<h2 id="heading-what-problems-does-tcp-solve">What Problems Does TCP Solve?</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769118750493/5a4d132a-3e09-4d68-8553-64c052d850c3.jpeg" alt /></p>
<hr />
<h2 id="heading-what-is-the-tcp-3-way-handshake">What is the TCP 3-Way Handshake?</h2>
<p>Before sending any real data, TCP first establishes a connection between client &amp; server.<br />This setup process is called the 3-Way Handshake.</p>
<h3 id="heading-how-does-it-work">How does it work?</h3>
<p>Think of it like starting a phone call</p>
<ol>
<li><p>Client ——&gt; Server (SYN) [SYN means Synchronize]<br /> The client says:<br /> “Hello, I want to talk. Can you hear me?”</p>
</li>
<li><p>Server ——&gt; Client (SYN + ACK) [ACK means Acknowledgement]<br /> The server replies:<br /> “Yes, I can hear you. Can you hear me?”</p>
</li>
<li><p>Client ——&gt; Server (ACK)<br /> The client confirms:<br /> “Yes, I can hear you. Let’s talk.”</p>
</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769119817805/7c9f8315-3472-44b0-9021-390cc102f108.jpeg" alt /></p>
<hr />
<h2 id="heading-step-by-step-process-syn-syn-ack-ack">Step-by-step process : SYN, SYN-ACK, ACK</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769120738855/519f60f2-38b6-4ee8-8ab7-26026274e07a.jpeg" alt /></p>
<p>After 3rd step, both sides are ready &amp; synchronized.</p>
<hr />
<h2 id="heading-how-data-transfer-works-in-tcp">How data transfer works in TCP</h2>
<p>After the connection is established</p>
<ul>
<li><p>Data is split into segments</p>
</li>
<li><p>Each segment gets a sequence number</p>
</li>
<li><p>Receiver sends back ACKs for received data</p>
</li>
<li><p>Sender keeps track of what is acknowledged</p>
</li>
</ul>
<p>TCP does not just send &amp; forget. It sends, waits, checks, &amp; resends if needed.</p>
<hr />
<h2 id="heading-how-tcp-ensures-reliability-order-and-correctness">How TCP ensures reliability, order and correctness</h2>
<p><strong>1. Reliability (No data loss)</strong></p>
<ul>
<li><p>Every segment must be acknowledged</p>
</li>
<li><p>If ACK is not received → retransmission (same data dobara send karta hai.)</p>
</li>
<li><p>Lost packets are detected automatically</p>
</li>
</ul>
<p><strong>2. Order (Correct sequence)</strong></p>
<ul>
<li><p>Sequence numbers define exact order</p>
</li>
<li><p>Receiver reorders packets if needed</p>
</li>
<li><p>Application always receives data in order</p>
</li>
</ul>
<p><strong>3. Correctness</strong></p>
<ul>
<li><p>Each segment includes a checksum</p>
</li>
<li><p>Corrupted data is discarded</p>
</li>
<li><p>Sender retransmits clean data</p>
</li>
</ul>
<p>4. Flow control</p>
<ul>
<li><p>It is a mechanism used in data communication between a sender and a receiver</p>
</li>
<li><p>Receiver tells sender how much data it can handle</p>
</li>
<li><p>Prevents slow receivers from crashing</p>
</li>
</ul>
<hr />
<h2 id="heading-how-a-tcp-connection-is-closed">How a TCP connection is closed</h2>
<p>TCP does not just drop connections. Here dropping a connection means, communication ends abruptly without a clean, expected close. Under normal conditions, TCP does not randomly disconnect. It closes them gracefully using FIN and ACK.</p>
<p><strong>Closing steps :</strong></p>
<ol>
<li><p>One side sends FIN → “I’m done sending data”</p>
</li>
<li><p>Other side sends ACK</p>
</li>
<li><p>Other side sends its own FIN</p>
</li>
<li><p>Final ACK is sent</p>
</li>
</ol>
<p>Connection is now fully closed. This ensures, no data is lost, both sides finish cleanly &amp; resources are released properly</p>
<p>What is FIN —&gt; FIN stands for Finish. In TCP terms,<br />FIN is a flag used to say ——&gt; “I’m done sending data. I don’t have anything more to send.”</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769159413818/fdfbd134-27b5-453d-9e97-e2521ed54d02.png" alt /></p>
<hr />
<p>TCP may be slower than UDP, but it is predictable and safe.</p>
<p>That’s why TCP is used for:</p>
<ul>
<li><p>HTTP / HTTPS</p>
</li>
<li><p>APIs</p>
</li>
<li><p>Databases</p>
</li>
<li><p>File transfers</p>
</li>
<li><p>Emails</p>
</li>
<li><p>Authentication systems</p>
</li>
</ul>
<p>Whenever correctness matters more than speed, TCP wins.</p>
<hr />
]]></content:encoded></item><item><title><![CDATA[TCP vs UDP: When to Use What, and How TCP Relates to HTTP]]></title><description><![CDATA[Internet Runs on Rules
Rules decide how data is sent, how fast & how safely.

What Are TCP and UDP
At a very simple idea, TCP is about reliability and UDP is about speed. They both move data between machines, but they make different tradeoffs (sacrif...]]></description><link>https://domain-name-systems.hashnode.dev/tcp-vs-udp-when-to-use-what-and-how-tcp-relates-to-http</link><guid isPermaLink="true">https://domain-name-systems.hashnode.dev/tcp-vs-udp-when-to-use-what-and-how-tcp-relates-to-http</guid><category><![CDATA[TCP]]></category><category><![CDATA[UDP]]></category><category><![CDATA[http]]></category><category><![CDATA[tcp vs udp]]></category><category><![CDATA[OSI]]></category><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Pramith R]]></dc:creator><pubDate>Sun, 25 Jan 2026 20:41:54 GMT</pubDate><content:encoded><![CDATA[<hr />
<h2 id="heading-internet-runs-on-rules">Internet Runs on Rules</h2>
<p>Rules decide how data is sent, how fast &amp; how safely.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769028981999/d5e11760-01d0-4432-954c-dc058d522ef3.jpeg" alt class="image--center mx-auto" /></p>
<h2 id="heading-what-are-tcp-and-udp">What Are TCP and UDP</h2>
<p>At a very simple idea, TCP is about reliability and UDP is about speed. They both move data between machines, but they make different tradeoffs (sacrifice).<br />TCP trades speed for safety &amp; UDP trades safety for speed.</p>
<p>If we need to explain TCP and UDP in a single line, it can be said like this :</p>
<p>TCP ——&gt; Send this data safely, in order, and make sure nothing is lost.</p>
<p>UDP ——&gt; Send this data as fast as possible. If something is lost, move on.</p>
<hr />
<h2 id="heading-key-differences-between-tcp-and-udp">Key Differences Between TCP and UDP</h2>
<pre><code class="lang-plaintext">| Parameter      |         TCP           |     UDP            |
| -------------- | --------------------- | ------------------ |
| Connection     | Connection-oriented   | Connectionless     |
| Reliability    | Guaranteed delivery   | No guarantee       |
| Order          | Maintains order       | No ordering        |
| Speed          | Slower (extra checks) | Faster (no checks) |
| Overhead       | Higher                | Lower              |
| Retransmission | Yes                   | No                 |
Note:
Connection - Do both sides say hello &amp; stay connected while talking?
Overhead - How much extra effort is spent just to manage the delivery?
Retransmission - If some data gets lost, does the system try again?
</code></pre>
<hr />
<p>Simple Analogies to understand better about TCP and UDP</p>
<h3 id="heading-tcp-courier-service">TCP : Courier Service</h3>
<ul>
<li><p>Package is tracked</p>
</li>
<li><p>Receiver signs for delivery</p>
</li>
<li><p>If lost, it’s resent</p>
</li>
<li><p>Order is preserved</p>
</li>
</ul>
<h3 id="heading-udp-live-announcement">UDP : Live Announcement</h3>
<ul>
<li><p>Message is broadcast</p>
</li>
<li><p>No confirmation</p>
</li>
<li><p>If missed, it’s gone</p>
</li>
<li><p>Speed matters more than accuracy</p>
</li>
</ul>
<p>Both are useful. It depends on what we care about more —&gt; correctness or speed.</p>
<hr />
<h2 id="heading-when-to-use-tcp">When to Use TCP</h2>
<p>We use TCP when data integrity matters. Here data integrity means the received data is complete, accurate &amp; unchanged. nothing missing, nothing changed &amp; in correct order.<br />(e.g. if we send the word “INTERNET“, data integrity means the receiver gets “INTERNET“, not “INTRANET“, “INT ER NET“ or any other variations)</p>
<p>Some practical scenarios where we use TCP</p>
<ul>
<li><p>Web pages</p>
</li>
<li><p>APIs</p>
</li>
<li><p>File downloads</p>
</li>
<li><p>Emails</p>
</li>
<li><p>Database communication</p>
</li>
</ul>
<p>Note: Tradeoff —&gt; yes, it’s slower but correctness beats speed in above mentioned cases.</p>
<hr />
<h2 id="heading-when-to-use-udp">When to Use UDP</h2>
<p>We use UDP when speed &amp; low latency matter more than data integrity.<br />Here, data integrity is not guaranteed — data packets may be lost, duplicated, or arrive out of order &amp; UDP does not try to fix that.</p>
<p>(e.g. if we send the word “INTERNET”, the receiver might get “INTRNET”, “INET”, or even miss it completely — &amp; we still move on)</p>
<p>Some practical scenarios where we use UDP</p>
<ul>
<li><p>Live video streaming</p>
</li>
<li><p>Voice calls</p>
</li>
<li><p>Online multiplayer games</p>
</li>
<li><p>DNS queries</p>
</li>
<li><p>Real-time sensor data / IoT</p>
</li>
</ul>
<p>Note: Tradeoff —&gt; yes, it’s faster &amp; lightweight, but correctness, ordering &amp; reliability r not guaranteed — speed beats correctness in the above cases.</p>
<hr />
<h2 id="heading-common-real-world-examples">Common Real-World Examples</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769068255728/c3311a32-87da-4f1a-a176-b3143ed03d5c.jpeg" alt class="image--center mx-auto" /></p>
<hr />
<h2 id="heading-tcp-vs-udp-communication-flow">TCP vs UDP Communication Flow</h2>
<p>When we use TCP, communication starts only after both sides agree to talk.</p>
<ul>
<li><p>Connection established first<br />  Sender &amp; receiver perform a handshake. It confirms both sides are ready &amp; reachable.</p>
</li>
<li><p>Data sent in small pieces<br />  Large data is broken into smaller packets for easier to manage.</p>
</li>
<li><p>Every packet is acknowledged<br />  receiver confirms which packets arrived successfully.</p>
</li>
<li><p>Lost packets are resent<br />  If something goes missing, TCP sends it again automatically.</p>
</li>
<li><p>Data is reassembled in order<br />  if data packets reach out of order, TCP fixes it before passing data to our application.</p>
</li>
</ul>
<p>UDP works very differently</p>
<ul>
<li><p>No connection setup<br />  data is sent immediately, no handshake, no preparation.</p>
</li>
<li><p>Packets are sent independently<br />  each data packet is treated like a separate message.</p>
</li>
<li><p>No delivery confirmation<br />  sender never checks if the packet arrived.</p>
</li>
<li><p>No retransmission<br />  If any packet lost, it’s simply ignored.</p>
</li>
<li><p>Order is not guaranteed<br />  Packets may reach out of order or not arrive at all.</p>
</li>
</ul>
<hr />
<h2 id="heading-what-is-http-and-where-it-fits">What Is HTTP and Where It Fits</h2>
<p>HTTP is NOT a transport protocol. It is an application-layer protocol. Iska simple meaning, HTTP explain karta hai kya data send karna hai. Request - response ka format kaisa hoga yeh decide karta hai http.  </p>
<p>HTTP fits into the application layer. When we open a website, our browser &amp; web server need a common language to request &amp; send web pages. HTTP is that language, so it belongs to the Application layer.</p>
<hr />
<h2 id="heading-relationship-between-tcp-and-http">Relationship Between TCP and HTTP</h2>
<p>HTTP lives at application layer &amp; TCP lives at transport layer. IP lives below both.</p>
<p>But first try to understand OSI Model.<br />Network communication ko 7 layers me divide kiya gaya hai. Is model ko ek roadmap kaha ja sakta hai jo batata hai humara data network me kaise travel karta hai, layer by layer.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769073441377/5b6a341c-5c89-4a71-8ca0-8b5cc421758a.jpeg" alt class="image--center mx-auto" /></p>
<p><strong>HTTP → Application Layer —&gt;</strong> HTTP bolta hai kya bhejna hai</p>
<p><strong>TCP → Transport Layer —&gt;</strong> TCP bolta hai kaise safely bhejna hai</p>
<p>When we open a website:</p>
<ol>
<li><p>Browser creates an HTTP request</p>
</li>
<li><p>HTTP data passed to TCP</p>
</li>
<li><p>TCP breaks it into packets</p>
</li>
<li><p>IP sends packets over the network</p>
</li>
<li><p>TCP reassembles them at the destination</p>
</li>
<li><p>HTTP processes the response</p>
</li>
</ol>
<hr />
<h2 id="heading-why-http-does-not-replace-tcp">Why HTTP Does Not Replace TCP</h2>
<p>HTTP depends on TCP’s reliability. It doesn’t try to replace it.<br /><strong><mark>HTTP khud data ko safe banane ki tension nahi leta, because TCP ye kaam already karta hai.</mark></strong></p>
<p>HTTP relies on TCP for reliable delivery, packet loss recovery &amp; congestion control (preventing the network from getting too busy) , so it does not handle these itself.</p>
<p><strong>HTTP focuses only on :</strong></p>
<ul>
<li><p>Request methods (GET, POST, etc.)</p>
</li>
<li><p>Headers</p>
</li>
<li><p>Status codes</p>
</li>
<li><p>Response structure</p>
</li>
</ul>
<p>Is HTTP the same as TCP? Clearly No — HTTP says what data is sent, TCP makes sure it arrives safely.</p>
<hr />
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769075124953/aaf57e5d-bed7-4587-a92c-ae169b148f6b.jpeg" alt class="image--center mx-auto" /></p>
<hr />
]]></content:encoded></item><item><title><![CDATA[Understanding Network Devices:
Basic devices that make the internet reach you]]></title><description><![CDATA[How the Internet Reaches our Home or Office
When we open a website, our request doesn’t invisibly reach a server. It passes through multiples chain of network devices with specific job.

Networking is like a moving parcels, not data. Every device exi...]]></description><link>https://domain-name-systems.hashnode.dev/understanding-network-devices-basic-devices-that-make-the-internet-reach-you</link><guid isPermaLink="true">https://domain-name-systems.hashnode.dev/understanding-network-devices-basic-devices-that-make-the-internet-reach-you</guid><category><![CDATA[networking]]></category><category><![CDATA[router]]></category><category><![CDATA[modem]]></category><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Pramith R]]></dc:creator><pubDate>Fri, 23 Jan 2026 07:37:32 GMT</pubDate><content:encoded><![CDATA[<hr />
<h2 id="heading-how-the-internet-reaches-our-home-or-office">How the Internet Reaches our Home or Office</h2>
<p>When we open a website, our request doesn’t invisibly reach a server. It passes through multiples chain of network devices with specific job.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768986121585/7a909cfe-854e-432a-ae6b-55c579fe6e99.jpeg" alt class="image--center mx-auto" /></p>
<p>Networking is like a moving parcels, not data. Every device exists to solve some specific delivery problem.</p>
<hr />
<h2 id="heading-what-is-a-modem-and-how-it-connects-you-to-the-internet">What Is a Modem and How It Connects You to the Internet?</h2>
<p>Modem’s first responsibility to convert signals from our ISP into usable internet data.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768987146860/0af4bc49-93fb-4d60-84ee-b860d80e635e.jpeg" alt class="image--center mx-auto" /></p>
<hr />
<h2 id="heading-what-is-a-router-and-how-it-directs-traffic">What Is a Router and How It Directs Traffic?</h2>
<p>Router decide where each packet (small piece of data) should go. Router acts like a traffic police who’s work to reads destination addresses and forwards data packets to the correct path.<br />Routers are essential for accessing external networks and ensuring data is delivered to the correct destination.</p>
<p>Router’s Duty:</p>
<ul>
<li><p>Assigns private IPs to devices (DHCP —&gt; Dynamic Host Configuration Protoco<strong>l)</strong><br />  Jab hum mobile, laptop ya TV Wi-Fi se connect karte hain, to router automatically har device ko ek private IP address deta hai.<br />  Mobile → 192.168.1.2</p>
<p>  Laptop → 192.168.1.3<br />  isse humhe manually IP set nahi karna padta.</p>
</li>
<li><p>Forwards traffic to the internet<br />  (Router humara data pehle khud leta hai aur phir ISP ke through internet tak forward kar deta hai.)</p>
</li>
<li><p>Brings responses back to the right device<br />  (Internet se jab response aata hai router check karta hai:</p>
<p>  Yeh response kis device ne maanga tha?</p>
<p>  Phir router sahi device (mobile/laptop) ko data de deta hai.)</p>
</li>
<li><p>Often performs NAT (Network Address Translation)<br />  (devices ke paas private IPs hote hain, jo internet par valid nahi hote. Ab router Sab devices ke data ko ek public IP ke through internet par bhejta hai. Wapas aane par data ko translate karke sahi device ko de deta hai)</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769015209919/4cc3785e-8412-489d-a464-c5d89dc988fc.jpeg" alt class="image--center mx-auto" /></p>
<p><strong>Router vs Modem :</strong></p>
<ul>
<li><p>Modem: connects us to the internet</p>
</li>
<li><p>Router: manages and directs traffic inside and outside our network</p>
</li>
</ul>
<hr />
<h2 id="heading-switch-vs-hub-how-local-networks-actually-work">Switch vs Hub: How Local Networks Actually Work</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769016041335/96708992-5729-420b-9bea-32e2a9bbf734.jpeg" alt class="image--center mx-auto" /></p>
<p>Switches enable parallel communication, just like proper concurrency handling in code.</p>
<p>Jaise code me concurrency multiple tasks ko parallel chalne deti hai, waise hi switch network me multiple devices ko same time par communicate karne deta hai.</p>
<hr />
<h2 id="heading-what-is-a-firewall-and-why-security-lives-here">What Is a Firewall and Why Security Lives Here?</h2>
<p>A firewall sits at the boundary of trust (like Security Gate).<br />Firewall decides what is allowed in or out.</p>
<p>Note : A firewall can be both hardware and software, and it's the main guardian of network security.</p>
<p>Firewall checks :</p>
<ul>
<li><p>Source IP</p>
</li>
<li><p>Destination IP</p>
</li>
<li><p>Ports</p>
</li>
<li><p>Protocols</p>
</li>
</ul>
<p>Firewalls protect computers by blocking unwanted access, allowing only certain connections and keeping internal systems safe from the internet.</p>
<p><mark>Firewalls are the first security layer, before authentication, authorization, or application logic even runs.</mark></p>
<hr />
<h2 id="heading-what-is-a-load-balancer-and-why-scalable-systems-need-it">What Is a Load Balancer and Why Scalable Systems Need It?</h2>
<p>When one server can’t handle all the traffic, we add more servers to share the load, but users still connect through a single entry point so everything stays simple and organized (Like Toll Booth System). It’s main responsibility to distribute traffic across multiple servers.<br /><mark>Load balancer decide karta hai kaunsa user request kaunsa server handle karega.</mark></p>
<p>Real-Life Analogy</p>
<p>McDonald’s counter<br />1 counter → lambi line ❌<br />4 counters + manager jo logon ko direct kare → fast service ✔️</p>
<ul>
<li><p>Manager = <strong>Load Balancer</strong></p>
</li>
<li><p>Counters = <strong>Servers</strong></p>
</li>
</ul>
<hr />
<h2 id="heading-how-all-devices-work-together-in-a-real-world-setup">How all devices work together in a real-world setup?</h2>
<p><strong>At Home:</strong></p>
<ul>
<li><p>Modem connects ISP</p>
</li>
<li><p>Router manages devices</p>
</li>
<li><p>Switch connects wired devices</p>
</li>
<li><p>Firewall rules are basic</p>
</li>
</ul>
<p><strong>In Production:</strong></p>
<ul>
<li><p>Dedicated firewalls</p>
</li>
<li><p>Multiple routers</p>
</li>
<li><p>Layered switches</p>
</li>
<li><p>Load balancers in front of backend services</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769017801857/ed2571db-1c6f-4aa0-8b45-4413851f1373.jpeg" alt /></p>
<hr />
]]></content:encoded></item><item><title><![CDATA[How DNS Resolution Works]]></title><description><![CDATA[What is DNS, and why do we need name resolution?
DNS is our internet’s phonebook. But there is one important difference. It never stores names and numbers in one place.
We humans prefer names like “google.com“. But computers only understand IP addres...]]></description><link>https://domain-name-systems.hashnode.dev/how-dns-resolution-works</link><guid isPermaLink="true">https://domain-name-systems.hashnode.dev/how-dns-resolution-works</guid><category><![CDATA[#digcommand]]></category><category><![CDATA[#pramith]]></category><category><![CDATA[dns]]></category><category><![CDATA[#TLD]]></category><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Pramith R]]></dc:creator><pubDate>Thu, 22 Jan 2026 07:30:23 GMT</pubDate><content:encoded><![CDATA[<hr />
<h2 id="heading-what-is-dns-and-why-do-we-need-name-resolution">What is DNS, and why do we need name resolution?</h2>
<p>DNS is our internet’s phonebook. But there is one important difference. It never stores names and numbers in one place.</p>
<p>We humans prefer names like “google.com“. But computers only understand IP addresses (142.250.19.46). DNS exist to translate between the two, quickly and reliable, millions times per second.</p>
<p>Without DNS every website we build or visit would require use to remember raw IP addresses which is practically not possible. That’s why internet world relies on DNS where responsibility is split across multiple layers instead of one central database.</p>
<p>Isi design decision ki wajah se, agar internet ka koi hissa fail bhi ho jaaye, phir bhi poora internet chalna band nahi hota.</p>
<hr />
<h2 id="heading-what-is-the-dig-command-and-when-it-is-used">What is the <code>dig</code> command and when it is used</h2>
<p>dig —&gt; Domain Information Groper —&gt; is a diagnostic tool that lets us <strong>see DNS in action</strong>.</p>
<p>What happens normally? When we open a website in the browser, we don't see the entire DNS process. Browser handles everything in the background. It hides the DNS resolution process.<br /><code>dig</code> removes that abstraction and shows exactly what was happening.</p>
<ul>
<li><p>which servers are being queried</p>
</li>
<li><p>what records are returned</p>
</li>
<li><p>how authority flows through the system</p>
</li>
</ul>
<p>Matlab, DNS ke andar jo actual baat-cheet ho rahi hoti hai, <strong>dig woh sab saamne dikha deta hai</strong>.</p>
<p><strong>difference between cURL and dig?</strong><br />—&gt; <strong>curl = HTTP ke liye</strong><br />—&gt; <strong>dig = DNS ke liye</strong></p>
<p>Jaise cURL batata hai server se kya response aa raha hai, <strong>dig batata hai DNS ke andar kya ho raha hai</strong>.<br />dig = DNS ka X-ray machine</p>
<blockquote>
<p><code>dig</code> works natively on Linux and macOS. On Windows, it does not come by default in Command Prompt, PowerShell or in Windows Terminal. If we install <strong>Windows Subsystem for Linux (WSL)</strong>, we get a real Linux environment inside Windows.</p>
</blockquote>
<hr />
<h2 id="heading-dns-resolution-happens-in-layers">DNS resolution happens in layers</h2>
<p>DNS resolution doesn’t give the answer in one go. It finds the answer by moving step by step through different levels.<br />Pehle <strong>root level</strong> se poochta hai,<br />phir <strong>TLD (.com, .in, etc.)</strong> ke paas jaata hai,<br />aur finally <strong>authoritative DNS server</strong> se exact answer leta hai.</p>
<p>Isliye DNS ka process thoda slow lag sakta hai,<br />par <strong>yehi step-by-step design system ko reliable aur stable banata hai.</strong></p>
<p><img src="https://substackcdn.com/image/fetch/%24s_%21P_Ol%21%2Cf_auto%2Cq_auto%3Agood%2Cfl_progressive%3Asteep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0a1bb2c-a1bc-40ce-abde-6fb9d2a66ce8_1600x570.png" alt="A Crash Course in DNS - ByteByteGo Newsletter" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768931622786/7d5c75d5-b4dd-4f1b-b48e-3b811a348cbb.webp" alt class="image--center mx-auto" /></p>
<p>Note : TLD —&gt; (Top-Level Domain) —&gt; It is the <strong>last part of a website name</strong>.</p>
<p>Examples: —&gt; .com / .in / .org / .net<br />When DNS looks for a website, It first asks the <strong>root server,</strong> root server replies like:<br />“I don’t know the exact IP, but for <code>.com</code>, ask the TLD server.”</p>
<p>TLD server then points to the authoritative DNS server.</p>
<p>Her Authoritative DNS server means the server that actually knows the correct IP of the domain.</p>
<hr />
<h2 id="heading-understanding-dig-ns-root-name-servers">Understanding <code>dig . NS</code> — root name servers</h2>
<p>This command asks ——&gt; “Who is authoritative for the root of DNS?”<br />Response lists root name servers like:</p>
<pre><code class="lang-plaintext">a.root-servers.net
b.root-servers.net
</code></pre>
<ul>
<li><p>The root zone doesn’t store domain IPs<br />  means root server ye nahi batata ki “google.com” ka IP kya hai.</p>
</li>
<li><p>It only knows which servers handle which TLDs<br />  root server sirf itna jaanta hai ki kaunsa TLD (jaise <code>.com</code>, <code>.org</code>, <code>.in</code>) kaunsa server handle karta hai.</p>
</li>
<li><p>There are multiple root servers globally, replicated using Anycast<br />  Iska matlab hai hum hamesha nearest root server se baat karte hain, isliye DNS fast aur reliable rehta hai.</p>
</li>
</ul>
<hr />
<h2 id="heading-understanding-dig-com-ns-tld-name-servers">Understanding <code>dig com NS</code> — TLD name servers</h2>
<p>This command solve this:<br />“Who is responsible for the <code>.com</code> namespace?”<br />The response lists TLD name servers managed by registries.</p>
<p>Key idea:</p>
<ul>
<li><p><code>.com</code> servers do not know IPs for “google.com”</p>
</li>
<li><p>They only know <strong>which authoritative servers are responsible for it</strong></p>
</li>
</ul>
<p>This separation keeps DNS scalable and manageable.<br />Yeh bas <strong>direction dete hain</strong>, exact answer nahi.</p>
<p>Example:</p>
<blockquote>
<p><em>“Mujhe</em> <a target="_blank" href="http://google.com"><em>google.com</em></a> <em>ka IP nahi pata,<br />lekin yeh lo, yeh servers hain jo iska final answer de sakte hain.”</em></p>
</blockquote>
<hr />
<h2 id="heading-understanding-dig-googlecomhttpgooglecom-ns-authoritative-name-servers">Understanding <code>dig</code> <a target="_blank" href="http://google.com"><code>google.com</code></a> <code>NS</code> — authoritative name servers</h2>
<pre><code class="lang-plaintext">dig google.com NS
</code></pre>
<p>Now we’re asking ——&gt; <strong>“Who owns the DNS records for “google.com“?</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768932558320/4b37e9fb-73da-4b95-9789-e994ac360040.webp" alt class="image--center mx-auto" /></p>
<hr />
<h2 id="heading-understanding-dig-googlecomhttpgooglecom-full-dns-resolution">Understanding <code>dig</code> <a target="_blank" href="http://google.com"><code>google.com</code></a> — full DNS resolution</h2>
<pre><code class="lang-plaintext">dig google.com
</code></pre>
<p>This command returns the final answer — IP addresses for “google.com“</p>
<p>When we type “google.com”, browser doesn't communicate directly with Google's servers. There's a complex journey that takes place first.</p>
<p>Step 1: Recursive resolver ka role ata hai:<br />Sabse pehle humara system ek recursive resolver ko request karta hai (ISP DNS, Google DNS, Cloudflare DNS) —&gt; “google.com ka IP pata hai kya?“</p>
<p>Step2 - Root servers se poochha jata hai<br />Resolver root server se poochta hai —&gt; google.com ka IP pata hai kya?</p>
<p>Step3 - <code>.com</code> TLD servers se baat hoti hai<br />Ab resolver <code>.com</code> TLD server ke paas jata hai aur poochta hai —&gt; google.com ka IP?<br />TLD Server reponse karta hai —&gt; IP mere paas bhi nahi hai, par google.com ke authoritative servers ye hain.</p>
<p>Direction to milti hai, final answer nahi.</p>
<p>Step 4: Authoritative server final answer deta hai<br />Ab resolver Google ke authoritative DNS server se poochta hai —&gt; google.com ka IP kya hai?<br />Yahin se exact answer aata hai aur actual truth mil jata hai.</p>
<p>Step 5: Caching hoti hai<br />Resolver is answer ko kuch time ke liye <strong>cache</strong> kar leta hai.<br />Benefits - next request me root/TLD tak jane ki zarurat nahi / DNS fast hota hai</p>
<p>Step 6: Browser actual connection banata hai<br />Ab browser ke paas IP aa chuka hota hai. DNS ka kaam khatam.</p>
<p>After this, the TCP connection is established, followed by the TLS handshake, and then the HTTP request is sent.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768943215223/33547320-f728-4bfb-920f-742582413ebb.jpeg" alt class="image--center mx-auto" /></p>
<hr />
<h2 id="heading-connecting-dig-output-to-real-browser-requests">Connecting <code>dig</code> output to real browser requests</h2>
<p>Every HTTP request starts with DNS.</p>
<ul>
<li><p>Before TLS<br />  Secure connection (HTTPS / encryption) tabhi start ho sakta hai jab browser ko server ka IP address mil jaye.</p>
</li>
<li><p>Before headers.<br />  HTTP headers (User-Agent, Authorization etc.) tab bheje jaate hain jab connection ban chuka ho — aur connection DNS ke baad hi banta hai.</p>
</li>
<li><p>Before cookies.<br />  Cookies bhi HTTP headers ka hi part hoti hain, isliye <strong>DNS ke baad</strong> hi jaati hain.</p>
</li>
<li><p>Before APIs.<br />  API call bhi ek HTTP request hi hoti hai. API hit karne se pehle bhi DNS resolve hona zaroori hai.</p>
</li>
</ul>
<p>DNS is the first door of the internet. Agar DNS fail ho gaya, to baaki sab (TLS, headers, cookies, APIs) kabhi start hi nahi honge.</p>
<p>If DNS fails:</p>
<ul>
<li><p>websites don’t load</p>
</li>
<li><p>APIs appear “down”</p>
</li>
<li><p>services look broken even when servers are healthy</p>
</li>
</ul>
<hr />
]]></content:encoded></item><item><title><![CDATA[cURL: The Simplest Way to Test a Backend]]></title><description><![CDATA[What is cURL
cURL is a way to send messages to a server without using a browser. But what is a server? It is just another computer connected to the internet whose job can be defined in three segments:

Receive requests

Process them

Send back a resp...]]></description><link>https://domain-name-systems.hashnode.dev/curl-the-simplest-way-to-test-a-backend</link><guid isPermaLink="true">https://domain-name-systems.hashnode.dev/curl-the-simplest-way-to-test-a-backend</guid><category><![CDATA[curl]]></category><category><![CDATA[networking]]></category><category><![CDATA[Chaiaurcode]]></category><dc:creator><![CDATA[Pramith R]]></dc:creator><pubDate>Wed, 21 Jan 2026 08:26:06 GMT</pubDate><content:encoded><![CDATA[<hr />
<h2 id="heading-what-is-curl">What is cURL</h2>
<p>cURL is a way to send messages to a server without using a browser. But what is a server? It is just another computer connected to the internet whose job can be defined in three segments:</p>
<ul>
<li><p>Receive requests</p>
</li>
<li><p>Process them</p>
</li>
<li><p>Send back a response</p>
</li>
</ul>
<p>Whenever we open a website, submit a form, or log into any web app, our system is talking to a server. Now, cURL is a tool that lets us communicate directly with a server from the terminal on our computer.<br />No UI. No buttons. Just text-based communication.</p>
<hr />
<h2 id="heading-why-programmers-need-curl">Why programmers need cURL</h2>
<p>We are programmers, we don’t always want to depend on Browser, Frontend codes or postman like tools. Right? Sometimes we just want to quickly hit the server, test an API or just see the raw responses, that’s where cURL shines.</p>
<p>cURL helps us on:</p>
<ul>
<li><p>Server me exactly kya data ja raha hai</p>
</li>
<li><p>Server se exactly kya response aa raha hai</p>
</li>
<li><p>Frontend built karne se pehle hi APIs ko test aur debug karna</p>
</li>
</ul>
<p>In backend and system-level work, cURL becomes a daily tool.</p>
<hr />
<h2 id="heading-how-to-make-our-first-curl-request">How to make our first cURL request</h2>
<p>Let’s start with the simplest possible command.</p>
<pre><code class="lang-plaintext">curl https://timearena.in
</code></pre>
<p>What will happen?</p>
<ul>
<li><p>cURL sent a request to “timearena.in“</p>
</li>
<li><p>The server responded with data</p>
</li>
<li><p>cURL printed that data in our terminal</p>
</li>
</ul>
<p>we just fetched a our website without a browser.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768856730364/8460a970-b251-4490-bdf9-1d81d5d4c679.png" alt class="image--center mx-auto" /></p>
<hr />
<h2 id="heading-understanding-request-and-response">Understanding request and response</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768898566540/019f9463-170e-46b3-92e3-a10664d6965b.jpeg" alt class="image--center mx-auto" /></p>
<hr />
<h2 id="heading-using-curl-to-talk-to-apis">Using cURL to talk to APIs</h2>
<p>Most modern servers expose API, not webpages.<br />Jab hum cURL use karte hain, toh hum in APIs se directly baat kar sakte hain. API ka response usually HTML page nahi hota, balki JSON format ka data hota hai, jo machines aur programs ke liye samajhna easy hota hai.</p>
<pre><code class="lang-plaintext">curl https://api.example.com/users 
// This means: 
// “Hey server, give me users”
// Server replies with JSON data
</code></pre>
<hr />
<h2 id="heading-why-your-curl-command-isnt-working">Why Your cURL Command Isn’t Working</h2>
<p>Mistake 1: Trying to learn all flags at once (Pehle basic flags seekhna hai (<code>-X</code>, <code>-H</code>, <code>-d</code>)<br />——&gt; cURL has many options, but you don’t need them on day one.</p>
<p>Mistake 2: Confusing browser behavior with cURL<br />——&gt; Browsers automatically send cookies, headers, auth. cURL sends only what you tell it to.</p>
<p>Mistake 3: Confused and panicked on ugly output<br />——&gt; Raw JSON or HTML looks messy in terminal. That’s normal.</p>
<p>Mistake 4: Ignoring status codes<br />——&gt; Always check whether the request actually succeeded.<br />1. 200 → Request successfully complete ho gayi ✅<br />2. 400 → Kuch to request mein problem hai ❌<br />3. 401 / 403 → Permission ya authentication issue 🔒<br />4. 500 → Server side error ⚠️</p>
<hr />
<h2 id="heading-where-curl-fits-in-backend-development">Where cURL fits in backend development</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768901068062/e35bd845-b6c1-4722-9e9b-077e8964d9d3.jpeg" alt class="image--center mx-auto" /></p>
<p>Once we comfortable with cURL, tools like Postman or frontend debugging make much more sense.</p>
<hr />
<h2 id="heading-commands-you-can-try-safely">Commands You Can Try Safely</h2>
<ul>
<li><p><strong>Fetch a webpage (Basic GET request)</strong></p>
<pre><code class="lang-plaintext">  curl https://example.com
  // Probable Output
  &lt;!doctype html&gt;
  &lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;Example Domain&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;h1&gt;Example Domain&lt;/h1&gt;
    &lt;p&gt;This domain is for use in illustrative examples.&lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;
</code></pre>
<p>  cURL sent a GET request —&gt; Server returned HTML —&gt;This is exactly what a browser gets, but without UI</p>
</li>
<li><p><strong>Check if a server is alive (Status only)</strong></p>
</li>
</ul>
<pre><code class="lang-plaintext">// Command
curl -I https://example.com
// Output
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 1256
</code></pre>
<p>Server is reachable —&gt; <code>200 OK</code> means success—&gt; No body, only response headers</p>
<ul>
<li><p>Fetch JSON from an API</p>
<pre><code class="lang-plaintext">  // Command
  curl https://jsonplaceholder.typicode.com/posts/1
  //Output
  {
    "userId": 1,
    "id": 1,
    "title": "sunt aut facere repellat provident",
    "body": "quia et suscipit suscipit recusandae"
  }
</code></pre>
<p>  It tells us, This is an API, not a webpage —&gt; server responds with JSON —&gt; Backend systems usually talk like this.</p>
</li>
</ul>
<hr />
]]></content:encoded></item><item><title><![CDATA[The Hidden System That Decides Where our Internet Request Goes]]></title><description><![CDATA[What DNS Records Are and Why They Exist
Whenever we type a website in our browser like “chatgpt.com”, first and the most simple question needs to be answered first,
“Where should this request go?“
Our computers don’t understand domain names. They und...]]></description><link>https://domain-name-systems.hashnode.dev/the-hidden-system-that-decides-where-our-internet-request-goes</link><guid isPermaLink="true">https://domain-name-systems.hashnode.dev/the-hidden-system-that-decides-where-our-internet-request-goes</guid><category><![CDATA[dns]]></category><category><![CDATA[networking]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><dc:creator><![CDATA[Pramith R]]></dc:creator><pubDate>Mon, 19 Jan 2026 20:35:27 GMT</pubDate><content:encoded><![CDATA[<hr />
<h2 id="heading-what-dns-records-are-and-why-they-exist"><strong>What DNS Records Are and Why They Exist</strong></h2>
<p>Whenever we type a website in our browser like “chatgpt.com”, first and the most simple question needs to be answered first,</p>
<p><strong><mark>“Where should this request go?“</mark></strong></p>
<p>Our computers don’t understand domain names. They understand IP addresses (example - 192.210.210.184.10). DNS (Domain Name System) is there to translate the alphabetical domain names to computer friendly IPs. DNS is like the translator who coverts human friendly names —→ Computer friendly IPs.</p>
<p>We can think DNS like our mobile’s contact list. We just dialed with name, our phone internally dials a specific number. Same thing happened with our domain name. We type “www.hashnode.com“, DNS help to finds the exact destination.<br />Now, DNS doesn’t store just this information only. It also stores many types of records. Each records solve some specific question. That’s why DNS record types exist.<br />But actually DNS me record types ka kya matlab hai? —→ DNS ke andar different kinds of answers stored hai, har ek answer ek specific sawal ka jawab deta hai. DNS ek hi question solve nahi karta, alag alag situations ke liye alag information store karta hai.</p>
<p>What DNS record types mean? - yeh types ka matlab samjhata hoon. The record type tells DNS what the value represents. Without mentioning the type, DNS would not know the value you are requesting is for, like is it for an IP address or a mail server or some other domain name. “Types” answers those question.</p>
<hr />
<h2 id="heading-a-record-mapping-domain-name-to-ip-address-domain-ipv4-address"><strong>A Record – Mapping Domain Name to IP Address (domain → IPv4 address)</strong></h2>
<p>The purpose of A Record —&gt; Which IP address should our typed domain point to?</p>
<pre><code class="lang-plaintext">chatgpt.com → 104.18.32.47
google.com → 142.251.45.174
</code></pre>
<p>Now when someone visits chatgpt.com, DNS needs to reply by saying Bhai iss domain ka server iss IP →104.18.32.47 hai.<br />A record —&gt; direct address.<br />Important to remember<br />—&gt; One domain can have multiple A records.<br />—&gt; It helps for load balancing (traffic multiple servers pe distrubute karna) and high availability (Service hamesha available rahe).</p>
<hr />
<h2 id="heading-aaaa-record-domain-to-ipv6-address">AAAA Record – Domain to IPv6 Address</h2>
<p>We talked about <strong>A Record</strong>, which maps a domain to an <strong>IPv4 address</strong>. But internet sirf IPv4 pe hi nahi chal raha anymore.</p>
<p>First understand What is IPv4? —&gt; IPv4 is just an address system for computers on this internet. just like our house has an address or our mobile has a number. Every computer or server in the internet needs an accurate address so the data knows where to reach. That address is called an IP address.</p>
<p>An IPv4 address looks like this —&gt; 93.184.216.34</p>
<p>(Four numbers / Separated by dots /Each number between 0 and 255 )<br />That’s why it’s called IPv4 —&gt; Version 4 of Internet Protocol.</p>
<p>Now the problem is — IPv4 addresses are limited. Internet grow ho gaya, devices explode ho gaye, IPs kam pad gaye. To solve this, IPv6 was introduced.<br />IPv6 looks like this:</p>
<pre><code class="lang-plaintext">2606:4700:4700::1111
</code></pre>
<p>Same job as A Record, bas IP version alag hai. How it works, same like A records, you open a website, browser usually does this:</p>
<ol>
<li><p>First checks —&gt; <strong>AAAA record</strong></p>
</li>
<li><p>If IPv6 available —&gt; uses it</p>
</li>
<li><p>If not —&gt; falls back to <strong>A record (IPv4)</strong></p>
</li>
</ol>
<p>User ko kuch pata bhi nahi chalta. Sab silently hota hai.<br />One thing to remember, AAAA record is not mandatory but highly recommended for modern systems.</p>
<hr />
<h2 id="heading-cname-record-domain-alias-amp-indirection">CNAME Record – Domain Alias &amp; Indirection</h2>
<p>CNAME record points one domain to another domain, not to an IP address.</p>
<pre><code class="lang-plaintext">www.chatgpt.com -----&gt; chatgpt.com
app.mycompany.com → mycompany.vercel.app
</code></pre>
<p>Jab user “www.chatgpt.com” type karta hai, DNS indicate karta hai,<br />Yeh asli domain nahi hai, iska alias chatgpt.com hai.<br />Phir DNS “chatgpt.com” ka IP nikalta hai aur request waha bhej deta hai.</p>
<p>Why CNAME exists</p>
<ul>
<li><p><strong>Avoid duplication:</strong><br />  —&gt; Same cheez baar-baar likhne ki zarurat nahi hoti.</p>
</li>
<li><p><strong>Easy management:</strong><br />  —&gt; Ek jagah change karo, sab jagah automatically update ho jata hai.</p>
</li>
<li><p><strong>Used with CDNs &amp; SaaS tools:</strong><br />  —&gt; CDNs aur SaaS services ke saath domain connect karna easy ho jata hai.<br />  Here CDN means —&gt; Content Delivery Network —&gt; servers ka ek network hota hai jo website ke content ko user ke nearest location se deliver karta hai.</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768773246712/423ba284-0f05-40cd-bb01-71cd76a63db8.png" alt class="image--center mx-auto" /></p>
<hr />
<h2 id="heading-mx-record-how-email-routing-works">MX Record – How Email Routing Works</h2>
<p>When someone sends email to your specified email like - user@youremail.com, DNS is asked —&gt; Which server should receive the email for this domain? Emails kaha deliver karni hai?</p>
<pre><code class="lang-plaintext">yourdomain.com → MX → mail.google.com
</code></pre>
<p>MX record tells the internet which mail server should receive emails for a domain. It actually points email messages to the correct post office for delivery.<br />MX Record ——&gt; post office address for emails.</p>
<hr />
<h2 id="heading-ns-record-who-controls-the-domain">NS Record – Who Controls the Domain</h2>
<p>NS full form ——&gt; Name Server.</p>
<p>When someone asks about your website like “yourdomain.com“, DNS doesn’t give IP address immediately. It first asks, is domain ke records kis DNS ke paas hai?<br />NS record replies like this</p>
<pre><code class="lang-plaintext">yourdomain.com → ns1.cloudflare.com
yourdomain.com → ns2.cloudflare.com
</code></pre>
<p><mark>NS record does not store website IPs or email servers. It only tells who has the right data.</mark></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768813857751/65e49e50-6368-46a6-ab99-05c30ae2f962.png" alt class="image--center mx-auto" /></p>
<p>Simple DNS Flow</p>
<p>Let’s say you type “yourdomain.com“ :</p>
<ol>
<li><p>Root DNS —&gt; .com domain kaun handle karta hai?</p>
</li>
<li><p>.com DNS —&gt; yourdomain.com ke liye ye NS servers responsible hai</p>
</li>
<li><p>Authoritative DNS (from NS record) —&gt; main hi boss hoon. batao kya chahiye — A record? MX record?</p>
</li>
</ol>
<p>NS vs MX</p>
<ul>
<li><p>NS Record —&gt; DNS ka manager kaun hai?</p>
<p>  MX Record —&gt; Emails kaha jayengi</p>
</li>
<li><p>NS —&gt; ghar ka caretaker<br />  MX —&gt; post office address</p>
</li>
</ul>
<hr />
<h2 id="heading-txt-record-extra-information-amp-verification">TXT Record – Extra Information &amp; Verification</h2>
<p>Till now what we have read, DNS records were doing routing work, But sometimes, DNS is not about routing. Sometimes it’s about proof. That’s where TXT Record comes in. Some extra information attached to a domain, used for verification and security.</p>
<p><mark>TXT Record stores plain text information for a domain.</mark></p>
<p>DNS just says —&gt; “Here is some text related to this domain.”<br />No IP / No server ———&gt; Just information.</p>
<p>What problem does this actually solve? this question —&gt; “Are you really the owner of this domain?”<br />DNS can answer that using a TXT record.<br />We add a secret text value ——&gt; service checks it ——&gt;ownership verified</p>
<pre><code class="lang-plaintext">example.com → TXT → google-site-verification=abc123
</code></pre>
<p>TXT records protect emails from spam &amp; spoofing.</p>
<pre><code class="lang-plaintext">v=spf1 include:_spf.google.com ~all
// meaning  - Only Google can send emails on behalf of this domain.
</code></pre>
<p>Last important points to remember —&gt; TXT records are read by machines, not humans.</p>
<hr />
<h2 id="heading-how-multiple-dns-records-work-together">How Multiple DNS Records Work Together</h2>
<pre><code class="lang-plaintext">chaiaurcode.com
├── A → Web server IP
├── www → CNAME → chaiaurcode.com
├── api → A → Backend server IP
├── MX → Google Mail servers
└── NS → Cloudflare name servers
</code></pre>
<p><img src="https://miro.medium.com/1%2AyHt26ZdhCmitNMmF3V252Q.png" alt="The Complete Guide to DNS: How the Internet Finds Everything ..." /></p>
<hr />
]]></content:encoded></item></channel></rss>