๐ DNS & DHCP
The two services that make the internet human-friendlyโฑ ~3 min
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.You type 'kingcyberai.academy' in your browser
- 2.Browser checks its local cache โ did we look this up recently?
- 3.If not, asks your OS โ then your router โ then your ISP's DNS resolver
- 4.ISP's resolver asks a Root DNS Server (there are 13 sets worldwide)
- 5.Root server says 'ask the .academy TLD nameserver'
- 6.TLD server says 'ask kingcyberai.academy's authoritative nameserver'
- 7.Authoritative nameserver returns the actual IP address
- 8.Answer is cached at every step โ next lookup is instant
DNS Record Types
| Record | Purpose | Example |
|---|---|---|
| A | Maps domain โ IPv4 address | kingcyberai.academy โ 104.21.33.12 |
| AAAA | Maps domain โ IPv6 address | kingcyberai.academy โ 2606:4700::... |
| CNAME | Alias โ points to another domain | www โ kingcyberai.academy |
| MX | Mail server for the domain | โ mail.kingcyberai.academy |
| TXT | Text records โ used for verification | SPF, DKIM email authentication |
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.Discover โ device broadcasts: 'Anyone out there? I need an IP!'
- 2.Offer โ DHCP server replies: 'I can give you 192.168.1.45'
- 3.Request โ device says: 'Yes please, I'll take 192.168.1.45'
- 4.Acknowledge โ server confirms: 'It's yours for 24 hours (the lease time)'
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?