Networking Basics ยท 9

๐Ÿ“– DNS & DHCP

The two services that make the internet human-friendlyโฑ ~3 min

๐Ÿ“ฑDNS is your phone's contacts app

You don't memorize phone numbers โ€” you save 'Mom' and your phone dials the number. DNS does the same for the internet. You type 'youtube.com' and DNS looks up the actual IP address (e.g., 142.250.80.46) so your browser can connect. Without DNS, you'd need to memorize the IP address of every website you visit.

DNS Resolution โ€” step by step

  1. 1.You type 'kingcyberai.academy' in your browser
  2. 2.Browser checks its local cache โ€” did we look this up recently?
  3. 3.If not, asks your OS โ†’ then your router โ†’ then your ISP's DNS resolver
  4. 4.ISP's resolver asks a Root DNS Server (there are 13 sets worldwide)
  5. 5.Root server says 'ask the .academy TLD nameserver'
  6. 6.TLD server says 'ask kingcyberai.academy's authoritative nameserver'
  7. 7.Authoritative nameserver returns the actual IP address
  8. 8.Answer is cached at every step โ†’ next lookup is instant

DNS Record Types

RecordPurposeExample
AMaps domain โ†’ IPv4 addresskingcyberai.academy โ†’ 104.21.33.12
AAAAMaps domain โ†’ IPv6 addresskingcyberai.academy โ†’ 2606:4700::...
CNAMEAlias โ€” points to another domainwww โ†’ kingcyberai.academy
MXMail server for the domainโ†’ mail.kingcyberai.academy
TXTText records โ€” used for verificationSPF, DKIM email authentication
๐ŸจDHCP is like checking into a hotel

When you arrive, the front desk gives you a room key (IP address), tells you the breakfast hours (gateway), and gives you the WiFi password (DNS server). When you check out, the room is available for the next guest. DHCP does this for devices: automatically assigns an IP when you connect, and reclaims it when you disconnect. Without DHCP, a network admin would manually configure every device โ€” imagine doing that for 1,000 school computers.

What DHCP Assigns (the DORA process)

  1. 1.Discover โ€” device broadcasts: 'Anyone out there? I need an IP!'
  2. 2.Offer โ€” DHCP server replies: 'I can give you 192.168.1.45'
  3. 3.Request โ€” device says: 'Yes please, I'll take 192.168.1.45'
  4. 4.Acknowledge โ€” server confirms: 'It's yours for 24 hours (the lease time)'
โ˜… FactPublic DNS servers like Google (8.8.8.8) and Cloudflare (1.1.1.1) are faster and more private than your ISP's DNS. Cloudflare's 1.1.1.1 is consistently ranked the fastest DNS resolver in the world and promises never to sell your browsing data.
๐Ÿ”’ SecurityDNS Cache Poisoning: An attacker injects fake DNS records into a resolver's cache. Result: users who type 'yourbank.com' get sent to a convincing fake site that steals login credentials. Defense: DNSSEC (DNS Security Extensions) digitally signs records so resolvers can verify authenticity. Rogue DHCP: An attacker's device responds to DHCP requests before the real server, handing out a malicious gateway IP โ€” all traffic then flows through the attacker (man-in-the-middle).
๐Ÿง Quick Checkfirst try = +5 XP

You successfully ping 8.8.8.8 (Google's DNS server) but can't load google.com in your browser. What's the most likely cause?

โญ 0 XP๐Ÿ”ฅ 0 days