740 words
4 minutes

DNS for IT Girls - How the Internet Works Like Magic

Cover image for 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 DNS β†’ 8.8.8.8
βœ… Cloudflare DNS β†’ 1.1.1.1
βœ… OpenDNS β†’ 208.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! πŸ’¬βœ¨


Tools I Personally Trust#

If you’re building things, breaking things, or just trying to keep your digital life a little calmer - these are tools I actually use every day:

πŸ›Έ Proton VPN (60% off link) - my invisible cloak online. It secures your Wi-Fi, hides your IP, and blocks trackers - even on the sketchiest cafe Wi-Fi.

πŸ”‘ Proton Pass (50% off link) - my password vault. On-device encryption for logins, 2FA, and notes - all mine and only mine.

πŸ¦‘ GitKraken Pro (50% off link) - my visual Git sidekick. Gorgeous commit graph, painless merges, and fewer β€œwhat just broke?” moments.

πŸ’– These links give you sweet discounts - and help support DevOps.Pink at no extra cost. Thanks a ton!


Social Channels#

🎬 YouTube
🐦 X (Twitter)
🎨 Instagram
🐘 Mastodon
🧡 Threads
🎸 Facebook
πŸ¦‹ Bluesky
πŸŽ₯ TikTok
πŸ’» LinkedIn
πŸ“£ daily.dev Squad
✈️ Telegram
🐈 GitHub


Community of IT Experts#

πŸ‘Ύ Discord


Refill My Coffee Supplies#

πŸ’– PayPal
πŸ† Patreon
πŸ₯€ BuyMeaCoffee
πŸͺ Ko-fi
⚑ Telegram Boost

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