782 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 want to make your digital life a little calmer - here are two tools I use every day:

๐Ÿ›ธ Proton VPN - A trusted VPN that secures your Wi-Fi, hides your IP, and blocks trackers. Even in that no-password cafรฉ Wi-Fi, youโ€™re safe.

๐Ÿ”‘ Proton Pass - A password manager with on-device encryption. Passwords, logins, 2FA - always with you, and only for you.

These are partner links - you wonโ€™t pay a cent more, but youโ€™ll be supporting DevOps.Pink. Thank you - it really means a lot ๐Ÿ’–


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


Is this content AI-generated?

Absolutely not! Every article is written by me, driven by a genuine passion for Docker and backed by decades of experience in IT. I do use AI tools to polish grammar and enhance clarity, but the ideas, strategies, and technical insights are entirely my own. While this might occasionally trigger AI detection tools, rest assuredโ€”the knowledge and experience behind the content are 100% real and personal.

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