666 words
3 minutes

DNS for IT Girls - How the Internet Works Like Magic

Visual DX: DNS for IT Girls - How the Internet Works Like Magic

Hey, tech queens! 👩‍💻💖

Today, we’re diving into DNS—the secret behind why you can just type google.com instead of some long, impossible-to-remember number. DNS makes the internet easy and user-friendly, and once you understand it, you’ll feel like a total networking goddess! 👑💡


What is DNS?#

DNS (Domain Name System) is like the translator of the internet. It turns human-friendly domain names (web.yourcompany.net) into machine-readable IP addresses.

Think of it like your phone contacts: instead of memorizing phone numbers, you just tap on a name. DNS does the same, but for websites.

Without DNS, you’d have to type 10.0.0.25 instead of facebook.com. Not cute, right? 😅


The Hosts File: The Old-School Hack#

Before DNS, people manually assigned names to IPs using the /etc/hosts file (yeah, ancient times! 😂). But guess what? You can still use this trick today to override DNS settings on your machine!

Pro Tip: Manually Map Names to IPs#

Let’s say you have a database server with IP 10.0.0.5, and you want to access it using the name database. Just add this line to your /etc/hosts file:

Terminal window
10.0.0.5 database

Now, whenever you type ping database, your system will automatically connect to 10.0.0.5, no matter what DNS says! #HackTheNetwork 😏💻


Enter the DNS Server!#

Managing hostnames manually gets messy real quick, so that’s where DNS servers come in! They centralize everything, so instead of keeping a giant hosts file, your system just asks a DNS server for the right IP.

For example, if your company’s internal DNS server is at 10.10.10.1, your laptop will query it whenever it needs to resolve a hostname. If the server doesn’t know the answer, it forwards the request up the chain until it finds the right IP.

Pro Tip: Set a Custom DNS Server#

To manually tell your system where to look for DNS resolutions, update the /etc/resolv.conf file like this:

Terminal window
nameserver 10.10.10.1

Now, all DNS requests will go to 10.10.10.1 first. 🎯


Subdomains: The DNS Name Tree#

Ever wondered why we have maps.yourcompany.net, mail.yourcompany.net, and drive.yourcompany.net? These are subdomains, and they help organize different services inside a company or website. 🌍✨

Example DNS setup for a company:

  • web.yourcompany.net → Main website
  • db.yourcompany.net → Database server
  • mail.yourcompany.net → Email services

DNS ensures that when users type these names, they are sent to the correct servers. It’s basically the road sign system of the internet! 🚦


DNS Caching: How the Internet Gets Faster#

Every time you visit a website, your system caches (stores) the DNS result so it doesn’t have to ask again. This speeds things up 🚄 but can sometimes cause problems when IPs change.

How to Clear Your DNS Cache#

If a website stops loading properly, refreshing the DNS cache might help:

🖥️ On Windows:

Terminal window
ipconfig /flushdns

💻 On Mac/Linux:

Terminal window
sudo systemd-resolve --flush-caches

Now your system will request fresh DNS info instead of using old data. 🔥


Public vs Private DNS: Who Controls the Internet?#

If your DNS server doesn’t know an answer, it forwards the request to public DNS servers like:

Google DNS8.8.8.8
Cloudflare DNS1.1.1.1
OpenDNS208.67.222.222

But for internal company networks, private DNS servers keep things secure. For example, if you work at yourcompany.net, you don’t want random strangers resolving your internal servers! 🚨


Recap: DNS is the GPS of the Internet!#

Now you know that DNS is the backbone of the web—it translates names into IPs, manages subdomains, caches results for speed, and allows you to override settings when needed.

Quick Cheat Sheet:#

/etc/hosts → Manually map names to IPs
/etc/resolv.conf → Set your preferred DNS server
ping, nslookup, dig → DNS troubleshooting tools
ipconfig /flushdns → Clear DNS cache (Windows)
systemd-resolve —flush-caches → Clear DNS cache (Linux/Mac)

You’re officially a DNS queen now! 👑💻 Have you ever played around with your DNS settings? Let’s chat in the comments! 💬✨


VERDICT & AESTHETICS#

  • Visual Doctrine: Traditional DevRel creates noise. I engineer clarity, proving that deep infrastructure and an unapologetically pink aesthetic belong in the same boardroom. Deploy like a queen. Study the architecture on YouTube.
  • The Syndicate: Stop fighting your deployments alone. Gain access to zero-friction protocols, enterprise subsidies, and the DevOps Army. Enter the Discord Ecosystem.

Tatiana Mikhaleva

Principal Developer Advocate  ·  Docker Captain  ·  IBM Champion  ·  AWS Community Builder

DNS for IT Girls - How the Internet Works Like Magic
https://devops.pink/dns-for-it-girls-how-the-internet-works-like-magic/
Architect
Tatiana Mikhaleva
Issued
2025-03-15
Protocol
CC BY-NC-SA 4.0