3.3 The Domain Name System (DNS)

The Invisible Phonebook of the Internet

At its core, the internet is just a massive collection of computers. Computers do not understand words or brands; they only understand numbers, specifically IP Addresses (like 142.250.190.46). However, human beings are terrible at remembering random strings of numbers.

If you had to type an IP address every time you wanted to check your email, the internet would be unusable. The Domain Name System (DNS) is the infrastructure that bridges this gap, translating human-readable names (like google.com) into machine-readable IP addresses.

1. The DNS Hierarchy (The Recursive Journey)

When you type www.amazon.com into your browser, your computer does not magically know where that is. It must ask a series of servers in a strict, hierarchical order. This is called a Recursive DNS Query.

  1. The Resolving Name Server (The ISP / Google 8.8.8.8): Your computer first asks your local router or ISP's DNS server: "Where is www.amazon.com?" If it doesn't know, it goes out to the internet to find out.

  2. The Root Servers (.): The Resolver contacts one of the 13 foundational Root Servers of the internet. The Root Server says: "I don't know where Amazon is, but I see you are looking for a .com address. Here is the IP address for the .com servers."

  3. The TLD Servers (Top-Level Domain): The Resolver then asks the .com TLD Server. The TLD server says: "I don't know the exact server for 'www', but I know who owns 'amazon.com'. Here is the IP address of Amazon's personal DNS server."

  4. The Authoritative Name Server: Finally, the Resolver asks Amazon's own DNS server. This server has the master record. It replies: "Yes, www is located at 52.119.168.48." 5. The Connection: The Resolver caches (memorizes) this answer to save time later, hands the IP address to your computer, and your browser finally loads the webpage. This entire 4-step journey happens in milliseconds.

2. Core DNS Record Types

When you buy a domain name, you don't just get a website; you get a DNS control panel. A domain can point to many different services simultaneously by using different "Records".

3. Caching and TTL (Time to Live)

Because querying the Root and TLD servers billions of times a second would crash the internet, DNS relies heavily on Caching (memorization).

Every DNS record has a TTL (Time to Live) value, measured in seconds.

4. (Addition) Split-Brain DNS (Internal vs. External)

Stuff to add: In an enterprise, you don't want the public internet to know the IP addresses of your secret internal servers. To solve this, companies use "Split-Brain DNS."

Powered by Forestry.md