<?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[Being Developer ]]></title><description><![CDATA[knowledge about what is DNS and some explanation for commands .]]></description><link>https://how-does-dns-works.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sun, 21 Jun 2026 05:37:54 GMT</lastBuildDate><atom:link href="https://how-does-dns-works.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Git for Beginners: Basics and Essential Commands
]]></title><description><![CDATA[Let's first discuss a situation before understanding what is git ......
Imagine you are writing a school project. Every day, you make changes and save a new copy:

Project_Final.docx

Project_Final_V2]]></description><link>https://how-does-dns-works.hashnode.dev/git-for-beginners-basics-and-essential-commands</link><guid isPermaLink="true">https://how-does-dns-works.hashnode.dev/git-for-beginners-basics-and-essential-commands</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[gitforbeginners]]></category><category><![CDATA[Developer]]></category><dc:creator><![CDATA[Parshva Jayesh Doshi]]></dc:creator><pubDate>Thu, 18 Jun 2026 15:24:59 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/697720f9aaff412f46e7c283/a2eb2dc3-978a-4355-b183-59ebe2e8c67f.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Let's first discuss a situation before understanding what is git ......</p>
<p>Imagine you are writing a school project. Every day, you make changes and save a new copy:</p>
<ul>
<li><p>Project_Final.docx</p>
</li>
<li><p>Project_Final_V2.docx</p>
</li>
<li><p>Project_Final_Real_Final.docx</p>
</li>
<li><p>Project_Final_Last_Final.docx 😅</p>
</li>
</ul>
<p>After sometimes suppose your teammates want to check what changes you have done and he wants to add feature in the project so it will be little difficult to track these changes . In the same way developers face the problem while writing the code . <strong>It gets difficult to track the changes and share the changes with your friends or teammates and that's where git comes in role</strong></p>
<p><strong><mark class="bg-yellow-200 dark:bg-yellow-500/30">Git helps developers track changes</mark></strong><mark class="bg-yellow-200 dark:bg-yellow-500/30">, </mark> <strong>save different versions of their code, and work with others without losing any work.</strong></p>
<p>In this blog, we will learn Git in very simple language and understand the most important Git commands with practical</p>
<h2>what is Git ?</h2>
<p><strong>Git is nothing but a kind of software installed inside your folder to track the changes made by you</strong> . And in programming language this is known as<br /><em>"<strong><strong>Distributed version Control System</strong></strong>".</em><br />Here ,<br />Version control means <strong><em>keeping track of every chang</em>e</strong> made to a project.<br />Distributed means <em><strong>Every teammate or friends gets a complete copy of the project history</strong></em> on their own computer.</p>
<p><strong>Thus in simple terms to tell git is distributed version control system which is used to track changes, save project history, and work together efficiently.</strong></p>
<h2>Why Git is used ?</h2>
<ul>
<li><p><strong>Time travel:</strong> Revert files or entire projects back to previous stable states if something breaks.</p>
</li>
<li><p><strong>Seamless collaboration:</strong> Allow thousands of developers to work on the exact same files simultaneously without overwriting each other's code.</p>
</li>
<li><p><strong>Isolated experimentation:</strong> Create independent "branches" to test new features or fix bugs safely away from the main, working codebase.</p>
</li>
<li><p><strong>Full offline capability:</strong> Work locally on your machine with a complete copy of the project history, meaning internet connectivity is not required to commit changes.</p>
</li>
<li><p><strong>Accountability trail:</strong> Keep a clear log of who made what change, when they made it, and why they made it.</p>
</li>
<li><p><strong>Data integrity:</strong> Cryptographically secure every change using checksums, preventing hidden data loss or file corruption.</p>
</li>
</ul>
<h2>Git basics and core terminologies</h2>
<p>Now before stating with git commands you need understand some basic terms .<br />This will make it easier for you understand the commands . Let us start then......</p>
<h3>1. Repository (Repo)</h3>
<p>A <strong>Repository</strong>, often called a <strong>Repo</strong>, is a folder that Git uses to track and manage files.</p>
<p>It contains:</p>
<ul>
<li><p>Project files</p>
</li>
<li><p>Git history</p>
</li>
<li><p>Commit records</p>
</li>
<li><p>Branch information</p>
</li>
</ul>
<p>Think of a repository as a <strong>digital storage space</strong> where Git keeps your project's complete history.</p>
<h3>2. Staging Area</h3>
<p>The <strong>Staging Area</strong> is a temporary place where changes are prepared before being committed.<br />Git allows you to choose which changes should be included in the next commit.<br />Think of it like as a <strong>online shopping cart</strong></p>
<ul>
<li><p>Working Directory → Items in the store</p>
</li>
<li><p>Staging Area → Items in your cart</p>
</li>
<li><p>Commit → Checkout</p>
</li>
</ul>
<h3>3.Commit</h3>
<p><strong>Commit</strong> is a saved snapshot of your project at a specific point in time.<br />Each commit records:</p>
<ul>
<li><p>The changes made</p>
</li>
<li><p>The author</p>
</li>
<li><p>The date and time</p>
</li>
<li><p>A commit message</p>
</li>
</ul>
<p>This creates a checkpoint that you can return to later if needed.</p>
<h3>4. Branch</h3>
<p>A <strong>Branch</strong> is like a <strong>separate copy</strong> of your project where you can try new ideas without affecting the original project. It is like <strong>Separate workspace</strong> for development</p>
<p>Imagine you are writing a school project.<br />You have completed the main project and submitted the first draft. Now, you want to add some new sections and improve the design.</p>
<p>Instead of changing the original project directly, you make a photocopy and work on that copy.</p>
<ul>
<li><p>Original Project → <strong>Main Branch</strong></p>
</li>
<li><p>Photocopy for changes → <strong>New Branch</strong></p>
</li>
</ul>
<p>If the changes look good, you copy them back into the original project.<br />That's exactly how branches work in Git.</p>
<h3>5.Head</h3>
<p><strong>HEAD</strong> is simply Git's way of showing where you are currently working. It is like a bookmark that tells Git where you are currently working in the project.</p>
<img src="https://cdn.hashnode.com/uploads/covers/697720f9aaff412f46e7c283/25d33ec3-8785-4444-a4c0-055138168de7.png" alt="" style="display:block;margin:0 auto" />

<h2>Common Git commands</h2>
<h3>**1.git init</h3>
<p>**This command creates a new Git repository.</p>
<img src="https://cdn.hashnode.com/uploads/covers/697720f9aaff412f46e7c283/34ab48d5-2cad-4173-853f-18415da29cfd.png" alt="see here my project isn't being tracked yet " style="display:block;margin:0 auto" />

<p>see on the above image my project isn't being tracked !!! so to track it I write the command git init and it Starts tracking it by making a repository ( a .git hidden file )</p>
<img src="https://cdn.hashnode.com/uploads/covers/697720f9aaff412f46e7c283/7dc6b932-4e2c-4ee3-af65-5db8ba669e2d.png" alt="" style="display:block;margin:0 auto" />

<p>like this !!!</p>
<h3>2. git add</h3>
<p>Git doesn't automatically save changes.<br />First, you need to tell Git which files should be included for the changes to be tracked .<br />This process is called <strong>staging</strong>.</p>
<h3>3. git commit -m " your commit message"</h3>
<p>A commit saves the staged changes permanently.</p>
<p>The message should clearly describe what was changed.<br />Good commit messages make project history easier to understand.</p>
<p>so I had written a greetings in empty project file . so added to staging area and committed this change....</p>
<img src="https://cdn.hashnode.com/uploads/covers/697720f9aaff412f46e7c283/bb17bc3d-cc4f-4823-9b27-a7f2bf69a875.png" alt="" style="display:block;margin:0 auto" />

<h3>4. git status</h3>
<p>This command shows the current state of your repository.</p>
<img src="https://cdn.hashnode.com/uploads/covers/697720f9aaff412f46e7c283/b9170d61-450c-471a-a74d-dd9554a5d1f8.png" alt="" style="display:block;margin:0 auto" />

<p>I am in the main branch and I had deleted 2 files before creating the project1 file ...</p>
<h3>5. git log</h3>
<p>This command shows commit history.</p>
<img src="https://cdn.hashnode.com/uploads/covers/697720f9aaff412f46e7c283/b5cdf65e-6251-4b00-8791-52b1b3153346.png" alt="" style="display:block;margin:0 auto" />

<h3>6. git diff</h3>
<p>This command shows <strong>what changes you have made in your files</strong> before saving them.<br />Imagine you wrote an essay yesterday and made some changes today.</p>
<p>Now you want to compare:</p>
<ul>
<li><p>Old version</p>
</li>
<li><p>New version</p>
</li>
</ul>
<p>It acts like a teacher highlighting what was added, removed, or changed.</p>
<img src="https://cdn.hashnode.com/uploads/covers/697720f9aaff412f46e7c283/d045c2f1-975d-44a6-9172-13b390ba7d8f.png" alt="" style="display:block;margin:0 auto" />

<h3>7. git restore</h3>
<p>git restore is used when you want to <strong>throw away your recent changes</strong> and go back to the last saved version.</p>
<p><code>git restore</code> = "Remove my unsaved changes."</p>
<h3>8. git reset --hard 'commit id'</h3>
<p>It is used to <strong>unstage files</strong> or move back to an earlier commit.</p>
<img src="https://cdn.hashnode.com/uploads/covers/697720f9aaff412f46e7c283/54da915f-f8dd-4383-be29-cf70e8d5b648.png" alt="" style="display:block;margin:0 auto" />

<p>This were the some basic commands which we need understand when we start learning git</p>
<p>THE WORKFLOW :</p>
<img src="https://cdn.hashnode.com/uploads/covers/697720f9aaff412f46e7c283/1f8c79d9-0f40-4f10-9fa7-afdbca739072.png" alt="" style="display:block;margin:0 auto" />

  

<p>For more deep dive you can visit : <a href="https://youtu.be/q8EevlEpQ2A?si=cqhIs1arH9-BzB14">https://youtu.be/q8EevlEpQ2A?si=cqhIs1arH9-BzB14</a></p>
<p>**THANK YOU !!!  </p>
<p>**</p>
]]></content:encoded></item><item><title><![CDATA[How DNS Resolution Works]]></title><description><![CDATA[what is DNS?
THE PROBLEM: Computer does not understand the human given names . For example , they do not understand google.com or chaicode.com. They have their own language to understand it . This language is nothing but known as IP address(like 197....]]></description><link>https://how-does-dns-works.hashnode.dev/how-dns-resolution-works</link><guid isPermaLink="true">https://how-does-dns-works.hashnode.dev/how-dns-resolution-works</guid><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Parshva Jayesh Doshi]]></dc:creator><pubDate>Sat, 31 Jan 2026 16:06:03 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-what-is-dns">what is DNS?</h2>
<p><strong>THE PROBLEM:</strong> Computer does not understand the human given names . For example , they do not understand google.com or chaicode.com. They have their own language to understand it . This language is nothing but known as <strong>IP address(like 197.98.76.33).</strong></p>
<p>Let's say you type chaicode.com in your browser's URL bar and it loads the website . But how did the computer understand to open this website . we know that it only understands the ip address Vala language<br />Then how ? Here comes the role of DNS i.e <strong>DOMAIN NAME SYSTEM</strong></p>
<p><strong><em>DNS : DOMAIN NAME SYSTEM is a something like naming system that translates the human-readable domain names into its IP address which is understandable by our computers.</em></strong></p>
<p>It's like the contacts app on our mobile phones. Suppose you want to call your friend named Riya. You would search for the name Riya in your contacts and call her. It's obvious you wouldn't dial the number because it's hard to remember everyone's number unless it's your girlfriend or boyfriend.<br />In the same way DNS works. It is known as internet’s phone book.<br />Here instead of Riya , the domain name is used ( like chaicode.com) and instead of phone number ip address is called ( i.e domain name is converted into IP address like 88.88.88.34 )</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769867042152/d043a454-63c8-4b9b-ab67-db2af0fea894.png" alt class="image--center mx-auto" /></p>
<p>You <strong>dial “Mom”</strong>, not the number obviously<br />DNS does the same thing — it converts <strong>names → numbers</strong><br /><strong>This translation process is known as name resolution.</strong></p>
<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 stands for <strong>Domain Information Groper.</strong> It is a <strong>tool</strong> to query DNS server and how DNS name resolution works. <strong><em>It tells you which DNS servers were contacted , what IP address was returned , how long it took.</em></strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769867969977/7839d2a7-dc4a-4581-89e0-e8a38379a438.png" alt class="image--center mx-auto" /></p>
<p>IN answer section you can see the chaicode’s ip address , its record name . Also you can observe the query time given after answer section .</p>
<h2 id="heading-understanding-dig-ns-and-root-name-servers">Understanding <code>dig . NS</code> and root name servers</h2>
<p>This is command used to show the root name servers of the internet. This root servers act as the first checkpoint in the DNS resolution process. <strong><em>Question</em></strong> arises what are root servers ?<br />: <strong>Root Name Servers</strong> are the starting point of the DNS resolution process. They tell DNS where to find Top Level Domain (TLD) servers like <code>.com</code>, <code>.org</code>, <code>.in</code>. In DNS, <strong>everything starts from the root</strong>, represented by a <strong>dot (</strong><code>.</code>)<br />. = root<br />.com = top domain name [ TLD ]<br />chaicode.com = domain</p>
<p>Here the NS record means answering the question of “““<strong><em>Which server knows about this domain?</em></strong>”””<br />when u run these commands it gives you output like this</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769869115247/3174adb6-2a09-460b-981c-cdd127f9a24f.png" alt class="image--center mx-auto" /></p>
<p><strong><em>. 172885 IN NS</em></strong> <a target="_blank" href="http://j.root-servers.net"><strong><em>j.root-servers.net</em></strong></a><strong><em>.</em></strong> means the root of DNS is handled by these name servers [﻿﻿﻿<strong>j</strong>.<a target="_blank" href="http://root-servers.net">root-servers.net</a>.]<br /><strong><em>IN SHORT :</em></strong> <strong>THE ROOT SERVERS DONT KNOW CHAICODE.COM BUT THEY KNOW WHO MANAGES THE .COM [TLD SERVERS ] ROOT SERVERS DO NOT KNOW THE IP ADDRESSES OF CHAICODE.COM . THEY ONLY KNOW WHERE TO FIND TLD SERVERS.</strong></p>
<h2 id="heading-understanding-dig-com-ns-tld-name-servers">Understanding <code>dig com NS</code> — TLD Name Servers</h2>
<p>It is also a command which <strong>shows the Name Servers responsible for the</strong> <code>.com</code> <strong>Top-Level Domain (TLD)</strong> Now the TLD servers answers the question of Which authoritative servers handle chaicode.com?<br />output of these command looks like</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769869559407/9196e2e4-ee74-40b3-8431-61ddc45af2de.png" alt class="image--center mx-auto" /></p>
<p>These servers { like <a target="_blank" href="http://a.gtld-servers.net">a.gtld-servers.net</a> and <a target="_blank" href="http://b.gtld-servers.net">b.gtld-servers.net</a> etc } manage <strong>all</strong> <code>.com</code> domains. TLD servers do not store IP addresses; they only point to authoritative servers.</p>
<p><em>IN SHORT : I**</em>N FIRST STEP THE DNS ASKS THE ROOT SERVER WHO HANDLES .COM AND ROOT SERVERS REPLIES THAT TO ASK .COM VALA TLD SERVER . NOW DNS ASKS .COM VALA TLD SERVER THAT WHERE IS CHAICODE.COM , TLD REPLIES GO TO AUTHORATIVE SERVERS.**</p>
<h2 id="heading-understanding-dig-chaicodecomhttpgooglecom-ns-authoritative-name-servers"><strong>Understanding</strong> <code>dig</code> <a target="_blank" href="http://google.com"><code>chaicode.com</code></a> <code>NS</code> <strong>— Authoritative Name Servers</strong></h2>
<p>now you already know that this is also one type of command which tells you <strong>which DNS servers are officially responsible for the domain</strong> <a target="_blank" href="http://google.com"><code>chaicode.com</code></a>.<br />Authoritative servers answers the question of <strong>“What is the IP address of</strong> <a target="_blank" href="http://google.com"><strong>chaicode.com</strong></a><strong>?”</strong><br />the output of these command looks like this</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769872591875/e384e1c0-c137-44eb-9777-5c547cfff735.png" alt class="image--center mx-auto" /></p>
<p>now here if u see the answer section of output u can observe that <a target="_blank" href="http://chaicode.com"><code>chaicode.com</code></a> uses Cloudflare’s DNS [means ki Cloudflare is managing the DNS records of the website] , and <strong>Cloudflare’s name servers are the authoritative servers for this domain</strong>.</p>
<p>IN SHORT :<em>I**</em>N FIRST STEP THE DNS ASKS THE ROOT SERVER WHO HANDLES .COM AND ROOT SERVERS REPLIES THAT TO ASK .COM VALA TLD SERVER . NOW DNS ASKS .COM VALA TLD SERVER THAT WHERE IS CHAICODE.COM , TLD REPLIES GO TO AUTHORATIVE SERVERS. AUTHORATIVE SERVES GIVES THE IP ADDRESS OF CHAICODE.COM.**</p>
<p>IN ABOVE THREE COMMANDS THERE IS WORD CALLED NS . THIS NS IS THE NAME SERVER RECORD WHICH ANSWERS THE QUESTIONS OF <strong>WHICH SERVER KNOWS ABOUT THIS DOMAIN?</strong></p>
<h2 id="heading-understanding-dig-chaicodecomhttpgooglecom-and-the-full-dns-resolution-flow">Understanding <code>dig</code> <a target="_blank" href="http://google.com"><code>chaicode.com</code></a> and the full DNS resolution flow</h2>
<p>when we run this command it retrieves detailed Domain Name System information for the domain <a target="_blank" href="http://chaicdeo.com"><code>chaicdeo.com</code></a>.<br />output for this command looks like</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769873224486/2790b122-6e57-4e39-9b4c-7fec5f350729.png" alt class="image--center mx-auto" /></p>
<p><strong>now understand the flow of all this servers and commands</strong></p>
<p>Browser ask to DNS do we know chaicode.com . The DNA then looks for chaicode.com . It ask for who handles the .com ? . The root server tells to ask .com TLD server [it points to TLD server] . The DNS then ask to TLD server that who handles chaidode.com ? TLD replies ask chaicode authoritative server .<br />And finally the DNS ask authoritative about the IP address of chaicode.com and finally the answers the IP address of chaicode.com .</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769874035433/9a5d6e0a-00d7-4b66-8fae-6eaa3d84ad57.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769874068529/bf22d62d-821e-4ee3-a1d1-2884d8ca6458.png" alt class="image--center mx-auto" /></p>
<p>THANK YOU !</p>
]]></content:encoded></item></channel></rss>