<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: CodeWithKUK</title>
    <description>The latest articles on Forem by CodeWithKUK (@codewithkuk).</description>
    <link>https://forem.com/codewithkuk</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3723559%2Fc2f37861-1018-49f1-a12b-73f22db1d993.jpg</url>
      <title>Forem: CodeWithKUK</title>
      <link>https://forem.com/codewithkuk</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/codewithkuk"/>
    <language>en</language>
    <item>
      <title>So… What Really Happens When You Type a URL and Press Enter?</title>
      <dc:creator>CodeWithKUK</dc:creator>
      <pubDate>Wed, 21 Jan 2026 10:55:59 +0000</pubDate>
      <link>https://forem.com/codewithkuk/so-what-really-happens-when-you-type-a-url-and-press-enter-7p2</link>
      <guid>https://forem.com/codewithkuk/so-what-really-happens-when-you-type-a-url-and-press-enter-7p2</guid>
      <description>&lt;p&gt;Let me ask you something.&lt;/p&gt;

&lt;p&gt;You open your browser, type a URL in the search bar, hit Enter, and boom — the website appears.&lt;/p&gt;

&lt;p&gt;Simple, right?&lt;/p&gt;

&lt;p&gt;But in the background… a very big journey is happening.&lt;br&gt;
And the website will show you the desired output only if the URL is typed correctly.&lt;/p&gt;

&lt;p&gt;Let’s talk about that journey.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;First Problem:&lt;/strong&gt; Computers Don’t Understand Website Names&lt;br&gt;
Here’s the first thing to understand:&lt;/p&gt;

&lt;p&gt;Servers and computers only understand binary things.&lt;br&gt;
They don’t understand names like &lt;a href="http://www.google.com" rel="noopener noreferrer"&gt;www.google.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;As humans, it’s impossible for us to remember IP addresses like 142.250.190.14, so we remember websites by names.&lt;/p&gt;

&lt;p&gt;But to make this understandable for the server, the first step is to find the IP address that is mapped to that website.&lt;/p&gt;

&lt;p&gt;So the big question becomes:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;How do we find the IP address of a website?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Browser Cache&lt;/strong&gt; — “Have You Been Here Before?”&lt;br&gt;
When you hit Enter, the browser first checks its own cache and asks:&lt;/p&gt;

&lt;p&gt;“Hey, has this user visited this website before?”&lt;/p&gt;

&lt;p&gt;If yes → the browser already has the IP address&lt;br&gt;
It simply returns the request&lt;br&gt;
No extra work needed&lt;br&gt;
But if the website is not found in the browser cache, then the browser says:&lt;/p&gt;

&lt;p&gt;“Okay, I need help.”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: OS Cache&lt;/strong&gt; — “Do You Know This Website?”&lt;br&gt;
Now the browser asks the Operating System.&lt;/p&gt;

&lt;p&gt;The OS starts checking:&lt;/p&gt;

&lt;p&gt;The hosts file&lt;br&gt;
System temporary memory&lt;br&gt;
Recently visited websites&lt;br&gt;
If the OS still can’t find the IP address, it realizes:&lt;/p&gt;

&lt;p&gt;“This is not local. I need to go outside.”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: DNS Resolver&lt;/strong&gt; — The ISP Enters the Chat&lt;br&gt;
Now the OS calls the resolver.&lt;/p&gt;

&lt;p&gt;The resolver is basically your ISP, and it knows where to locate the root servers.&lt;/p&gt;

&lt;p&gt;The resolver:&lt;/p&gt;

&lt;p&gt;Receives the request&lt;br&gt;
Checks its own cache&lt;br&gt;
If the website is not there, it goes global&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Root Server&lt;/strong&gt; — “I Don’t Know, But I Know Who Does”&lt;br&gt;
The resolver asks one of the root name servers:&lt;/p&gt;

&lt;p&gt;“Where can I find the IP address for this website?”&lt;/p&gt;

&lt;p&gt;Important thing:&lt;/p&gt;

&lt;p&gt;The root server does not know the IP address&lt;br&gt;
But it knows where to locate the TLD server&lt;br&gt;
There are 13 root name servers in total.&lt;/p&gt;

&lt;p&gt;So the root replies:&lt;/p&gt;

&lt;p&gt;“I don’t know this website, but since it ends with .com, go ask the .com TLD server.”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5: TLD Server&lt;/strong&gt; — “Here Are the Name Servers”&lt;br&gt;
Now the resolver goes to the .com TLD server and asks:&lt;/p&gt;

&lt;p&gt;“Do you know the IP address of this website?”&lt;/p&gt;

&lt;p&gt;The TLD server says:&lt;/p&gt;

&lt;p&gt;“No, I don’t know the IP address…&lt;br&gt;
But I do know the name servers associated with this domain.”&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;ns1.domain.com&lt;br&gt;
ns2.domain.com&lt;br&gt;
The resolver stores this information.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6: Authoritative Name Server&lt;/strong&gt; — The Final Boss&lt;br&gt;
Now the resolver goes to the Authoritative Name Server.&lt;/p&gt;

&lt;p&gt;Become a member&lt;br&gt;
This server:&lt;/p&gt;

&lt;p&gt;Is connected through the domain registrar&lt;br&gt;
Knows everything about the domain&lt;br&gt;
Answers DNS queries&lt;br&gt;
Stores website IPs, emails, records&lt;br&gt;
Does not ask anyone else&lt;br&gt;
Does not look in cache&lt;br&gt;
It is the ultimate authority.&lt;/p&gt;

&lt;p&gt;So when the resolver asks:&lt;/p&gt;

&lt;p&gt;“Give me the IP address of this website”&lt;/p&gt;

&lt;p&gt;The authoritative server finally responds with the real IP address&lt;/p&gt;

&lt;p&gt;**Step 7: The Journey Back Home&lt;br&gt;
**Now the resolver takes the IP address and goes back:&lt;/p&gt;

&lt;p&gt;Gives the IP to the Operating System&lt;br&gt;
OS saves it in memory&lt;br&gt;
OS gives it to the browser&lt;br&gt;
Now the browser says:&lt;/p&gt;

&lt;p&gt;“Great. Now I know where to go.”&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 8: Browser Requests the Website&lt;/strong&gt;&lt;br&gt;
The browser connects to that IP address and requests:&lt;/p&gt;

&lt;p&gt;HTML document&lt;br&gt;
CSS (for styling)&lt;br&gt;
JavaScript files&lt;br&gt;
Images, fonts, and other media&lt;br&gt;
The browser discovers references to these files and sends requests for them.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Finally… the page renders&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Wait… Isn’t There a DNS Loop Problem?&lt;/strong&gt;&lt;br&gt;
Now you might think:&lt;/p&gt;

&lt;p&gt;The authoritative name server is ns1.domain.com&lt;br&gt;
But that is a subdomain of domain.com&lt;br&gt;
So how can we resolve the subdomain before the domain?&lt;/p&gt;

&lt;p&gt;That sounds like a loop, right?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Solution: Glue Records&lt;/strong&gt;&lt;br&gt;
This is where Glue Records come in.&lt;/p&gt;

&lt;p&gt;When the resolver asks the .com TLD server, the response includes:&lt;/p&gt;

&lt;p&gt;The name of the authoritative name server&lt;br&gt;
AND at least one IP address of that name server&lt;br&gt;
That extra IP information is called Glue.&lt;/p&gt;

&lt;p&gt;So the resolver:&lt;/p&gt;

&lt;p&gt;Does not need to resolve the name server again&lt;br&gt;
Can directly connect using the IP&lt;br&gt;
And the circular dependency is broken&lt;br&gt;
Final Thoughts&lt;br&gt;
So yes…&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When you type a URL and press Enter:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Caches are checked&lt;br&gt;
Root servers are contacted&lt;br&gt;
TLD servers guide the way&lt;br&gt;
Authoritative servers give the final answer&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb1v807j9y9kqgfgsr1m6.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb1v807j9y9kqgfgsr1m6.jpg" alt=" " width="800" height="436"&gt;&lt;/a&gt;&lt;br&gt;
Glue records prevent infinite loops&lt;br&gt;
All of this happens in milliseconds.&lt;/p&gt;

&lt;p&gt;And that’s the hidden journey behind a single Enter key press!!!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>softwareengineering</category>
      <category>programming</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
