<?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[CODEWITHPIYUSH]]></title><description><![CDATA[CODEWITHPIYUSH]]></description><link>https://piyushtiwari888.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Mon, 21 Sep 2026 08:09:27 GMT</lastBuildDate><atom:link href="https://piyushtiwari888.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[CSS Selectors 101: Targeting Elements with Precision]]></title><description><![CDATA[Why CSS Selectors Are Needed?
CSS is used to style HTML, but before styling anything, CSS must know:
Which element should be styled?
That’s where CSS selectors come in.
CSS selectors are like addresses.They help CSS find and target specific HTML elem...]]></description><link>https://piyushtiwari888.hashnode.dev/css-selectors-101-targeting-elements-with-precision</link><guid isPermaLink="true">https://piyushtiwari888.hashnode.dev/css-selectors-101-targeting-elements-with-precision</guid><category><![CDATA[Web Development]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[#HiteshChaudhary ]]></category><category><![CDATA[Selectors in CSS]]></category><dc:creator><![CDATA[Piyush Tiwari]]></dc:creator><pubDate>Tue, 27 Jan 2026 10:26:52 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769508957032/dcd24026-cda0-4db8-823c-8b814a52bd8f.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-why-css-selectors-are-needed">Why CSS Selectors Are Needed?</h2>
<p>CSS is used to <strong>style HTML</strong>, but before styling anything, CSS must know:</p>
<p><strong>Which element should be styled?</strong></p>
<p>That’s where <strong>CSS selectors</strong> come in.</p>
<p>CSS selectors are like <strong>addresses</strong>.<br />They help CSS find and target specific HTML elements on a webpage.</p>
<p>Without selectors:</p>
<ul>
<li><p>CSS wouldn’t know where to apply styles</p>
</li>
<li><p>Every element would look the same</p>
</li>
</ul>
<p>So, selectors are the <strong>foundation of CSS</strong>.</p>
<h2 id="heading-css-selectors-explained-with-a-real-world-analogy">CSS Selectors Explained with a Real-World Analogy</h2>
<p>Imagine you are in a classroom:</p>
<ul>
<li><p>Saying <strong>“Everyone stand up”</strong> → targets all students</p>
</li>
<li><p>Saying <strong>“Students wearing blue shirts stand up”</strong> → targets a group</p>
</li>
<li><p>Saying <strong>“Rahul, stand up”</strong> → targets one specific person</p>
</li>
</ul>
<p>CSS selectors work in the <strong>same way</strong>.</p>
<h2 id="heading-element-selector">Element Selector</h2>
<p>The <strong>element selector</strong> targets HTML elements by their tag name.</p>
<h3 id="heading-example">Example</h3>
<pre><code class="lang-css"><span class="hljs-selector-tag">p</span> {
  <span class="hljs-attribute">color</span>: blue;
}
</code></pre>
<h3 id="heading-what-it-does">What it does</h3>
<ul>
<li><p>Targets <strong>all</strong> <code>&lt;p&gt;</code> elements</p>
</li>
<li><p>Applies the same style everywhere</p>
</li>
</ul>
<h3 id="heading-when-to-use">When to use</h3>
<ul>
<li>When you want to style <strong>all elements of one type</strong></li>
</ul>
<h3 id="heading-before-styling">Before Styling</h3>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">p</span>&gt;<span class="hljs-selector-tag">This</span> <span class="hljs-selector-tag">is</span> <span class="hljs-selector-tag">a</span> <span class="hljs-selector-tag">paragraph</span>&lt;/<span class="hljs-selector-tag">p</span>&gt;
&lt;<span class="hljs-selector-tag">p</span>&gt;<span class="hljs-selector-tag">This</span> <span class="hljs-selector-tag">is</span> <span class="hljs-selector-tag">another</span> <span class="hljs-selector-tag">paragraph</span>&lt;/<span class="hljs-selector-tag">p</span>&gt;
</code></pre>
<h3 id="heading-after-styling">After Styling</h3>
<p>All paragraphs turn <strong>blue</strong></p>
<h2 id="heading-class-selector">Class Selector</h2>
<p>The <strong>class selector</strong> targets elements using a class name.</p>
<p>It starts with a <strong>dot (</strong><code>.</code>).</p>
<h3 id="heading-example-1">Example</h3>
<pre><code class="lang-css"><span class="hljs-selector-class">.highlight</span> {
  <span class="hljs-attribute">background-color</span>: yellow;
}
</code></pre>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">p</span> <span class="hljs-selector-tag">class</span>="<span class="hljs-selector-tag">highlight</span>"&gt;<span class="hljs-selector-tag">Important</span> <span class="hljs-selector-tag">text</span>&lt;/<span class="hljs-selector-tag">p</span>&gt;
</code></pre>
<h3 id="heading-what-it-does-1">What it does</h3>
<ul>
<li><p>Targets only elements with <code>class="highlight"</code></p>
</li>
<li><p>Can be reused multiple times</p>
</li>
</ul>
<h3 id="heading-when-to-use-1">When to use</h3>
<ul>
<li>When styling <strong>multiple elements in a similar way</strong></li>
</ul>
<h2 id="heading-id-selector">ID Selector</h2>
<p>The <strong>ID selector</strong> targets one unique element.</p>
<p>It starts with a <strong>hash (</strong><code>#</code>).</p>
<h3 id="heading-example-2">Example</h3>
<pre><code class="lang-css"><span class="hljs-selector-id">#main-heading</span> {
  <span class="hljs-attribute">color</span>: red;
}
</code></pre>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">h1</span> <span class="hljs-selector-tag">id</span>="<span class="hljs-selector-tag">main-heading</span>"&gt;<span class="hljs-selector-tag">Welcome</span>&lt;/<span class="hljs-selector-tag">h1</span>&gt;
</code></pre>
<h3 id="heading-what-it-does-2">What it does</h3>
<ul>
<li><p>Targets <strong>only one element</strong></p>
</li>
<li><p>IDs must be <strong>unique</strong></p>
</li>
</ul>
<h3 id="heading-when-to-use-2">When to use</h3>
<ul>
<li>For special or unique elements</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769509333705/525ff2fc-e3c4-4faf-826a-967ad15ec752.webp" alt class="image--center mx-auto" /></p>
<h2 id="heading-group-selector">Group Selector</h2>
<p>The <strong>group selector</strong> lets you apply the same style to multiple selectors.</p>
<h3 id="heading-example-3">Example</h3>
<pre><code class="lang-css"><span class="hljs-selector-tag">h1</span>, <span class="hljs-selector-tag">h2</span>, <span class="hljs-selector-tag">p</span> {
  <span class="hljs-attribute">font-family</span>: Arial;
}
</code></pre>
<h3 id="heading-what-it-does-3">What it does</h3>
<ul>
<li><p>Styles all listed elements together</p>
</li>
<li><p>Reduces repeated CSS code</p>
</li>
</ul>
<h3 id="heading-when-to-use-3">When to use</h3>
<ul>
<li>When multiple elements need <strong>same styling</strong></li>
</ul>
<h2 id="heading-descendant-selector">Descendant Selector</h2>
<p>The <strong>descendant selector</strong> targets elements <strong>inside another element</strong>.</p>
<h3 id="heading-example-4">Example</h3>
<pre><code class="lang-css"><span class="hljs-selector-tag">div</span> <span class="hljs-selector-tag">p</span> {
  <span class="hljs-attribute">color</span>: green;
}
</code></pre>
<h3 id="heading-what-it-does-4">What it does</h3>
<ul>
<li><p>Targets <code>&lt;p&gt;</code> elements <strong>inside a</strong> <code>&lt;div&gt;</code></p>
</li>
<li><p>Does not affect paragraphs outside</p>
</li>
</ul>
<h3 id="heading-why-its-useful">Why it’s useful</h3>
<ul>
<li><p>Helps in <strong>structured and clean styling</strong></p>
</li>
<li><p>Very common in real projects</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769509264566/750cda60-d9a9-43cb-bcc7-6281e8a49e25.png" alt class="image--center mx-auto" /></p>
<p><code>&gt;</code></p>
<h2 id="heading-basic-selector-priority-very-high-level">Basic Selector Priority (Very High Level)</h2>
<p>When multiple selectors target the same element, CSS follows a priority rule.</p>
<h3 id="heading-simple-priority-order">Simple Priority Order:</h3>
<ol>
<li><p><strong>ID selector</strong> (highest)</p>
</li>
<li><p><strong>Class selector</strong></p>
</li>
<li><p><strong>Element selector</strong> (lowest)</p>
</li>
</ol>
<h3 id="heading-example-5">Example</h3>
<pre><code class="lang-css"><span class="hljs-selector-tag">p</span> { <span class="hljs-attribute">color</span>: blue; }
<span class="hljs-selector-class">.text</span> { <span class="hljs-attribute">color</span>: green; }
<span class="hljs-selector-id">#para</span> { <span class="hljs-attribute">color</span>: red; }
</code></pre>
<p>The text becomes <strong>red</strong> because <strong>ID has the highest priority</strong>.</p>
<h2 id="heading-before-and-after-styling-example">Before and After Styling Example</h2>
<h3 id="heading-html">HTML</h3>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">p</span> <span class="hljs-selector-tag">class</span>="<span class="hljs-selector-tag">note</span>"&gt;<span class="hljs-selector-tag">This</span> <span class="hljs-selector-tag">is</span> <span class="hljs-selector-tag">a</span> <span class="hljs-selector-tag">note</span>&lt;/<span class="hljs-selector-tag">p</span>&gt;
</code></pre>
<h3 id="heading-css">CSS</h3>
<pre><code class="lang-css"><span class="hljs-selector-class">.note</span> {
  <span class="hljs-attribute">color</span>: purple;
  <span class="hljs-attribute">font-size</span>: <span class="hljs-number">18px</span>;
}
</code></pre>
<h3 id="heading-result">Result</h3>
<p>The paragraph becomes <strong>larger and purple</strong>, clearly showing how selectors work.</p>
<h2 id="heading-why-css-selectors-are-the-foundation-of-css">Why CSS Selectors Are the Foundation of CSS</h2>
<ul>
<li><p>Every CSS rule starts with a selector</p>
</li>
<li><p>Without selectors, CSS is useless</p>
</li>
<li><p>Strong selector knowledge = better layouts</p>
</li>
</ul>
<p>If you master selectors:</p>
<ul>
<li><p>CSS becomes easier</p>
</li>
<li><p>Debugging becomes simpler</p>
</li>
<li><p>Styling feels logical, not confusing</p>
</li>
</ul>
<h2 id="heading-final-thoughts">Final Thoughts</h2>
<p>CSS selectors are not hard —<br />they just need <strong>clear understanding and practice</strong>.</p>
<p>Start with:</p>
<ul>
<li><p>Element selectors</p>
</li>
<li><p>Class selectors</p>
</li>
<li><p>ID selectors</p>
</li>
</ul>
<p>Once these are clear, advanced CSS becomes much easier.</p>
<p>Learn selectors well — and CSS will stop feeling scary.</p>
]]></content:encoded></item><item><title><![CDATA[Understanding HTML Tags and Elements]]></title><description><![CDATA[What HTML Is and Why We Use It
HTML stands for HyperText Markup Language.
HTML is used to:

Create the structure of a webpage

Tell the browser what content exists

Organize text, images, links, buttons, etc.


In simple words:
HTML is the skeleton o...]]></description><link>https://piyushtiwari888.hashnode.dev/understanding-html-tags-and-elements</link><guid isPermaLink="true">https://piyushtiwari888.hashnode.dev/understanding-html-tags-and-elements</guid><category><![CDATA[HTML5]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[tags]]></category><category><![CDATA[HTML tags ]]></category><category><![CDATA[ChaiCohort]]></category><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[Piyush Tiwari]]></dc:creator><pubDate>Tue, 27 Jan 2026 09:49:10 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769507230872/94339bc9-d2a1-4ab5-b3f1-c4e2fdff4c20.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-what-html-is-and-why-we-use-it">What HTML Is and Why We Use It</h2>
<p>HTML stands for <strong>HyperText Markup Language</strong>.</p>
<p>HTML is used to:</p>
<ul>
<li><p>Create the structure of a webpage</p>
</li>
<li><p>Tell the browser <strong>what content exists</strong></p>
</li>
<li><p>Organize text, images, links, buttons, etc.</p>
</li>
</ul>
<p>In simple words:</p>
<p>HTML is the <strong>skeleton</strong> of a webpage.</p>
<p>Just like the human body needs a skeleton to have shape,<br />a webpage needs HTML to exist in a structured form.</p>
<h2 id="heading-html-as-the-skeleton-of-a-webpage">HTML as the Skeleton of a Webpage</h2>
<p>Think of a webpage like a house:</p>
<ul>
<li><p>HTML → structure (walls, rooms)</p>
</li>
<li><p>CSS → design (colors, styling)</p>
</li>
<li><p>JavaScript → behavior (interactions)</p>
</li>
</ul>
<p>Without HTML, there is <strong>nothing to style or interact with</strong>.</p>
<h2 id="heading-what-an-html-tag-is">What an HTML Tag Is</h2>
<p>An <strong>HTML tag</strong> is a keyword wrapped inside angle brackets <code>&lt; &gt;</code>.</p>
<p>Example:</p>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">p</span>&gt;
</code></pre>
<p>Tags tell the browser</p>
<p>“This content has a specific meaning or role.”</p>
<h2 id="heading-opening-tag-closing-tag-and-content">Opening Tag, Closing Tag, and Content</h2>
<p>Most HTML tags come in <strong>pairs</strong>.</p>
<p>Example:</p>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">p</span>&gt;<span class="hljs-selector-tag">Hello</span> <span class="hljs-selector-tag">World</span>&lt;/<span class="hljs-selector-tag">p</span>&gt;
</code></pre>
<p>Here:</p>
<ul>
<li><p><code>&lt;p&gt;</code> → Opening tag</p>
</li>
<li><p><code>&lt;/p&gt;</code> → Closing tag</p>
</li>
<li><p><code>Hello World</code> → Content</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769506632853/70c88536-421b-46e0-839a-e4a90def1b06.jpeg" alt class="image--center mx-auto" /></p>
<h2 id="heading-what-an-html-element-means">What an HTML Element Means</h2>
<p>This is a very important concept.</p>
<p><strong>HTML Element = Opening tag + Content + Closing tag</strong></p>
<p>Example:</p>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">p</span>&gt;<span class="hljs-selector-tag">Hello</span> <span class="hljs-selector-tag">World</span>&lt;/<span class="hljs-selector-tag">p</span>&gt;
</code></pre>
<p>The <strong>entire line</strong> is one HTML element.</p>
<h3 id="heading-difference-between-tag-and-element">Difference between Tag and Element</h3>
<ul>
<li><p><strong>Tag</strong> → <code>&lt;p&gt;</code> or <code>&lt;/p&gt;</code></p>
</li>
<li><p><strong>Element</strong> → <code>&lt;p&gt;Hello World&lt;/p&gt;</code></p>
</li>
</ul>
<p>Many beginners confuse this — so remember:</p>
<p>Tags build elements.</p>
<h2 id="heading-self-closing-void-elements">Self-Closing (Void) Elements</h2>
<p>Some HTML elements <strong>do not have content</strong>.</p>
<p>They are called:</p>
<ul>
<li><p>Self-closing elements</p>
</li>
<li><p>Void elements</p>
</li>
</ul>
<p>Examples:</p>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">img</span> <span class="hljs-selector-tag">src</span>="<span class="hljs-selector-tag">image</span><span class="hljs-selector-class">.jpg</span>"&gt;
&lt;<span class="hljs-selector-tag">br</span>&gt;
&lt;<span class="hljs-selector-tag">hr</span>&gt;
</code></pre>
<p>These elements:</p>
<ul>
<li><p>Do not have closing tags</p>
</li>
<li><p>Are complete by themselves</p>
</li>
</ul>
<h2 id="heading-block-level-vs-inline-elements">Block-Level vs Inline Elements</h2>
<p>HTML elements behave differently on the page.</p>
<h3 id="heading-block-level-elements">Block-Level Elements</h3>
<ul>
<li><p>Take full width</p>
</li>
<li><p>Start on a new line</p>
</li>
</ul>
<p>Examples:</p>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">div</span>&gt;
&lt;<span class="hljs-selector-tag">h1</span>&gt;
&lt;<span class="hljs-selector-tag">p</span>&gt;
&lt;<span class="hljs-selector-tag">section</span>&gt;
</code></pre>
<h3 id="heading-inline-elements">Inline Elements</h3>
<ul>
<li><p>Take only required width</p>
</li>
<li><p>Stay in the same line</p>
</li>
</ul>
<p>Examples:</p>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">span</span>&gt;
&lt;<span class="hljs-selector-tag">a</span>&gt;
&lt;<span class="hljs-selector-tag">strong</span>&gt;
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769506931534/34e82905-c14e-4ed9-9844-272545dd9601.webp" alt class="image--center mx-auto" /></p>
<p>Commonly Used HTML Tags</p>
<p>Here are some <strong>basic and commonly used tags</strong> for beginners:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Tag</td><td>Purpose</td></tr>
</thead>
<tbody>
<tr>
<td><code>&lt;h1&gt;</code> to <code>&lt;h6&gt;</code></td><td>Headings</td></tr>
<tr>
<td><code>&lt;p&gt;</code></td><td>Paragraph</td></tr>
<tr>
<td><code>&lt;div&gt;</code></td><td>Container</td></tr>
<tr>
<td><code>&lt;span&gt;</code></td><td>Inline container</td></tr>
<tr>
<td><code>&lt;a&gt;</code></td><td>Link</td></tr>
<tr>
<td><code>&lt;img&gt;</code></td><td>Image</td></tr>
<tr>
<td><code>&lt;br&gt;</code></td><td>Line break</td></tr>
</tbody>
</table>
</div><h2 id="heading-simple-examples-to-understand-better">Simple Examples to Understand Better</h2>
<h3 id="heading-paragraph">Paragraph</h3>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">p</span>&gt;<span class="hljs-selector-tag">This</span> <span class="hljs-selector-tag">is</span> <span class="hljs-selector-tag">a</span> <span class="hljs-selector-tag">paragraph</span>&lt;/<span class="hljs-selector-tag">p</span>&gt;
</code></pre>
<h3 id="heading-heading">Heading</h3>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">h1</span>&gt;<span class="hljs-selector-tag">Main</span> <span class="hljs-selector-tag">Heading</span>&lt;/<span class="hljs-selector-tag">h1</span>&gt;
</code></pre>
<h3 id="heading-div-and-span">Div and Span</h3>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">div</span>&gt;
  &lt;<span class="hljs-selector-tag">span</span>&gt;<span class="hljs-selector-tag">Inline</span> <span class="hljs-selector-tag">text</span>&lt;/<span class="hljs-selector-tag">span</span>&gt;
&lt;/<span class="hljs-selector-tag">div</span>&gt;
</code></pre>
<p>These are the most used tags in real projects.</p>
<h2 id="heading-tags-explained-using-an-analogy">Tags Explained Using an Analogy</h2>
<p>Think of HTML like <strong>labelled boxes</strong>:</p>
<ul>
<li><p>Tag → Box label</p>
</li>
<li><p>Content → Item inside the box</p>
</li>
<li><p>Element → Complete box</p>
</li>
</ul>
<p>This helps the browser understand <strong>how to treat the content</strong>.</p>
<h2 id="heading-encourage-yourself-to-inspect-html-in-the-browser">Encourage Yourself to Inspect HTML in the Browser</h2>
<p>Right-click on any webpage → <strong>Inspect</strong></p>
<p>You’ll see:</p>
<ul>
<li><p>Real HTML</p>
</li>
<li><p>Real tags</p>
</li>
<li><p>Real elements</p>
</li>
</ul>
<p>This is one of the <strong>best ways to learn HTML</strong>.</p>
<h2 id="heading-keep-this-in-mind-as-a-beginner">Keep This in Mind as a Beginner</h2>
<ul>
<li><p>Don’t memorize all tags</p>
</li>
<li><p>Focus on understanding structure</p>
</li>
<li><p>Practice small examples</p>
</li>
<li><p>HTML becomes easy with repetition</p>
</li>
</ul>
<h2 id="heading-final-thoughts">Final Thoughts</h2>
<p>HTML is simple, logical, and beginner-friendly.</p>
<p>Once you understand:</p>
<ul>
<li><p>What a tag is</p>
</li>
<li><p>What an element is</p>
</li>
<li><p>Block vs inline behavior</p>
</li>
</ul>
<p>You build a <strong>strong foundation</strong> for CSS and JavaScript.</p>
<p>HTML is not hard —<br />it just needs <strong>clear understanding and practice</strong>.</p>
]]></content:encoded></item><item><title><![CDATA[Emmet for HTML: A Beginner’s Guide to Writing Faster Markup]]></title><description><![CDATA[Writing HTML Without Emmet Feels Slow
If you are a beginner, you probably write HTML like this:
<div>
  <h1></h1>
  <p></p>
</div>

Typing every opening tag, closing tag, indentation —it works, but it feels slow and repetitive.
Now imagine doing this...]]></description><link>https://piyushtiwari888.hashnode.dev/emmet-for-html-a-beginners-guide-to-writing-faster-markup</link><guid isPermaLink="true">https://piyushtiwari888.hashnode.dev/emmet-for-html-a-beginners-guide-to-writing-faster-markup</guid><category><![CDATA[#emmet #html #htmlelemnts #boilerplate ]]></category><category><![CDATA[Emmet]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[ChaiCohort]]></category><category><![CDATA[Web Development]]></category><dc:creator><![CDATA[Piyush Tiwari]]></dc:creator><pubDate>Tue, 27 Jan 2026 09:24:37 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769505384098/c08e014d-a37f-40b9-9141-eda23b71b8da.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-writing-html-without-emmet-feels-slow">Writing HTML Without Emmet Feels Slow</h2>
<p>If you are a beginner, you probably write HTML like this:</p>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">div</span>&gt;
  &lt;<span class="hljs-selector-tag">h1</span>&gt;&lt;/<span class="hljs-selector-tag">h1</span>&gt;
  &lt;<span class="hljs-selector-tag">p</span>&gt;&lt;/<span class="hljs-selector-tag">p</span>&gt;
&lt;/<span class="hljs-selector-tag">div</span>&gt;
</code></pre>
<p>Typing every opening tag, closing tag, indentation —<br />it works, but it feels <strong>slow and repetitive</strong>.</p>
<p>Now imagine doing this again and again for:</p>
<ul>
<li><p>Lists</p>
</li>
<li><p>Cards</p>
</li>
<li><p>Forms</p>
</li>
<li><p>Layout sections</p>
</li>
</ul>
<p>This is where <strong>Emmet</strong> saves your time.</p>
<h2 id="heading-what-emmet-is">What Emmet Is ?</h2>
<p><strong>Emmet</strong> is a <strong>shortcut language for writing HTML faster</strong>.</p>
<p>You write a short expression → Emmet expands it into full HTML.</p>
<p>In one line:</p>
<p>Emmet helps you write more HTML by typing less.</p>
<p>It’s not a new language,<br />it’s just a <strong>productivity tool</strong> built into code editors.</p>
<h2 id="heading-why-emmet-is-useful-for-html-beginners">Why Emmet Is Useful for HTML Beginners</h2>
<p>For beginners, Emmet:</p>
<ul>
<li><p>Reduces typing effort</p>
</li>
<li><p>Helps focus on <strong>structure</strong>, not syntax</p>
</li>
<li><p>Makes HTML feel less boring</p>
</li>
<li><p>Builds confidence quickly</p>
</li>
</ul>
<p>Important point:</p>
<p>1.Emmet does NOT replace HTML</p>
<p>2.it only helps you write HTML faster</p>
<h2 id="heading-how-emmet-works-inside-code-editors">How Emmet Works Inside Code Editors</h2>
<p>Emmet is built into modern editors like:</p>
<ul>
<li><p>VS Code (recommended)</p>
</li>
<li><p>Sublime Text</p>
</li>
<li><p>Atom</p>
</li>
</ul>
<p>How it works:</p>
<ol>
<li><p>You type an Emmet abbreviation</p>
</li>
<li><p>You press <strong>Tab</strong> (or Enter)</p>
</li>
<li><p>Editor expands it into HTML</p>
</li>
</ol>
<p>No extra setup needed in VS Code.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769505230291/186a89a4-f80a-49c4-85a6-944ef926dc2d.webp" alt class="image--center mx-auto" /></p>
<h2 id="heading-basic-emmet-syntax-and-abbreviations">Basic Emmet Syntax and Abbreviations</h2>
<p>Emmet uses <strong>simple symbols</strong>:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Symbol</td><td>Meaning</td></tr>
</thead>
<tbody>
<tr>
<td><code>div</code></td><td>HTML element</td></tr>
<tr>
<td><code>&gt;</code></td><td>Child (nesting)</td></tr>
<tr>
<td><code>.</code></td><td>Class</td></tr>
<tr>
<td><code>#</code></td><td>ID</td></tr>
<tr>
<td><code>*</code></td><td>Repeat</td></tr>
<tr>
<td><code>+</code></td><td>Sibling</td></tr>
</tbody>
</table>
</div><h2 id="heading-creating-html-elements-using-emmet">Creating HTML Elements Using Emmet</h2>
<h3 id="heading-emmet-abbreviation">Emmet Abbreviation</h3>
<pre><code class="lang-css"><span class="hljs-selector-tag">div</span>
</code></pre>
<p>Press <strong>Tab</strong></p>
<h3 id="heading-expanded-html">Expanded HTML</h3>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">div</span>&gt;&lt;/<span class="hljs-selector-tag">div</span>&gt;
</code></pre>
<p>Another example:</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">p</span>
</code></pre>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">p</span>&gt;&lt;/<span class="hljs-selector-tag">p</span>&gt;
</code></pre>
<h2 id="heading-adding-classes-ids-and-attributes">Adding Classes, IDs, and Attributes</h2>
<h3 id="heading-class">Class</h3>
<pre><code class="lang-css"><span class="hljs-selector-tag">div</span><span class="hljs-selector-class">.container</span>
</code></pre>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">div</span> <span class="hljs-selector-tag">class</span>="<span class="hljs-selector-tag">container</span>"&gt;&lt;/<span class="hljs-selector-tag">div</span>&gt;
</code></pre>
<h3 id="heading-id">ID</h3>
<pre><code class="lang-css"><span class="hljs-selector-tag">section</span><span class="hljs-selector-id">#hero</span>
</code></pre>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">section</span> <span class="hljs-selector-tag">id</span>="<span class="hljs-selector-tag">hero</span>"&gt;&lt;/<span class="hljs-selector-tag">section</span>&gt;
</code></pre>
<h3 id="heading-class-id-together">Class + ID together</h3>
<pre><code class="lang-css"><span class="hljs-selector-tag">div</span><span class="hljs-selector-class">.card</span><span class="hljs-selector-id">#product</span>
</code></pre>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">div</span> <span class="hljs-selector-tag">class</span>="<span class="hljs-selector-tag">card</span>" <span class="hljs-selector-tag">id</span>="<span class="hljs-selector-tag">product</span>"&gt;&lt;/<span class="hljs-selector-tag">div</span>&gt;
</code></pre>
<h2 id="heading-creating-nested-elements">Creating Nested Elements</h2>
<p>Nesting means <strong>elements inside elements</strong>.</p>
<h3 id="heading-emmet-abbreviation-1">Emmet Abbreviation</h3>
<pre><code class="lang-css"><span class="hljs-selector-tag">div</span>&gt;<span class="hljs-selector-tag">h1</span>+<span class="hljs-selector-tag">p</span>
</code></pre>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">div</span>&gt;
  &lt;<span class="hljs-selector-tag">h1</span>&gt;&lt;/<span class="hljs-selector-tag">h1</span>&gt;
  &lt;<span class="hljs-selector-tag">p</span>&gt;&lt;/<span class="hljs-selector-tag">p</span>&gt;
&lt;/<span class="hljs-selector-tag">div</span>&gt;
</code></pre>
<h2 id="heading-repeating-elements-using-multiplication">Repeating Elements Using Multiplication</h2>
<p>Let’s say you want <strong>3 list items</strong>.</p>
<h3 id="heading-emmet-abbreviation-2">Emmet Abbreviation</h3>
<pre><code class="lang-css"><span class="hljs-selector-tag">li</span>*3
</code></pre>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">li</span>&gt;&lt;/<span class="hljs-selector-tag">li</span>&gt;
&lt;<span class="hljs-selector-tag">li</span>&gt;&lt;/<span class="hljs-selector-tag">li</span>&gt;
&lt;<span class="hljs-selector-tag">li</span>&gt;&lt;/<span class="hljs-selector-tag">li</span>&gt;
</code></pre>
<p>Now with a list:</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">ul</span>&gt;<span class="hljs-selector-tag">li</span>*4
</code></pre>
<pre><code class="lang-css">&lt;<span class="hljs-selector-tag">ul</span>&gt;
  &lt;<span class="hljs-selector-tag">li</span>&gt;&lt;/<span class="hljs-selector-tag">li</span>&gt;
  &lt;<span class="hljs-selector-tag">li</span>&gt;&lt;/<span class="hljs-selector-tag">li</span>&gt;
  &lt;<span class="hljs-selector-tag">li</span>&gt;&lt;/<span class="hljs-selector-tag">li</span>&gt;
  &lt;<span class="hljs-selector-tag">li</span>&gt;&lt;/<span class="hljs-selector-tag">li</span>&gt;
&lt;/<span class="hljs-selector-tag">ul</span>&gt;
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769505595480/9eff94a3-1dca-49e5-9313-b20694c1077a.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-generating-full-html-boilerplate-with-emmet">Generating Full HTML Boilerplate with Emmet</h2>
<p>This is one of the <strong>most popular Emmet features</strong>.</p>
<h3 id="heading-emmet-abbreviation-3">Emmet Abbreviation</h3>
<pre><code class="lang-css">!
</code></pre>
<p>Press <strong>Tab</strong></p>
<pre><code class="lang-css">&lt;!<span class="hljs-selector-tag">DOCTYPE</span> <span class="hljs-selector-tag">html</span>&gt;
&lt;<span class="hljs-selector-tag">html</span> <span class="hljs-selector-tag">lang</span>="<span class="hljs-selector-tag">en</span>"&gt;
&lt;<span class="hljs-selector-tag">head</span>&gt;
  &lt;<span class="hljs-selector-tag">meta</span> <span class="hljs-selector-tag">charset</span>="<span class="hljs-selector-tag">UTF-8</span>"&gt;
  &lt;<span class="hljs-selector-tag">meta</span> <span class="hljs-selector-tag">name</span>="<span class="hljs-selector-tag">viewport</span>" <span class="hljs-selector-tag">content</span>="<span class="hljs-selector-tag">width</span>=<span class="hljs-selector-tag">device-width</span>, <span class="hljs-selector-tag">initial-scale</span>=1<span class="hljs-selector-class">.0</span>"&gt;
  &lt;<span class="hljs-selector-tag">title</span>&gt;<span class="hljs-selector-tag">Document</span>&lt;/<span class="hljs-selector-tag">title</span>&gt;
&lt;/<span class="hljs-selector-tag">head</span>&gt;
&lt;<span class="hljs-selector-tag">body</span>&gt;

&lt;/<span class="hljs-selector-tag">body</span>&gt;
&lt;/<span class="hljs-selector-tag">html</span>&gt;
</code></pre>
<h2 id="heading-emmet-workflow-inside-a-code-editor">Emmet Workflow Inside a Code Editor</h2>
<p>Daily workflow looks like this:</p>
<ol>
<li><p>Think of structure</p>
</li>
<li><p>Write short Emmet expression</p>
</li>
<li><p>Press Tab</p>
</li>
<li><p>Edit content</p>
</li>
</ol>
<p>This keeps you:</p>
<ul>
<li><p>Fast</p>
</li>
<li><p>Focused</p>
</li>
<li><p>Productive</p>
</li>
</ul>
<h2 id="heading-common-beginner-tips">Common Beginner Tips</h2>
<ul>
<li><p>Try every example yourself</p>
</li>
<li><p>Use Emmet slowly at first</p>
</li>
<li><p>Don’t memorize — practice</p>
</li>
<li><p>Use it only where it helps</p>
</li>
</ul>
<p>Remember:</p>
<p>Emmet is optional, but once you get used to it,<br />you won’t want to write HTML without it.</p>
<h2 id="heading-final-thoughts">Final Thoughts</h2>
<p>Emmet does not make you a better developer overnight —<br />but it <strong>removes friction</strong> from writing HTML.</p>
<p>For beginners:</p>
<ul>
<li><p>Less typing</p>
</li>
<li><p>Less frustration</p>
</li>
<li><p>More learning</p>
</li>
</ul>
<p>If you are learning HTML &amp; CSS,<br />Emmet is one of the <strong>best productivity tools</strong> you can start with.</p>
]]></content:encoded></item><item><title><![CDATA[How a Browser Works: A Beginner-Friendly Guide to Browser Internals]]></title><description><![CDATA[What a browser actually is ?
Most people say:
“Browser website kholta hai.”
But technically, a browser is a software system that:

Talks to servers

Downloads HTML, CSS, and JavaScript

Understands these files

Converts them into a visual page

Displ...]]></description><link>https://piyushtiwari888.hashnode.dev/how-a-browser-works-a-beginner-friendly-guide-to-browser-internals</link><guid isPermaLink="true">https://piyushtiwari888.hashnode.dev/how-a-browser-works-a-beginner-friendly-guide-to-browser-internals</guid><category><![CDATA[Browsers]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[#HiteshChaudhary ]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[Web Development]]></category><dc:creator><![CDATA[Piyush Tiwari]]></dc:creator><pubDate>Mon, 26 Jan 2026 14:42:03 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769437892430/07806356-b022-4d5d-bdb7-6e49eec5c5f1.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-what-a-browser-actually-is">What a browser actually is ?</h2>
<p>Most people say:</p>
<p>“Browser website kholta hai.”</p>
<p>But technically, a <strong>browser is a software system</strong> that:</p>
<ul>
<li><p>Talks to servers</p>
</li>
<li><p>Downloads HTML, CSS, and JavaScript</p>
</li>
<li><p>Understands these files</p>
</li>
<li><p>Converts them into a <strong>visual page</strong></p>
</li>
<li><p>Displays pixels on your screen</p>
</li>
</ul>
<p>In simple words:</p>
<p>A browser is a <strong>translator + builder + painter</strong>.</p>
<p>It translates code into something humans can see and interact with.</p>
<h2 id="heading-start-with-a-simple-question">Start with a simple question:</h2>
<h2 id="heading-what-happens-after-i-type-a-url-and-press-enter">“What happens after I type a URL and press Enter?”</h2>
<p>When you type a URL and press Enter:</p>
<ol>
<li><p>Browser sends a request to a server</p>
</li>
<li><p>Server sends back HTML, CSS, JS</p>
</li>
<li><p>Browser reads and understands this code</p>
</li>
<li><p>Browser builds internal structures</p>
</li>
<li><p>Browser calculates layout</p>
</li>
<li><p>Browser paints pixels on the screen</p>
</li>
</ol>
<p>All this happens in <strong>milliseconds</strong>.</p>
<h2 id="heading-main-parts-of-a-browser">Main parts of a browser</h2>
<p>A browser is <strong>not one single thing</strong>.<br />It is a collection of components working together.</p>
<p>High-level parts:</p>
<ul>
<li><p>User Interface</p>
</li>
<li><p>Browser Engine</p>
</li>
<li><p>Rendering Engine</p>
</li>
<li><p>Networking</p>
</li>
<li><p>JavaScript Engine</p>
</li>
<li><p>Data Storage</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769438115073/1231fa08-3a78-4286-8aa4-c758997c63d7.webp" alt class="image--center mx-auto" /></p>
<h2 id="heading-user-interface-address-bar-tabs-buttons">User Interface: address bar, tabs, buttons</h2>
<p>This is the part <strong>you interact with</strong>.</p>
<p>It includes:</p>
<ul>
<li><p>Address bar</p>
</li>
<li><p>Back / forward buttons</p>
</li>
<li><p>Tabs</p>
</li>
<li><p>Bookmarks</p>
</li>
</ul>
<p>Important point:</p>
<p>The UI does NOT render the webpage itself.</p>
<p>It only takes input from the user and shows output from the browser engine.</p>
<h2 id="heading-browser-engine-vs-rendering-engine">Browser Engine vs Rendering Engine</h2>
<p>This is where beginners often get confused — so let’s keep it simple.</p>
<h3 id="heading-browser-engine">Browser Engine</h3>
<ul>
<li><p>Acts as a <strong>controller</strong></p>
</li>
<li><p>Connects UI with rendering engine</p>
</li>
<li><p>Decides <em>what should happen next</em></p>
</li>
</ul>
<h3 id="heading-rendering-engine">Rendering Engine</h3>
<ul>
<li><p>Responsible for <strong>displaying content</strong></p>
</li>
<li><p>Converts HTML + CSS into pixels</p>
</li>
</ul>
<p>Think like this:</p>
<ul>
<li><p>Browser Engine = Manager</p>
</li>
<li><p>Rendering Engine = Worker</p>
</li>
</ul>
<p>Names you may hear:</p>
<ul>
<li><p>Chromium (Chrome)</p>
</li>
<li><p>Gecko (Firefox)</p>
</li>
</ul>
<h2 id="heading-networking-how-a-browser-fetches-html-css-js">Networking: how a browser fetches HTML, CSS, JS</h2>
<p>Browser has a <strong>networking layer</strong> that:</p>
<ul>
<li><p>Sends HTTP requests</p>
</li>
<li><p>Receives responses from servers</p>
</li>
<li><p>Downloads:</p>
<ul>
<li><p>HTML</p>
</li>
<li><p>CSS</p>
</li>
<li><p>JavaScript</p>
</li>
<li><p>Images</p>
</li>
</ul>
</li>
</ul>
<p>This is where:</p>
<ul>
<li><p>DNS</p>
</li>
<li><p>TCP</p>
</li>
<li><p>HTTP<br />  come into play.</p>
</li>
</ul>
<h2 id="heading-html-parsing-and-dom-creation">HTML parsing and DOM creation</h2>
<p>Once HTML is downloaded, the browser <strong>parses</strong> it.</p>
<p>Parsing means:</p>
<p>Reading the code and understanding its structure.</p>
<p>From HTML, the browser creates the <strong>DOM (Document Object Model)</strong>.</p>
<p>DOM is:</p>
<ul>
<li><p>A tree-like structure</p>
</li>
<li><p>Each HTML tag becomes a node</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769438231107/d2a562a2-d2b5-44f9-87d2-d8eefdf93dc8.webp" alt class="image--center mx-auto" /></p>
<h2 id="heading-very-basic-idea-of-parsing-simple-math-example">Very basic idea of parsing (simple math example)</h2>
<p>Take this expression:</p>
<p>2 + 3 × 4</p>
<p>Parsing means:</p>
<ul>
<li><p>Breaking it into parts</p>
</li>
<li><p>Understanding order</p>
</li>
<li><p>Creating a structure</p>
</li>
</ul>
<p>Which becomes:</p>
<ul>
<li><p>+ at top</p>
</li>
<li><p>2 on one side</p>
</li>
<li><p>3×4 on the other</p>
</li>
</ul>
<h2 id="heading-css-parsing-and-cssom-creation">CSS parsing and CSSOM creation</h2>
<p>Just like HTML creates DOM,<br />CSS creates <strong>CSSOM (CSS Object Model)</strong>.</p>
<p>CSSOM:</p>
<ul>
<li><p>Represents styles</p>
</li>
<li><p>Also structured like a tree</p>
</li>
<li><p>Tells browser:</p>
<ul>
<li><p>Colors</p>
</li>
<li><p>Sizes</p>
</li>
<li><p>Positions</p>
</li>
<li><p>Fonts</p>
</li>
</ul>
</li>
</ul>
<p>DOM = structure<br />CSSOM = styling</p>
<h2 id="heading-how-dom-and-cssom-come-together">How DOM and CSSOM come together</h2>
<p>DOM alone doesn’t know how things look.<br />CSSOM alone doesn’t know <em>what</em> to style.</p>
<p>So browser combines them to create:</p>
<h3 id="heading-render-tree">Render Tree</h3>
<p>Render Tree:</p>
<ul>
<li><p>Contains only visible elements</p>
</li>
<li><p>Has structure + styles</p>
</li>
</ul>
<h2 id="heading-layout-reflow-painting-and-display">Layout (reflow), painting, and display</h2>
<p>After Render Tree is ready:</p>
<h3 id="heading-1-layout-reflow">1. Layout (Reflow)</h3>
<ul>
<li>Calculates exact position and size of elements</li>
</ul>
<h3 id="heading-2-painting">2. Painting</h3>
<ul>
<li><p>Fills colors</p>
</li>
<li><p>Draws text</p>
</li>
<li><p>Applies borders</p>
</li>
</ul>
<h3 id="heading-3-display">3. Display</h3>
<ul>
<li>Pixels appear on screen</li>
</ul>
<p>This is how code becomes <strong>visible UI</strong>.</p>
<h2 id="heading-full-browser-flow-from-url-to-pixels">Full browser flow: from URL to pixels</h2>
<p>Putting everything together:</p>
<ol>
<li><p>URL entered</p>
</li>
<li><p>Network request sent</p>
</li>
<li><p>HTML received</p>
</li>
<li><p>DOM created</p>
</li>
<li><p>CSS received</p>
</li>
<li><p>CSSOM created</p>
</li>
<li><p>Render Tree built</p>
</li>
<li><p>Layout calculated</p>
</li>
<li><p>Paint happens</p>
</li>
<li><p>Page displayed</p>
</li>
</ol>
<p>Final reassurance for beginners</p>
<p>You <strong>do not need to remember everything</strong>.</p>
<p>The goal is to understand:</p>
<ul>
<li><p>Browser is a system</p>
</li>
<li><p>Many parts work together</p>
</li>
<li><p>Flow matters more than terms</p>
</li>
</ul>
<p>With time:</p>
<ul>
<li><p>DOM will feel natural</p>
</li>
<li><p>CSSOM will make sense</p>
</li>
<li><p>Rendering will not feel scary</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Getting Started with cURL]]></title><description><![CDATA[Before cURL: What is a Server and Why Do We Need to Talk to It?
A server is simply a computer that:

Stores data

Runs applications

Responds to requests from users


When you open a website:

Your device sends a request to a server

The server sends...]]></description><link>https://piyushtiwari888.hashnode.dev/getting-started-with-curl</link><guid isPermaLink="true">https://piyushtiwari888.hashnode.dev/getting-started-with-curl</guid><category><![CDATA[curl]]></category><category><![CDATA[curl-command]]></category><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[#piyushgarag]]></category><category><![CDATA[Web Development]]></category><dc:creator><![CDATA[Piyush Tiwari]]></dc:creator><pubDate>Mon, 26 Jan 2026 14:14:51 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769436182936/4a2c4cf6-861d-4bb0-b6fa-4b97f807fe85.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-before-curl-what-is-a-server-and-why-do-we-need-to-talk-to-it">Before cURL: What is a Server and Why Do We Need to Talk to It?</h2>
<p>A <strong>server</strong> is simply a computer that:</p>
<ul>
<li><p>Stores data</p>
</li>
<li><p>Runs applications</p>
</li>
<li><p>Responds to requests from users</p>
</li>
</ul>
<p>When you open a website:</p>
<ul>
<li><p>Your device sends a request to a server</p>
</li>
<li><p>The server sends back a response (HTML, JSON, data, etc.)</p>
</li>
</ul>
<p>This request–response communication is the <strong>foundation of the web</strong>.</p>
<h2 id="heading-what-is-curl">What is cURL?</h2>
<p><strong>cURL</strong> is a command-line tool used to <strong>send requests to a server</strong> and <strong>see the response</strong>.</p>
<p>In simple words:</p>
<p>cURL lets you talk to a server from the terminal.</p>
<p>It works with:</p>
<ul>
<li><p>Websites</p>
</li>
<li><p>APIs</p>
</li>
<li><p>Backend services</p>
</li>
</ul>
<p>You type a command → server responds → you see the result.</p>
<h2 id="heading-why-programmers-need-curl">Why Programmers Need cURL</h2>
<p>Programmers use cURL to:</p>
<ul>
<li><p>Test APIs</p>
</li>
<li><p>Check server responses</p>
</li>
<li><p>Debug backend issues</p>
</li>
<li><p>Learn how HTTP works</p>
</li>
<li><p>Verify if a server is up or not</p>
</li>
</ul>
<p>Unlike a browser:</p>
<ul>
<li><p>cURL is fast</p>
</li>
<li><p>cURL is simple</p>
</li>
<li><p>cURL shows raw responses</p>
</li>
</ul>
<p>For backend developers, cURL is like a <strong>basic testing tool</strong>.</p>
<h2 id="heading-making-your-first-request-using-curl">Making Your First Request Using cURL</h2>
<p>Let’s start with the <strong>simplest possible command</strong>.</p>
<p>curl <a target="_blank" href="https://example.com">https://example.com</a></p>
<p>What happens here?</p>
<ul>
<li><p>cURL sends a request to example.com</p>
</li>
<li><p>The server sends back a response</p>
</li>
<li><p>cURL prints that response in the terminal</p>
</li>
</ul>
<p>This is similar to opening a website — but <strong>without a browser</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769436424823/87a35618-86f9-42cf-86e0-c2b4c35b999a.webp" alt class="image--center mx-auto" /></p>
<p>Understanding Request and Response (High Level)</p>
<p>Every communication using cURL follows this pattern:</p>
<h3 id="heading-request">Request</h3>
<ul>
<li><p>Sent by client (you)</p>
</li>
<li><p>Contains:</p>
<ul>
<li><p>Method (GET / POST)</p>
</li>
<li><p>URL</p>
</li>
<li><p>Optional data</p>
</li>
</ul>
</li>
</ul>
<h3 id="heading-response">Response</h3>
<ul>
<li><p>Sent by server</p>
</li>
<li><p>Contains:</p>
<ul>
<li><p>Status code (200, 404, etc.)</p>
</li>
<li><p>Data (HTML, JSON, text)</p>
</li>
</ul>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769436554589/5abb91cb-413f-493a-ad41-cec87a2e6419.webp" alt class="image--center mx-auto" /></p>
<h2 id="heading-using-curl-to-talk-to-apis">Using cURL to Talk to APIs</h2>
<p>APIs are servers that return <strong>data instead of web pages</strong>.</p>
<p>Example:</p>
<p>curl <a target="_blank" href="https://api.github.com">https://api.github.com</a></p>
<p>You will see:</p>
<ul>
<li><p>JSON data</p>
</li>
<li><p>Metadata about the API</p>
</li>
</ul>
<p>This is extremely useful because:</p>
<ul>
<li><p>Backend developers work with APIs daily</p>
</li>
<li><p>cURL helps test APIs quickly without writing code</p>
</li>
</ul>
<h2 id="heading-introducing-get-and-post-only-the-basics">Introducing GET and POST (Only the Basics)</h2>
<h3 id="heading-get-request">GET Request</h3>
<p>Used to <strong>fetch data</strong>.</p>
<p>curl <a target="_blank" href="https://api.github.com/users/octocat">https://api.github.com/users/octocat</a></p>
<p>GET means:</p>
<p>“Give me information”</p>
<h3 id="heading-post-request">POST Request</h3>
<p>Used to <strong>send data</strong>.</p>
<p>curl -X POST <a target="_blank" href="https://example.com">https://example.com</a></p>
<p>POST means:</p>
<p>“I want to send something to you”</p>
<p>For now, just remember:</p>
<ul>
<li><p>GET = read data</p>
</li>
<li><p>POST = send data</p>
</li>
</ul>
<h2 id="heading-browser-request-vs-curl-request">Browser Request vs cURL Request</h2>
<p>When you open a website:</p>
<ul>
<li><p>Browser sends the request</p>
</li>
<li><p>Browser formats the response nicely</p>
</li>
</ul>
<p>With cURL:</p>
<ul>
<li><p>You send the request manually</p>
</li>
<li><p>You see the raw response</p>
</li>
</ul>
<p>This makes cURL perfect for:</p>
<ul>
<li><p>Learning</p>
</li>
<li><p>Debugging</p>
</li>
<li><p>Backend testing</p>
</li>
</ul>
<h2 id="heading-where-curl-fits-in-backend-development">Where cURL Fits in Backend Development</h2>
<p>In backend and production systems:</p>
<ul>
<li><p>cURL is used to test APIs</p>
</li>
<li><p>cURL checks server health</p>
</li>
<li><p>cURL helps debug issues quickly</p>
</li>
</ul>
<p>Even experienced engineers use cURL daily.</p>
]]></content:encoded></item><item><title><![CDATA[Network Devices Explained: How Modem, Router, Switch, Firewall, and Load Balancer Work Together]]></title><description><![CDATA[What is a Modem and how it connects your network to the internet?
A Modem is the entry point of the internet into your home or office.
Your Internet Service Provider (ISP) sends data over telephone lines, fiber, or cable.A modem’s job is to convert t...]]></description><link>https://piyushtiwari888.hashnode.dev/network-devices-explained-how-modem-router-switch-firewall-and-load-balancer-work-together</link><guid isPermaLink="true">https://piyushtiwari888.hashnode.dev/network-devices-explained-how-modem-router-switch-firewall-and-load-balancer-work-together</guid><category><![CDATA[modem]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[routing]]></category><category><![CDATA[#HiteshChaudhary ]]></category><dc:creator><![CDATA[Piyush Tiwari]]></dc:creator><pubDate>Thu, 22 Jan 2026 12:58:21 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769085975516/5662fe11-39cb-4b40-b432-9b37b09fa1ef.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-what-is-a-modem-and-how-it-connects-your-network-to-the-internet">What is a Modem and how it connects your network to the internet?</h2>
<p>A <strong>Modem</strong> is the <strong>entry point</strong> of the internet into your home or office.</p>
<p>Your Internet Service Provider (ISP) sends data over telephone lines, fiber, or cable.<br />A modem’s job is to <strong>convert</strong> that signal into digital data your devices can understand.</p>
<p>In simple terms:</p>
<p>Modem = Translator between ISP and your network</p>
<p>Without a modem, your local network would have <strong>no connection to the internet</strong>.</p>
<p><strong>example:</strong><br />A modem is like the <strong>post office counter</strong> where external mail enters your building.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769086286056/99ac5c78-ef0f-41b3-be52-b4e88db5c841.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-what-is-a-router-and-how-it-directs-traffic">What is a Router and how it directs traffic?</h2>
<p>A <strong>Router</strong> decides <strong>where data should go</strong>.</p>
<p>Once data enters through the modem, the router:</p>
<ul>
<li><p>Assigns IP addresses to devices</p>
</li>
<li><p>Routes traffic between local devices and the internet</p>
</li>
<li><p>Chooses the best path for outgoing packets</p>
</li>
</ul>
<p>In short:</p>
<p>Router = Traffic director of the network</p>
<p><strong>Analogy:</strong><br />A router is like a <strong>traffic police officer</strong> deciding which road each vehicle should take.</p>
<p>For software engineers, routers enable:</p>
<ul>
<li><p>Internet access</p>
</li>
<li><p>Local networking</p>
</li>
<li><p>Network Address Translation (NAT)</p>
</li>
</ul>
<h2 id="heading-switch-vs-hub-how-local-networks-actually-work">Switch vs Hub: how local networks actually work?</h2>
<h3 id="heading-hub-old-and-inefficient">Hub (Old and Inefficient)</h3>
<p>A <strong>Hub</strong> sends incoming data to <strong>all connected devices</strong>, whether they need it or not.</p>
<p>Problems:</p>
<ul>
<li><p>Wastes bandwidth</p>
</li>
<li><p>Causes collisions</p>
</li>
<li><p>No intelligence</p>
</li>
</ul>
<p><strong>Analogy:</strong><br />A hub is like <strong>shouting a message in a crowded room</strong>.</p>
<h3 id="heading-switch-modern-and-smart">Switch (Modern and Smart)</h3>
<p>A <strong>Switch</strong> sends data <strong>only to the intended device</strong> using MAC addresses.</p>
<p>Benefits:</p>
<ul>
<li><p>Faster</p>
</li>
<li><p>Secure</p>
</li>
<li><p>Efficient</p>
</li>
</ul>
<p><strong>Analogy:</strong><br />A switch is like <strong>hand-delivering a letter to the correct room</strong>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769086498768/92555a4a-b5ec-426e-9caf-9877718c5a95.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-what-is-a-firewall-and-why-security-lives-here">What is a Firewall and why security lives here?</h2>
<p>A <strong>Firewall</strong> protects your network by <strong>filtering traffic</strong>.</p>
<p>It:</p>
<ul>
<li><p>Allows trusted traffic</p>
</li>
<li><p>Blocks malicious or unauthorized access</p>
</li>
<li><p>Enforces security rules</p>
</li>
</ul>
<p>Firewalls sit between:</p>
<ul>
<li><p>Internal network</p>
</li>
<li><p>External networks (internet)</p>
</li>
</ul>
<p><strong>Analogy:</strong><br />A firewall is like a <strong>security gate</strong> that checks IDs before entry.</p>
<p>For backend systems:</p>
<ul>
<li><p>Firewalls protect databases</p>
</li>
<li><p>Restrict admin access</p>
</li>
<li><p>Prevent unauthorized traffic</p>
</li>
</ul>
<p>A <strong>Load Balancer</strong> distributes incoming traffic across <strong>multiple servers</strong>.</p>
<p>Why it’s needed:</p>
<ul>
<li><p>Prevents server overload</p>
</li>
<li><p>Improves availability</p>
</li>
<li><p>Enables horizontal scaling</p>
</li>
</ul>
<p><strong>Analogy:</strong><br />A load balancer is like a <strong>toll booth with multiple lanes</strong>, spreading vehicles evenly.</p>
<p>In production systems:</p>
<ul>
<li><p>Users never talk to backend servers directly</p>
</li>
<li><p>They talk to the load balancer</p>
</li>
</ul>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769086602181/47bedcce-cdcf-4209-8bd0-66a0a3020ade.webp" alt class="image--center mx-auto" /></p>
<h2 id="heading-how-all-these-devices-work-together-in-a-real-world-setup">How all these devices work together in a real-world setup?</h2>
<p>Let’s follow a real request:</p>
<ol>
<li><p>User sends request from laptop</p>
</li>
<li><p>Switch forwards it inside the LAN</p>
</li>
<li><p>Router decides it needs internet access</p>
</li>
<li><p>Firewall checks if traffic is allowed</p>
</li>
<li><p>Modem sends data to ISP</p>
</li>
<li><p>Request reaches a load balancer</p>
</li>
<li><p>Load balancer sends it to a backend server</p>
</li>
</ol>
<p>Each device has <strong>one clear responsibility</strong>.</p>
<h2 id="heading-why-software-engineers-should-care-about-network-devices">Why software engineers should care about network devices</h2>
<p>Even if you write only code:</p>
<ul>
<li><p>Your API runs behind a load balancer</p>
</li>
<li><p>Your database is protected by a firewall</p>
</li>
<li><p>Your service depends on routers and switches</p>
</li>
</ul>
<p>Understanding these devices helps you:</p>
<ul>
<li><p>Debug production issues</p>
</li>
<li><p>Design scalable systems</p>
</li>
<li><p>Communicate better with DevOps teams</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[TCP vs UDP: When to Use What, and How TCP Relates to HTTP]]></title><description><![CDATA[Why Does the Internet Need Rules to Send Data?
The internet is not a single wire.Data travels through many routers, networks, and countries before reaching its destination.
If there were no rules:

Data could be lost

Data could arrive in the wrong o...]]></description><link>https://piyushtiwari888.hashnode.dev/tcp-vs-udp-when-to-use-what-and-how-tcp-relates-to-http</link><guid isPermaLink="true">https://piyushtiwari888.hashnode.dev/tcp-vs-udp-when-to-use-what-and-how-tcp-relates-to-http</guid><category><![CDATA[TCP]]></category><category><![CDATA[tcp vs udp]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[#HiteshChaudhary ]]></category><dc:creator><![CDATA[Piyush Tiwari]]></dc:creator><pubDate>Thu, 22 Jan 2026 12:39:18 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769084931397/aca314c9-d99b-4a1f-9235-a8257cc4fb74.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-why-does-the-internet-need-rules-to-send-data">Why Does the Internet Need Rules to Send Data?</h2>
<p>The internet is not a single wire.<br />Data travels through many routers, networks, and countries before reaching its destination.</p>
<p>If there were <strong>no rules</strong>:</p>
<ul>
<li><p>Data could be lost</p>
</li>
<li><p>Data could arrive in the wrong order</p>
</li>
<li><p>Data could arrive too late to be useful</p>
</li>
</ul>
<p>To avoid this chaos, the internet uses <strong>protocols</strong> — rules that define <em>how</em> data should be sent and received.</p>
<p>Two of the most important transport-layer protocols are <strong>TCP</strong> and <strong>UDP</strong>.</p>
<h2 id="heading-what-are-tcp-and-udp">What Are TCP and UDP?</h2>
<h3 id="heading-tcp-transmission-control-protocol">TCP (Transmission Control Protocol)</h3>
<p>TCP is:</p>
<ul>
<li><p>Reliable</p>
</li>
<li><p>Ordered</p>
</li>
<li><p>Connection-based</p>
</li>
</ul>
<p>Think of TCP as a <strong>phone call</strong>:</p>
<ul>
<li><p>You know the other person is connected</p>
</li>
<li><p>You know if they heard you</p>
</li>
<li><p>If something is missed, you repeat it</p>
</li>
</ul>
<h3 id="heading-udp-user-datagram-protocol">UDP (User Datagram Protocol)</h3>
<p>UDP is:</p>
<ul>
<li><p>Fast</p>
</li>
<li><p>Connectionless</p>
</li>
<li><p>Unreliable (by design)</p>
</li>
</ul>
<p>Think of UDP as a <strong>public announcement</strong>:</p>
<ul>
<li><p>Message is sent</p>
</li>
<li><p>No confirmation</p>
</li>
<li><p>If someone misses it, it’s gone</p>
</li>
</ul>
<h2 id="heading-key-differences-between-tcp-and-udp">Key Differences Between TCP and UDP</h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Feature</td><td>TCP</td><td>UDP</td></tr>
</thead>
<tbody>
<tr>
<td>Connection</td><td>Yes</td><td>No</td></tr>
<tr>
<td>Reliability</td><td>Guaranteed</td><td>Not guaranteed</td></tr>
<tr>
<td>Order of data</td><td>Preserved</td><td>Not preserved</td></tr>
<tr>
<td>Speed</td><td>Slower</td><td>Faster</td></tr>
<tr>
<td>Error recovery</td><td>Yes</td><td>No</td></tr>
<tr>
<td>Use case</td><td>Accuracy matters</td><td>Speed matters</td></tr>
</tbody>
</table>
</div><p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769085188319/11a4f670-6508-43c8-989f-80d40efbfc1e.webp" alt class="image--center mx-auto" /></p>
<h2 id="heading-when-should-you-use-tcp">When Should You Use TCP?</h2>
<p>Use <strong>TCP</strong> when:</p>
<ul>
<li><p>Data <strong>must not be lost</strong></p>
</li>
<li><p>Order <strong>matters</strong></p>
</li>
<li><p>Accuracy is more important than speed</p>
</li>
</ul>
<h3 id="heading-examples">Examples:</h3>
<ul>
<li><p>Web browsing (HTTP/HTTPS)</p>
</li>
<li><p>Emails</p>
</li>
<li><p>File downloads</p>
</li>
<li><p>Database connections</p>
</li>
<li><p>APIs</p>
</li>
</ul>
<p>If one byte is missing, the data becomes useless — TCP handles this perfectly.</p>
<h2 id="heading-when-should-you-use-udp">When Should You Use UDP?</h2>
<p>Use <strong>UDP</strong> when:</p>
<ul>
<li><p>Speed is critical</p>
</li>
<li><p>Small data loss is acceptable</p>
</li>
<li><p>Real-time response matters more than accuracy</p>
</li>
</ul>
<h3 id="heading-examples-1">Examples:</h3>
<ul>
<li><p>Live video streaming</p>
</li>
<li><p>Online gaming</p>
</li>
<li><p>Voice calls (VoIP)</p>
</li>
<li><p>DNS queries</p>
</li>
</ul>
<h2 id="heading-real-world-analogy-tcp-vs-udp">Real-World Analogy: TCP vs UDP</h2>
<ul>
<li><p><strong>TCP = Courier Service</strong></p>
<ul>
<li><p>Delivery guaranteed</p>
</li>
<li><p>Signature required</p>
</li>
<li><p>Slower but safe</p>
</li>
</ul>
</li>
<li><p><strong>UDP = Live TV Broadcast</strong></p>
<ul>
<li><p>No retries</p>
</li>
<li><p>If you miss a frame, it’s gone</p>
</li>
<li><p>Fast and continuous</p>
</li>
</ul>
</li>
</ul>
<h2 id="heading-common-real-world-examples">Common Real-World Examples</h2>
<div class="hn-table">
<table>
<thead>
<tr>
<td>Application</td><td>TCP or UDP</td><td>Reason</td></tr>
</thead>
<tbody>
<tr>
<td>Web browsing</td><td>TCP</td><td>Data must be accurate</td></tr>
<tr>
<td>Video call</td><td>UDP</td><td>Low latency required</td></tr>
<tr>
<td>Online games</td><td>UDP</td><td>Speed matters</td></tr>
<tr>
<td>File transfer</td><td>TCP</td><td>Data integrity</td></tr>
<tr>
<td>DNS lookup</td><td>UDP</td><td>Fast, small messages</td></tr>
</tbody>
</table>
</div><h2 id="heading-what-is-http-and-where-does-it-fit">What Is HTTP and Where Does It Fit?</h2>
<p><strong>HTTP (HyperText Transfer Protocol)</strong> is an <strong>application-layer protocol</strong>.</p>
<p>HTTP defines:</p>
<ul>
<li><p>How requests are made</p>
</li>
<li><p>How responses are structured</p>
</li>
<li><p>Status codes</p>
</li>
<li><p>Headers and methods (GET, POST, etc.)</p>
</li>
</ul>
<p>HTTP does <strong>not</strong> send data by itself.</p>
<p>It relies on transport protocols like <strong>TCP</strong>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769085341457/540e178d-d27a-4323-98df-718e4ffa1c3a.webp" alt class="image--center mx-auto" /></p>
<h2 id="heading-relationship-between-tcp-and-http">Relationship Between TCP and HTTP</h2>
<ul>
<li><p>TCP handles <strong>reliable delivery</strong></p>
</li>
<li><p>HTTP handles <strong>request-response logic</strong></p>
</li>
</ul>
<p>In simple words:</p>
<p>HTTP tells <em>what</em> to say</p>
<p>TCP tells <em>how</em> to deliver it safely</p>
<h2 id="heading-why-http-does-not-replace-tcp">Why HTTP Does Not Replace TCP</h2>
<p>HTTP:</p>
<ul>
<li><p>Has no retransmission logic</p>
</li>
<li><p>Does not handle packet loss</p>
</li>
<li><p>Does not manage connections at the network level</p>
</li>
</ul>
<p>TCP:</p>
<ul>
<li><p>Ensures delivery</p>
</li>
<li><p>Handles errors</p>
</li>
<li><p>Maintains connection state</p>
</li>
</ul>
<p>That’s why HTTP <strong>runs on top of TCP</strong>, not instead of it.</p>
<h2 id="heading-common-beginner-confusion-is-http-the-same-as-tcp">Common Beginner Confusion: Is HTTP the Same as TCP?</h2>
<p><strong>No</strong></p>
<ul>
<li><p>TCP = Transport layer</p>
</li>
<li><p>HTTP = Application layer</p>
</li>
</ul>
<p>They solve <strong>different problems</strong>.</p>
<p>Without TCP:</p>
<ul>
<li>HTTP would be unreliable</li>
</ul>
<p>Without HTTP:</p>
<ul>
<li>TCP wouldn’t know what data means</li>
</ul>
<p>They work <strong>together</strong>, not as replacements.</p>
]]></content:encoded></item><item><title><![CDATA[TCP Working: Understanding the 3-Way Handshake and Reliable Communication]]></title><description><![CDATA[What if data was sent without any rules?
Imagine you are sending an important message to your friend, but:

Messages arrive in random order

Some messages never arrive

Some messages arrive twice

You never know if your friend received them or not


...]]></description><link>https://piyushtiwari888.hashnode.dev/tcp-working-understanding-the-3-way-handshake-and-reliable-communication</link><guid isPermaLink="true">https://piyushtiwari888.hashnode.dev/tcp-working-understanding-the-3-way-handshake-and-reliable-communication</guid><category><![CDATA[TCP]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[ChaiCohort]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[networking]]></category><dc:creator><![CDATA[Piyush Tiwari]]></dc:creator><pubDate>Thu, 22 Jan 2026 12:18:06 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1769083047688/5bb08932-c4c3-4a9c-8506-cb645b6d867d.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-what-if-data-was-sent-without-any-rules">What if data was sent without any rules?</h2>
<p>Imagine you are sending an important message to your friend, but:</p>
<ul>
<li><p>Messages arrive in random order</p>
</li>
<li><p>Some messages never arrive</p>
</li>
<li><p>Some messages arrive twice</p>
</li>
<li><p>You never know if your friend received them or not</p>
</li>
</ul>
<p>This is exactly what would happen on the internet <strong>without TCP</strong>.</p>
<p>The internet is unreliable by nature. Data travels through multiple networks, routers, and paths. Things can get lost, duplicated, or delayed.</p>
<p>That’s why we need <strong>TCP</strong>.</p>
<h2 id="heading-what-is-tcp-and-why-is-it-needed">What is TCP and Why Is It Needed?</h2>
<p><strong>TCP (Transmission Control Protocol)</strong> is a communication protocol that ensures:</p>
<ul>
<li><p>Data reaches the correct destination</p>
</li>
<li><p>Data arrives <strong>completely</strong></p>
</li>
<li><p>Data arrives <strong>in order</strong></p>
</li>
<li><p>Data is <strong>error-free</strong></p>
</li>
</ul>
<p>TCP is used by:</p>
<ul>
<li><p>Web browsing (HTTP/HTTPS)</p>
</li>
<li><p>Emails</p>
</li>
<li><p>File transfers</p>
</li>
<li><p>APIs and backend communication</p>
</li>
</ul>
<p>In short=</p>
<p>TCP makes the internet reliable.</p>
<h2 id="heading-problems-tcp-is-designed-to-solve">Problems TCP Is Designed to Solve</h2>
<p>TCP was created to handle these core problems:</p>
<ol>
<li><p><strong>Packet Loss</strong> – Data packets may get lost in transit</p>
</li>
<li><p><strong>Out-of-Order Delivery</strong> – Packets may arrive in the wrong sequence</p>
</li>
<li><p><strong>Duplicate Packets</strong> – Same packet may arrive multiple times</p>
</li>
<li><p><strong>Network Congestion</strong> – Too much data sent too fast</p>
</li>
<li><p><strong>No Confirmation</strong> – Sender doesn’t know if data was received</p>
</li>
</ol>
<h2 id="heading-introducing-the-tcp-3-way-handshake">Introducing the TCP 3-Way Handshake</h2>
<p>Before any data is sent, TCP first <strong>establishes a connection</strong>.</p>
<p>This is done using the <strong>3-Way Handshake</strong>.</p>
<p>Think of it like starting a phone call:</p>
<ol>
<li><p>“Can you hear me?”</p>
</li>
<li><p>“Yes, I can hear you. Can you hear me?”</p>
</li>
<li><p>“Yes, let’s talk.”</p>
</li>
</ol>
<p>Only after this confirmation does actual communication begin.</p>
<h2 id="heading-what-is-the-tcp-3-way-handshake">What Is the TCP 3-Way Handshake?</h2>
<p>The TCP 3-Way Handshake consists of <strong>three steps</strong>:</p>
<ol>
<li><p><strong>SYN</strong></p>
</li>
<li><p><strong>SYN-ACK</strong></p>
</li>
<li><p><strong>ACK</strong></p>
</li>
</ol>
<p>This process ensures both sides are:</p>
<ul>
<li><p>Ready to communicate</p>
</li>
<li><p>Agreeing on initial parameters</p>
</li>
<li><p>Aware that the connection is established</p>
</li>
</ul>
<h2 id="heading-step-by-step-working-of-syn-syn-ack-and-ack">Step-by-Step Working of SYN, SYN-ACK, and ACK</h2>
<h3 id="heading-step-1-syn-client-server">Step 1: SYN (Client → Server)</h3>
<p>The client sends a <strong>SYN (Synchronize)</strong> packet:</p>
<p>“I want to start a connection.”</p>
<p>This packet contains:</p>
<ul>
<li>Initial sequence number</li>
</ul>
<h3 id="heading-step-2-syn-ack-server-client">Step 2: SYN-ACK (Server → Client)</h3>
<p>The server responds with <strong>SYN-ACK</strong>:</p>
<p>“I received your request, and I’m ready too.”</p>
<p>This packet:</p>
<ul>
<li><p>Acknowledges the client’s SYN</p>
</li>
<li><p>Sends the server’s own sequence number</p>
</li>
</ul>
<h3 id="heading-step-3-ack-client-server">Step 3: ACK (Client → Server)</h3>
<p>The client sends an <strong>ACK</strong>:</p>
<p>“I acknowledge your response. Let’s start communication.”</p>
<p>Now the connection is <strong>fully established</strong>.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769083783491/993fcda2-eba0-4822-87f2-9fe58ca769c2.jpeg" alt class="image--center mx-auto" /></p>
<h2 id="heading-how-data-transfer-works-in-tcp">How Data Transfer Works in TCP</h2>
<p>Once the connection is established:</p>
<ul>
<li><p>Data is split into <strong>segments</strong></p>
</li>
<li><p>Each segment gets a <strong>sequence number</strong></p>
</li>
<li><p>Receiver sends <strong>ACKs</strong> for received data</p>
</li>
</ul>
<p>Sender keeps sending data while tracking:</p>
<ul>
<li><p>What is sent</p>
</li>
<li><p>What is acknowledged</p>
</li>
<li><p>What needs retransmission</p>
</li>
</ul>
<h2 id="heading-sequence-numbers-and-acknowledgements-high-level">Sequence Numbers and Acknowledgements (High-Level)</h2>
<h3 id="heading-sequence-numbers">Sequence Numbers</h3>
<ul>
<li><p>Every byte of data is numbered</p>
</li>
<li><p>Helps in ordering and loss detection</p>
</li>
</ul>
<h3 id="heading-acknowledgements-ack">Acknowledgements (ACK)</h3>
<ul>
<li><p>Receiver confirms received data</p>
</li>
<li><p>ACK number = “Next byte I expect”</p>
</li>
</ul>
<p>This system ensures:</p>
<ul>
<li><p>Correct order</p>
</li>
<li><p>No missing data</p>
</li>
<li><p>No duplicates</p>
</li>
</ul>
<h2 id="heading-how-tcp-ensures-reliability-order-and-correctness">How TCP Ensures Reliability, Order, and Correctness</h2>
<p>TCP guarantees reliability using:</p>
<ol>
<li><h3 id="heading-reliability">Reliability</h3>
</li>
</ol>
<ul>
<li><p>Lost packets are detected</p>
</li>
<li><p>Retransmission happens automatically</p>
</li>
</ul>
<ol start="2">
<li><h3 id="heading-ordered-delivery">Ordered Delivery</h3>
</li>
</ol>
<ul>
<li>Sequence numbers reorder packets correctly</li>
</ul>
<ol start="3">
<li><h3 id="heading-error-detection">Error Detection</h3>
</li>
</ol>
<ul>
<li>Checksums detect corrupted data</li>
</ul>
<ol start="4">
<li><h3 id="heading-flow-control">Flow Control</h3>
</li>
</ol>
<ul>
<li>Prevents overwhelming the receiver</li>
</ul>
<h2 id="heading-how-tcp-handles-packet-loss">How TCP Handles Packet Loss</h2>
<p>If a packet is lost:</p>
<ol>
<li><p>Receiver does not send ACK</p>
</li>
<li><p>Sender waits for a timeout</p>
</li>
<li><p>Packet is retransmitted</p>
</li>
</ol>
<p>This happens <strong>automatically</strong>, without the application knowing.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1769084038786/3ade904a-06dd-423f-ae31-05c75c12d7bd.jpeg" alt class="image--center mx-auto" /></p>
<h2 id="heading-how-a-tcp-connection-is-closed">How a TCP Connection Is Closed</h2>
<p>TCP connection termination is also <strong>graceful and reliable</strong>.</p>
<p>It uses:</p>
<ul>
<li><p><strong>FIN</strong></p>
</li>
<li><p><strong>ACK</strong></p>
</li>
</ul>
<h3 id="heading-tcp-connection-termination-steps">TCP Connection Termination Steps</h3>
<ol>
<li><p>One side sends <strong>FIN</strong> (no more data)</p>
</li>
<li><p>Other side sends <strong>ACK</strong></p>
</li>
<li><p>Other side sends its own <strong>FIN</strong></p>
</li>
<li><p>Final <strong>ACK</strong> is sent</p>
</li>
</ol>
<p>This ensures:</p>
<ul>
<li><p>All data is delivered</p>
</li>
<li><p>No sudden termination</p>
</li>
</ul>
<h2 id="heading-tcp-connection-lifecycle-big-picture">TCP Connection Lifecycle (Big Picture)</h2>
<p>Connection Establishment → Data Transfer → Connection Termination</p>
<p>This lifecycle makes TCP:</p>
<ul>
<li><p>Predictable</p>
</li>
<li><p>Safe</p>
</li>
<li><p>Reliable</p>
</li>
</ul>
<h2 id="heading-why-tcp-matters-in-system-design">Why TCP Matters in System Design</h2>
<p>TCP is everywhere:</p>
<ul>
<li><p>Web applications</p>
</li>
<li><p>APIs</p>
</li>
<li><p>Microservices</p>
</li>
<li><p>Databases</p>
</li>
</ul>
<p>Understanding TCP helps you:</p>
<ul>
<li><p>Debug network issues</p>
</li>
<li><p>Design scalable systems</p>
</li>
<li><p>Understand latency and failures</p>
</li>
</ul>
<p>TCP is not just a protocol — it’s a <strong>foundation of the internet</strong>.</p>
<h2 id="heading-final-thoughts">Final Thoughts</h2>
<p>TCP turns an unreliable network into a <strong>reliable communication channel</strong>.</p>
<p>By understanding:</p>
<ul>
<li><p>The 3-way handshake</p>
</li>
<li><p>Sequence numbers</p>
</li>
<li><p>ACKs and retransmissions</p>
</li>
<li><p>Connection closing</p>
</li>
</ul>
<p>You gain clarity on <strong>how the internet actually works</strong>.</p>
<p>This knowledge is essential for:</p>
<ul>
<li><p>Backend developers</p>
</li>
<li><p>DevOps engineers</p>
</li>
<li><p>System design interviews</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[How DNS Really Works: Understanding Name Resolution Using dig]]></title><description><![CDATA[How does a browser know where a website lives?
When you type google.com into your browser and press Enter, your computer magically knows where to go.But behind this “magic” is a very structured system called DNS.
Most developers use DNS every day, bu...]]></description><link>https://piyushtiwari888.hashnode.dev/how-dns-really-works-understanding-name-resolution-using-dig</link><guid isPermaLink="true">https://piyushtiwari888.hashnode.dev/how-dns-really-works-understanding-name-resolution-using-dig</guid><category><![CDATA[Web Development]]></category><category><![CDATA[computer networking]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[ChaiCohort]]></category><category><![CDATA[dns]]></category><category><![CDATA[#HiteshChaudhary ]]></category><category><![CDATA[dns server]]></category><dc:creator><![CDATA[Piyush Tiwari]]></dc:creator><pubDate>Tue, 20 Jan 2026 18:06:17 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1768931164892/930ba2a9-f4ea-4ae0-a692-ba61faecf17e.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-how-does-a-browser-know-where-a-website-lives">How does a browser know where a website lives?</h2>
<p>When you type <a target="_blank" href="http://google.com"><strong>google.com</strong></a> into your browser and press Enter, your computer magically knows where to go.<br />But behind this “magic” is a very structured system called <strong>DNS</strong>.</p>
<p>Most developers <em>use</em> DNS every day, but very few truly <em>understand</em> how it works under the hood.</p>
<p>In this article, we’ll break DNS down <strong>step by step</strong>, using the dig command to <strong>see the DNS resolution process in action</strong> — exactly how the internet resolves names to IP addresses.</p>
<p>Think of this as DNS explained <strong>like a system designer</strong>, not a textbook.</p>
<h2 id="heading-dns-the-internets-phonebook-why-name-resolution-exists">DNS: The Internet’s Phonebook (Why Name Resolution Exists)</h2>
<p>Computers don’t understand domain names like:</p>
<pre><code class="lang-plaintext">google.com
</code></pre>
<p>They understand <strong>IP addresses</strong>, like:</p>
<pre><code class="lang-plaintext">142.250.190.14
</code></pre>
<p>So DNS (Domain Name System) exists to answer one simple question:</p>
<p>“Which IP address belongs to this domain name?”</p>
<p>Just like a phonebook:</p>
<ul>
<li><p><strong>Name</strong> → Person</p>
</li>
<li><p><strong>Domain name</strong> → Server IP</p>
</li>
</ul>
<p>Without DNS, we would have to remember IP addresses for every website.<br />DNS makes the internet <strong>human-friendly</strong>.</p>
<h2 id="heading-introducing-dig-a-dns-diagnostic-tool">Introducing dig : A DNS Diagnostic Tool</h2>
<p>To understand DNS deeply, we need visibility.</p>
<p>That’s where dig (Domain Information Groper) comes in.</p>
<p>dig is a command-line tool that lets you:</p>
<ul>
<li><p>Query DNS servers directly</p>
</li>
<li><p>Inspect DNS records</p>
</li>
<li><p>See <strong>how resolution happens step by step</strong></p>
</li>
</ul>
<p>It’s used by:</p>
<ul>
<li><p>System engineers</p>
</li>
<li><p>DevOps engineers</p>
</li>
<li><p>Network admins</p>
</li>
<li><p>Backend developers debugging DNS issues</p>
</li>
</ul>
<h2 id="heading-dns-resolution-happens-in-layers">DNS Resolution Happens in Layers</h2>
<p>DNS is not one big server.<br />It’s a <strong>hierarchical, distributed system</strong>.</p>
<p>The lookup flow looks like this:</p>
<pre><code class="lang-plaintext">Root Servers
   ↓
TLD Servers (.com, .org, .net)
   ↓
Authoritative Name Servers
   ↓
Final IP Address
</code></pre>
<h2 id="heading-step-1-root-name-servers">Step 1: Root Name Servers</h2>
<h3 id="heading-dig-ns">dig . NS</h3>
<pre><code class="lang-basic">dig . NS
</code></pre>
<h3 id="heading-what-does-this-mean">What does this mean?</h3>
<ul>
<li><p><code>.</code> represents the <strong>root of the DNS hierarchy</strong></p>
</li>
<li><p><code>NS</code> asks: “Who are the name servers for this level?”</p>
</li>
</ul>
<h3 id="heading-what-youll-see">What you’ll see</h3>
<p>A list of servers like:</p>
<pre><code class="lang-basic">a.root-servers.net
b.root-servers.net
</code></pre>
<h3 id="heading-what-root-servers-actually-do">What root servers actually do</h3>
<p>Root servers <strong>do NOT know IP addresses</strong> of websites.</p>
<p>They only know:</p>
<p>“Who is responsible for each TLD (.com, .org, .in, etc.)”</p>
<h2 id="heading-step-2-tld-name-servers">Step 2: TLD Name Servers</h2>
<h3 id="heading-dig-com-ns">dig com NS</h3>
<pre><code class="lang-plaintext">dig com NS
</code></pre>
<h3 id="heading-whats-happening-here">What’s happening here?</h3>
<p>You’re now asking:</p>
<p>“Who manages the .com domain?”</p>
<h3 id="heading-output-meaning">Output meaning</h3>
<p>You’ll see servers like:</p>
<pre><code class="lang-basic">a.gtld-servers.net
b.gtld-servers.net
</code></pre>
<p>These are <strong>TLD (Top-Level Domain) servers</strong>.</p>
<h3 id="heading-role-of-tld-servers">Role of TLD servers</h3>
<p>TLD servers:</p>
<ul>
<li><p>Don’t know <a target="_blank" href="http://google.com">google.com</a>’s IP</p>
</li>
<li><p>Know <strong>which authoritative servers manage</strong> <a target="_blank" href="http://google.com"><strong>google.com</strong></a></p>
</li>
</ul>
<p>Think of them as:</p>
<p>A directory that knows which office handles which company</p>
<h2 id="heading-step-3-authoritative-name-servers">Step 3: Authoritative Name Servers</h2>
<h3 id="heading-dig-googlecom-ns">dig google.com NS</h3>
<pre><code class="lang-plaintext">dig google.com NS
</code></pre>
<h3 id="heading-what-does-this-tell-us">What does this tell us?</h3>
<p>Now we ask:</p>
<p>“Who is authoritative for <a target="_blank" href="http://google.com">google.com</a>?”</p>
<h3 id="heading-output">Output</h3>
<pre><code class="lang-basic">ns1.google.<span class="hljs-keyword">com</span>
ns2.google.<span class="hljs-keyword">com</span>
</code></pre>
<p>These are <strong>authoritative name servers</strong>.</p>
<h3 id="heading-why-authoritative-matters">Why “authoritative” matters</h3>
<p>Authoritative servers:</p>
<ul>
<li><p>Store the <strong>actual DNS records</strong></p>
</li>
<li><p>Are the <strong>final source of truth</strong></p>
</li>
<li><p>Answer with confidence</p>
</li>
</ul>
<h2 id="heading-step-4-full-dns-resolution">Step 4: Full DNS Resolution</h2>
<h3 id="heading-dig-googlecom">dig google.com</h3>
<pre><code class="lang-plaintext">dig google.com
</code></pre>
<h3 id="heading-what-happens-internally-behind-the-scenes">What happens internally (behind the scenes)</h3>
<p>Even though you ran <strong>one command</strong>, your system (via a recursive resolver) did this:</p>
<ol>
<li><p>Ask <strong>Root Server</strong> → “Where is .com?”</p>
</li>
<li><p>Ask <strong>TLD Server</strong> → “Who handles <a target="_blank" href="http://google.com">google.com</a>?”</p>
</li>
<li><p>Ask <strong>Authoritative Server</strong> → “What is the IP of <a target="_blank" href="http://google.com">google.com</a>?”</p>
</li>
<li><p>Return the IP address</p>
</li>
</ol>
<h3 id="heading-final-result">Final result</h3>
<pre><code class="lang-plaintext">google.com.   300   IN   A   142.250.190.14
</code></pre>
<p>This IP is what your browser uses to open a TCP connection.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1768932256214/a66ae5af-1d4c-4f85-a680-a1dd11a840e1.jpeg" alt class="image--center mx-auto" /></p>
<h2 id="heading-what-are-ns-records-and-why-do-they-matter">What Are NS Records and Why Do They Matter?</h2>
<p><strong>NS (Name Server) records</strong> answer one key question:</p>
<p>“Who is responsible for this domain?”</p>
<p>They:</p>
<ul>
<li><p>Define <strong>delegation of authority</strong></p>
</li>
<li><p>Enable DNS to scale globally</p>
</li>
<li><p>Allow different organizations to manage their own domains</p>
</li>
</ul>
<p>Without NS records:</p>
<ul>
<li><p>DNS would be centralized</p>
</li>
<li><p>The internet wouldn’t scale</p>
</li>
</ul>
<h2 id="heading-role-of-recursive-resolvers-the-hidden-worker">Role of Recursive Resolvers (The Hidden Worker)</h2>
<p>Your browser doesn’t talk to root servers directly.</p>
<p>It asks a <strong>recursive resolver</strong> (usually provided by your ISP, Google DNS, or Cloudflare).</p>
<p>The recursive resolver:</p>
<ul>
<li><p>Performs all DNS lookups for you</p>
</li>
<li><p>Caches results</p>
</li>
<li><p>Improves speed and performance</p>
</li>
</ul>
<h2 id="heading-how-this-connects-to-real-browser-requests">How This Connects to Real Browser Requests</h2>
<p>When DNS finishes:</p>
<ol>
<li><p>Browser gets the IP</p>
</li>
<li><p>TCP connection starts</p>
</li>
<li><p>TLS handshake happens</p>
</li>
<li><p>HTTP/HTTPS request is sent</p>
</li>
<li><p>Website loads</p>
</li>
</ol>
<p>DNS is <strong>step zero</strong> of every web request.</p>
<p>If DNS fails — nothing works.</p>
<h2 id="heading-system-design-perspective-why-dns-is-built-this-way">System Design Perspective: Why DNS Is Built This Way</h2>
<p>DNS is:</p>
<ul>
<li><p><strong>Distributed</strong> → no single point of failure</p>
</li>
<li><p><strong>Hierarchical</strong> → easy delegation</p>
</li>
<li><p><strong>Cached</strong> → fast and scalable</p>
</li>
<li><p><strong>Decentralized</strong> → internet ownership stays open</p>
</li>
</ul>
<p>This design allows:</p>
<ul>
<li><p>Billions of queries per day</p>
</li>
<li><p>Millions of domains</p>
</li>
<li><p>Global reliability</p>
</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[DNS for Beginners: How the Internet Finds Your Website]]></title><description><![CDATA[How Does a Browser Know Where a Website Lives?
Have you ever typed a website name like google.com in your browser and wondered:
“Browser ko kaise pata chalta hai ki ye website kahaan hai?”
You never type any IP address. You just type a name — and sti...]]></description><link>https://piyushtiwari888.hashnode.dev/dns-for-beginners-how-the-internet-finds-your-website</link><guid isPermaLink="true">https://piyushtiwari888.hashnode.dev/dns-for-beginners-how-the-internet-finds-your-website</guid><category><![CDATA[dns]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[networking]]></category><category><![CDATA[Computer Science]]></category><category><![CDATA[#chaiandcode]]></category><dc:creator><![CDATA[Piyush Tiwari]]></dc:creator><pubDate>Mon, 19 Jan 2026 18:32:05 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1768846328822/efcb4eca-5022-4e07-8bef-5e99b4d900f9.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-how-does-a-browser-know-where-a-website-lives">How Does a Browser Know Where a Website Lives?</h1>
<p>Have you ever typed a website name like google.com in your browser and wondered:</p>
<p><strong>“Browser ko kaise pata chalta hai ki ye website kahaan hai?”</strong></p>
<p>You never type any IP address. You just type a name — and still, the website opens in seconds.</p>
<p>The answer to this question is <strong>DNS</strong>.</p>
<h2 id="heading-what-is-dns">What is DNS?</h2>
<p>DNS stands for <strong>Domain Name System</strong>.</p>
<p>The easiest way to understand DNS is this:</p>
<p><strong>DNS is the phonebook of the internet.</strong></p>
<ul>
<li><p>Humans remember <strong>names</strong> (<a target="_blank" href="http://google.com">google.com</a>)</p>
</li>
<li><p>Computers understand <strong>numbers</strong> (IP addresses like 142.250.183.14)</p>
</li>
</ul>
<p>DNS acts as a translator between the two.</p>
<p>Just like you search a person’s name in your phonebook to get their number, the browser searches DNS to get the server’s IP address.</p>
<h2 id="heading-why-dns-records-are-needed">Why DNS Records Are Needed</h2>
<p>DNS is not just one single thing.<br />It works using <strong>records</strong>.</p>
<p>Each DNS record solves a <strong>specific problem</strong>, such as:</p>
<ul>
<li><p>Who controls this domain?</p>
</li>
<li><p>Where is the website hosted?</p>
</li>
<li><p>Where should emails be delivered?</p>
</li>
<li><p>Is this domain verified or trusted?</p>
</li>
</ul>
<p>Without DNS records, the internet would be confusing and unreliable.</p>
<h2 id="heading-what-is-an-ns-record">What is an NS Record?</h2>
<p><strong>NS = Name Server</strong></p>
<p>NS records answer this question:</p>
<p><strong>“Which server is responsible for this domain?”</strong></p>
<p>Think of NS records like this:</p>
<ul>
<li><p>You go to a post office</p>
</li>
<li><p>You ask, “Where can I find house number 24?”</p>
</li>
<li><p>The post office says, “Ask that local office, they handle this area”</p>
</li>
</ul>
<p>NS records tell the internet <strong>which DNS server has the correct information</strong> for a domain.</p>
<p>Without NS records, no one would know where to ask.</p>
<h2 id="heading-what-is-an-a-record-domain-ipv4-address">What is an A Record? (Domain → IPv4 Address)</h2>
<p><strong>A Record = Address Record</strong></p>
<p>This is the most important record for websites.</p>
<p>It answers:</p>
<p><strong>“Is domain ka actual server address kya hai?”</strong></p>
<p>Example:</p>
<pre><code class="lang-basic">example.<span class="hljs-keyword">com</span> → <span class="hljs-number">93.184.216.34</span>
</code></pre>
<p>Real-life example:</p>
<ul>
<li><p>Website name = House name</p>
</li>
<li><p>IP address = House number</p>
</li>
</ul>
<p>Browser uses the A record to find the <strong>exact server</strong> where the website lives.</p>
<h2 id="heading-what-is-an-aaaa-record-domain-ipv6-address">What is an AAAA Record? (Domain → IPv6 Address)</h2>
<p>AAAA record is similar to A record.</p>
<p>The difference is:</p>
<ul>
<li><p><strong>A Record → IPv4</strong></p>
</li>
<li><p><strong>AAAA Record → IPv6</strong></p>
</li>
</ul>
<p>IPv6 exists because IPv4 addresses are limited.</p>
<p>You can think of it as:</p>
<ul>
<li>Old phone numbers vs new longer phone numbers</li>
</ul>
<h2 id="heading-what-is-a-cname-record-one-name-pointing-to-another">What is a CNAME Record? (One Name Pointing to Another)</h2>
<p><strong>CNAME = Canonical Name</strong></p>
<p>CNAME answers this:</p>
<p><strong>“Is domain ka koi aur naam bhi hai?”</strong></p>
<p>Example:</p>
<pre><code class="lang-basic">www.example.<span class="hljs-keyword">com</span> → example.<span class="hljs-keyword">com</span>
</code></pre>
<p>Here:</p>
<ul>
<li><p>www.example.com does not have its own IP</p>
</li>
<li><p>It points to example.com</p>
</li>
<li><p>Then example.com uses A or AAAA record</p>
</li>
</ul>
<h3 id="heading-common-beginner-confusion-a-vs-cname">Common Beginner Confusion: A vs CNAME</h3>
<ul>
<li><p><strong>A Record</strong> → Directly points to an IP</p>
</li>
<li><p><strong>CNAME</strong> → Points to another domain name</p>
</li>
</ul>
<p>You never use both together for the same name.</p>
<h2 id="heading-what-is-an-mx-record-how-emails-find-your-mail-server">What is an MX Record? (How Emails Find Your Mail Server)</h2>
<p><strong>MX = Mail Exchange</strong></p>
<p>MX records answer:</p>
<p><strong>“Is domain ki email kahaan jayegi?”</strong></p>
<p>Example:</p>
<pre><code class="lang-basic">example.<span class="hljs-keyword">com</span> → mail.google.<span class="hljs-keyword">com</span>
</code></pre>
<p>When someone sends an email to:</p>
<pre><code class="lang-basic">support@example.<span class="hljs-keyword">com</span>
</code></pre>
<p>MX records tell the email system:</p>
<ul>
<li><p>Which mail server should receive it</p>
</li>
<li><p>Which server has priority</p>
</li>
<li><p><strong>NS</strong> → Who controls the domain</p>
</li>
<li><p><strong>MX</strong> → Where emails should go</p>
</li>
</ul>
<p>They do completely different jobs.</p>
<h2 id="heading-what-is-a-txt-record-extra-information-amp-verification">What is a TXT Record? (Extra Information &amp; Verification)</h2>
<p>TXT records store <strong>plain text information</strong>.</p>
<p>They are commonly used for:</p>
<ul>
<li><p>Domain verification</p>
</li>
<li><p>Email security (SPF, DKIM)</p>
</li>
<li><p>Ownership proof</p>
</li>
</ul>
<p>Think of TXT records as:</p>
<ul>
<li><p>Notes attached to your house gate</p>
</li>
<li><p>“This house belongs to me”</p>
</li>
<li><p>“Authorized person only”</p>
</li>
</ul>
<p>Browsers usually don’t use TXT records, but services do.</p>
<h2 id="heading-how-all-dns-records-work-together-for-one-website">How All DNS Records Work Together for One Website</h2>
<p>Let’s see what happens when you open a website:</p>
<ol>
<li><p>You type example.com</p>
</li>
<li><p>Browser asks DNS: “Who handles this domain?”</p>
</li>
<li><p>NS record points to the correct DNS server</p>
</li>
<li><p>DNS server replies with:</p>
<ul>
<li><p>A / AAAA record → Website IP</p>
</li>
<li><p>CNAME → If alias exists</p>
</li>
</ul>
</li>
<li><p>Browser connects to the server</p>
</li>
<li><p>Website loads</p>
</li>
</ol>
<p>At the same time:</p>
<ul>
<li><p>MX records handle emails</p>
</li>
<li><p>TXT records handle verification and security</p>
</li>
</ul>
<p>All records work <strong>together</strong>, not separately.</p>
]]></content:encoded></item><item><title><![CDATA[Git for Beginners: Basics and Essential Commands]]></title><description><![CDATA[Introduction
In today’s software development world, writing code is not enough. Managing changes, collaborating with other developers, and keeping track of different versions of a project are equally important. This is where Git plays a crucial role....]]></description><link>https://piyushtiwari888.hashnode.dev/git-for-beginners-basics-and-essential-commands</link><guid isPermaLink="true">https://piyushtiwari888.hashnode.dev/git-for-beginners-basics-and-essential-commands</guid><category><![CDATA[Git]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[version control]]></category><category><![CDATA[Web Development]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[Piyush Tiwari]]></dc:creator><pubDate>Mon, 12 Jan 2026 15:13:44 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1768230541885/0b2ea3f3-df34-4b51-b2bd-f4884d28fc0f.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-introduction">Introduction</h2>
<p>In today’s software development world, writing code is not enough. Managing changes, collaborating with other developers, and keeping track of different versions of a project are equally important. This is where <strong>Git</strong> plays a crucial role.</p>
<p>Git is one of the most popular tools used by developers to track code changes efficiently. Whether you are a student or a beginner in programming, learning Git is a must-have skill. This article explains Git in <strong>simple language</strong>, its importance, and the most commonly used Git commands.</p>
<h2 id="heading-what-is-git">What is Git?</h2>
<p><strong>Git</strong> is a <strong>distributed version control system</strong> that helps developers track changes in their source code over time.</p>
<p>In simple words:</p>
<blockquote>
<p>Git keeps a record of every change made in a project so that developers can easily manage and recover code whenever needed.</p>
</blockquote>
<p>Git allows you to:</p>
<ul>
<li><p>Save different versions of your code</p>
</li>
<li><p>Work on new features without affecting the main project</p>
</li>
<li><p>Collaborate with other developers safely</p>
</li>
</ul>
<h2 id="heading-why-is-git-used">Why is Git Used?</h2>
<p>Git is widely used because it makes software development <strong>organized, safe, and collaborative</strong>.</p>
<h3 id="heading-key-benefits-of-git">Key benefits of Git:</h3>
<ul>
<li><p>Tracks complete history of code changes</p>
</li>
<li><p>Allows multiple developers to work together</p>
</li>
<li><p>Prevents accidental loss of code</p>
</li>
<li><p>Helps in debugging by reverting to previous versions</p>
</li>
<li><p>Works with platforms like GitHub, GitLab, and Bitbucket</p>
</li>
</ul>
<h2 id="heading-git-as-a-distributed-version-control-system">Git as a Distributed Version Control System</h2>
<p>Git is called a <strong>distributed</strong> version control system because every developer has a <strong>full copy of the project</strong> on their local machine.</p>
<p>This means:</p>
<ul>
<li><p>Developers can work <strong>offline</strong></p>
</li>
<li><p>No single point of failure</p>
</li>
<li><p>Faster performance</p>
</li>
<li><p>High data security</p>
</li>
</ul>
<p>Each copy of the repository contains the complete project history.</p>
<h2 id="heading-core-git-terminologies">Core Git Terminologies</h2>
<p>Before using Git commands, it is important to understand some basic terms:</p>
<h3 id="heading-repository">Repository</h3>
<p>A <strong>repository</strong> (repo) is a folder that contains project files and Git history.</p>
<h3 id="heading-commit">Commit</h3>
<p>A <strong>commit</strong> is a snapshot of changes made to the project.</p>
<h3 id="heading-branch">Branch</h3>
<p>A <strong>branch</strong> is a separate version of the project used to develop features independently.</p>
<h3 id="heading-merge">Merge</h3>
<p><strong>Merge</strong> combines changes from one branch into another.</p>
<h3 id="heading-clone">Clone</h3>
<p><strong>Clone</strong> creates a copy of a remote repository on your local system.</p>
<h3 id="heading-push">Push</h3>
<p><strong>Push</strong> uploads your local commits to a remote repository.</p>
<h3 id="heading-pull">Pull</h3>
<p><strong>Pull</strong> downloads the latest changes from a remote repository.</p>
<h2 id="heading-common-git-commands">Common Git Commands</h2>
<p>Below are some essential Git commands every beginner should know:</p>
<h3 id="heading-initialize-a-repository">Initialize a Repository</h3>
<pre><code class="lang-plaintext">git init
</code></pre>
<h3 id="heading-check-repository-status">Check Repository Status</h3>
<pre><code class="lang-plaintext">git status
</code></pre>
<h3 id="heading-add-files-to-staging-area">Add Files to Staging Area</h3>
<pre><code class="lang-plaintext">git add .
</code></pre>
<h3 id="heading-commit-changes">Commit Changes</h3>
<pre><code class="lang-plaintext">git commit -m "Initial commit"
</code></pre>
<h3 id="heading-create-or-view-branches">Create or View Branches</h3>
<pre><code class="lang-plaintext">git branch
</code></pre>
<h3 id="heading-switch-branch">Switch Branch</h3>
<pre><code class="lang-plaintext">git checkout branch_name
</code></pre>
<h3 id="heading-merge-branches">Merge Branches</h3>
<pre><code class="lang-plaintext">git merge branch_name
</code></pre>
<h3 id="heading-clone-a-repository">Clone a Repository</h3>
<pre><code class="lang-plaintext">git clone repository_url
</code></pre>
<h3 id="heading-push-changes-to-remote">Push Changes to Remote</h3>
<pre><code class="lang-plaintext">git push origin main
</code></pre>
<h3 id="heading-pull-latest-changes">Pull Latest Changes</h3>
<pre><code class="lang-plaintext">git pull
</code></pre>
<h2 id="heading-best-practices-and-tips">Best Practices and Tips</h2>
<ul>
<li><p>Write meaningful commit messages</p>
</li>
<li><p>Commit code frequently</p>
</li>
<li><p>Use branches for new features</p>
</li>
<li><p>Always pull latest changes before pushing</p>
</li>
<li><p>Avoid committing unnecessary files</p>
</li>
</ul>
<h2 id="heading-conclusion">Conclusion</h2>
<p>Git is an essential tool for modern software development. It helps developers manage code efficiently, collaborate with teams, and maintain project history safely. By understanding Git basics and practicing common commands, beginners can confidently work on real-world projects.</p>
<p>Learning Git may seem difficult at first, but with regular practice, it becomes simple and powerful.</p>
]]></content:encoded></item></channel></rss>