Lesson 24 of 60 intermediate

DNS Deep Dive

The service that breaks everything indirectly

Open interactive version (quiz + challenge)

Real-world analogy

DNS is the switchboard of the internet. Every time you type a name, a DNS server converts it to a number. When the switchboard is slow, confused, or lying, every app looks broken — but the phones are fine.

What is it?

DNS is the naming layer of the internet and every enterprise. It rarely breaks spectacularly, but it quietly breaks everything else when it misbehaves. Mastering DNS mental models is a junior-to-mid jump.

Real-world relevance

Internal users can’t access the new portal. External users can. A junior checks split-horizon config and finds the internal DNS zone missing the new record. Adds it, TTL low. Fifteen minutes later everyone is back. No firewall team needed.

Key points

Code example

// DNS diagnostic flow

1) What does the client see?
   ipconfig /all                    # which DNS servers?
   nslookup portal.contoso.com
   Resolve-DnsName portal.contoso.com -Server 10.10.10.10

2) Ask different resolvers to isolate
   nslookup portal.contoso.com 1.1.1.1
   dig @8.8.8.8 portal.contoso.com

3) Clear local cache if stale
   ipconfig /flushdns
   Clear-DnsClientCache

4) Check zone authority (where the record should live)
   dig NS contoso.com
   whois contoso.com

5) Record-level check
   dig MX contoso.com
   dig TXT contoso.com
   dig _dmarc.contoso.com TXT

Line-by-line walkthrough

  1. 1. DNS diagnostic flow
  2. 2. Step 1 — what the client sees
  3. 3. Check configured DNS servers
  4. 4. Resolve via default
  5. 5. Resolve via a specific server
  6. 6. Blank separator
  7. 7. Step 2 — isolate resolver problems
  8. 8. Force 1.1.1.1
  9. 9. Force 8.8.8.8
  10. 10. Blank separator
  11. 11. Step 3 — clear local cache
  12. 12. Windows flush
  13. 13. PowerShell cache clear
  14. 14. Blank separator
  15. 15. Step 4 — zone authority
  16. 16. dig NS records
  17. 17. Whois ownership
  18. 18. Blank separator
  19. 19. Step 5 — record-specific checks
  20. 20. MX
  21. 21. TXT
  22. 22. DMARC TXT

Spot the bug

New CEO’s email to customer keeps going to spam.
Junior tells the sender ‘your email is fine; the customer’s spam filter is the problem.’
Need a hint?
Which DNS records should you check before blaming the recipient?
Show answer
Check the sender’s own DNS: SPF (TXT), DKIM (TXT selector), DMARC (TXT _dmarc) records. Missing or broken SPF/DKIM/DMARC is a leading cause of legitimate mail being marked spam. Validate these before escalating externally.

Explain like I'm 5

DNS is the phonebook. Your phone asks ‘what’s the number for portal?’ and someone else answers. If the phonebook is wrong, you call the wrong number. If the phonebook is slow, everyone complains their phone is broken.

Fun fact

Cloudflare’s public DNS service (1.1.1.1) commits to never logging your personal DNS queries — audited annually. Many enterprises still use their own internal DNS anyway because of AD SRV records and split-horizon needs.

Hands-on challenge

Using dig, query an A record, an MX record, and a TXT record for a public domain. Explain each result in plain English. Then flush your local cache and re-run.

More resources

Open interactive version (quiz + challenge) ← Back to course: IT Jobs Bootcamp