Generating PDF…

Preparing…
← Back

IP Address Assignment & DNS Fundamentals

Introduction to Computer Networks

What you'll learn today

Part 1 — Assigning IP Addresses

  • Why every host needs an IP
  • Static vs Dynamic assignment
  • How DHCP works (the DORA process)
  • What APIPA is and when you'll see it
  • Lease lifecycle and DHCP options

Part 2 — DNS Fundamentals

  • Why DNS exists
  • The Root → TLD → Authoritative hierarchy
  • Recursive vs Iterative queries
  • DNS caching & TTL
  • Common record types: A, AAAA, CNAME, MX, NS, PTR…

Six interactive checkpoints along the way — quizzes, a DORA stepper, a DNS visualizer, and more.

Part 1

Assigning IP Addresses

Why every host needs an IP

  • An IP address is the logical identity of a device on a network — without one, the device cannot send or receive any IP traffic.
  • Every laptop, phone, server, printer, IP camera, smart bulb, and IoT sensor needs one.
  • Two big questions for every device:
    • Who decides which IP it gets?
    • Does that IP stay the same over time?
  • Those two questions lead us to Static vs Dynamic assignment.
Local Network Laptop 192.168.1.42 Phone 192.168.1.78 Printer 192.168.1.10 Server 192.168.1.5

Static vs Dynamic — at a glance

AspectStaticDynamic
Who assigns it?A human admin, manuallyA DHCP server, automatically
Does it change?Stays the same until changed by handCan change every time you join the network
Effort per deviceHigh — configure each oneNear zero — just plug in
Risk of duplicatesReal — if two admins pick the same IPServer tracks every lease, so no duplicates
Typical useServers, network gear, printersLaptops, phones, IoT devices

When to use a Static IP

Use a static IP when other devices need to find this device by a fixed address.

  • Servers — web, file, database, DNS, DHCP itself
  • Network printers — so the print queue always reaches them
  • Routers and switches — for management access
  • Wireless access points — for the controller to reach them
  • Security cameras / NVR — for stable recording
Server 10.0.0.5 Client A → 10.0.0.5 Client B → 10.0.0.5 Client C → 10.0.0.5

When to use a Dynamic IP

Use dynamic for any device that mostly initiates connections (a "client") and doesn't need a fixed address.

  • Laptops, desktops, phones, tablets
  • IoT and smart-home devices
  • Guest Wi-Fi clients
  • Anything that comes and goes from the network frequently

The DHCP server hands out an address, default gateway, subnet mask, and DNS server in one go — so the device "just works" the moment it joins the network.

Imagine configuring 200 phones in an office by hand… 😩

DHCP .5 Laptop .42 Phone .78 Tablet .103 leases assigned automatically

Quiz #1 — Static or Dynamic?

For each device, which kind of address makes the most sense?

1) The office's main file server, which 80 employees access daily.
2) A guest's laptop joining the conference-room Wi-Fi for an afternoon.
3) A network printer that 30 staff send print jobs to.
4) An employee's phone that connects to corporate Wi-Fi each morning.

What is DHCP?

  • Dynamic Host Configuration Protocol.
  • A service running on a server (or your home router!) that hands out IP addresses to devices that ask for them.
  • Also delivers everything else a device needs to work: subnet mask, default gateway, and DNS server(s).
  • Each handout is called a lease and lasts a configurable amount of time.
  • Uses UDP ports 67 (server) and 68 (client).
DHCP Server 192.168.1.5 Client no IP yet… offers IP requests & ack UDP 67 / 68

The DORA process

When a client joins a network, it negotiates a lease with the DHCP server in four messages:

D

Discover

Client → broadcast: "Anyone home?"

O

Offer

Server → client: "Try this IP"

R

Request

Client → broadcast: "I'll take it"

A

Acknowledge

Server → client: "Confirmed"

Just remember: Discover → Offer → Request → Ack. We'll walk through each on the next slides.

D — DHCP Discover

  • The client just woke up on the network. It has no IP yet.
  • It can't address a specific server, so it sends a broadcast packet.
  • Source IP: 0.0.0.0   Destination: 255.255.255.255
  • Includes the client's MAC address so a server can reply directly to it.
  • Every device on the LAN sees this packet — but only DHCP servers act on it.
Client 0.0.0.0 DISCOVER (broadcast) → 255.255.255.255 DHCP Server Other host

O — DHCP Offer

  • One or more DHCP servers receive the Discover and reply with an Offer.
  • The Offer contains a candidate IP address for the client, plus subnet mask, gateway, DNS, and lease length.
  • It's still a broadcast (the client has no IP yet), but it's addressed to the client's MAC.
  • If multiple DHCP servers exist, the client may receive multiple offers — it will accept just one.
Client listening… Server 192.168.1.5 OFFER "try 192.168.1.42"

R — DHCP Request

  • The client picks one offer (usually the first to arrive) and announces its choice.
  • It sends a Request — still as a broadcast, so all DHCP servers learn which offer was accepted.
  • Servers whose offers were not chosen can release the IP they reserved back into the pool.
  • The client says, in effect: "I want 192.168.1.42 from server 192.168.1.5."
Client 0.0.0.0 REQUEST (broadcast) "I'll take 192.168.1.42" Server (chosen) Other DHCP releases reserved IP

A — DHCP Acknowledge

  • The chosen server confirms with a final Acknowledge packet.
  • This officially commits the lease: the IP is now reserved for that client's MAC for the lease duration.
  • The client now has a full configuration: IP, subnet mask, gateway, DNS, lease time.
  • The client can begin using the network normally.

That's the full D-O-R-A!

Client 192.168.1.42 Server 192.168.1.5 ACK ✓ lease confirmed

Interactive: Walk through the DORA exchange

D
O
R
A

Client

0.0.0.0
MAC aa:bb:cc:11:22:33
Press "Next packet"

DHCP Server

192.168.1.5
scope 192.168.1.40-200
Click Next packet to begin the lease negotiation.

APIPA — when DHCP fails

  • If a client sends Discovers and gets no Offer (server down, cable unplugged, wrong VLAN…), it doesn't sit there with no IP forever.
  • It picks a random address from 169.254.0.0/16 — the Automatic Private IP Addressing range.
  • That lets it talk to other APIPA-using hosts on the same wire — but it cannot reach the gateway, so no internet.
  • Seeing 169.254.x.x in ipconfig is your big red flag: "DHCP isn't working."
No DHCP server reachable Client 169.254.39.52 ↓ self-assigned APIPA no gateway → no internet

Practice: Sort the IPs

Click an IP, then click the bucket it belongs in. Are these private (RFC 1918), APIPA, or public addresses?

10.0.5.42 169.254.10.7 8.8.8.8 192.168.1.100 172.16.5.1 142.250.190.46 169.254.255.1

Private (RFC 1918)

APIPA

Public

What's actually in a DHCP scope?

A "scope" is everything the server is configured to hand out:

OptionWhat it isExample
Address poolRange of IPs the server is allowed to lease192.168.1.100 – 192.168.1.200
Subnet maskHow big the local network is255.255.255.0 (/24)
Default gatewayThe router to send off-network traffic to192.168.1.1
DNS server(s)Who resolves names to IPs8.8.8.8, 1.1.1.1
Lease timeHow long the IP is reserved86400 sec = 1 day
Reservations"Always give MAC X this same IP"Printer, NAS
ExclusionsIPs in the pool the server must not hand out.100 – .105 reserved for static use

Home router vs Enterprise DHCP server

Home router (SOHO)

  • DHCP service is built into the router
  • Tiny scope (often 192.168.1.100 – 200)
  • One server, no failover
  • Short lease (often 1 day)
  • Simple GUI, few options

Enterprise (e.g. Windows Server, ISC, Cisco)

  • Dedicated server role, separate from the router
  • Multiple scopes for multiple VLANs
  • Failover or split-scope between two servers
  • Long leases (8+ days), reservations, vendor options
  • Integrates with DNS / Active Directory

Same protocol — very different scale.

Case study — small office of 50 users

You're designing the IP plan for an office on the 10.20.30.0/24 network.

DeviceAssignmentReasoning
Gateway routerStatic 10.20.30.1Every device's "default route"
DHCP / DNS serverStatic 10.20.30.5Itself! Can't lease to itself.
Network printerDHCP reservation → 10.20.30.10Same IP every time, but managed centrally
Wi-Fi APs (×4)Static 10.20.30.20–23Controller needs to find them
Reserved rangeExcluded .30–.49Future static needs
User laptops/phonesDHCP scope 10.20.30.50 – 10.20.30.200~150 dynamic leases for 50 users

Static for "infrastructure," dynamic for "people." Reservations bridge the gap.

Part 2

DNS Fundamentals

Why we need DNS

  • Computers route on IP addresses like 142.250.190.46.
  • People remember names like google.com.
  • We need a system that translates one to the other — that's DNS: the Domain Name System.
  • Think of it as the phone book of the internet — you look up a name, you get back a number.
  • Without DNS, every URL you typed would have to be a raw IP address — and IPs change!
Domain anatomy: www.google.com
www
Sub­domain
.
google
2nd-Level
Domain (SLD)
.
com
Top-Level
Domain (TLD)
.(root)
Phone book of the Internet google.com 142.250.190.46 github.com 140.82.121.4 name → IP

What DNS does — in one sentence

DNS turns a human-readable name into an IP address (and back).

Forward lookup

"What is the IP of google.com?"

google.com  →  142.250.190.46

Reverse lookup

"Which name does 8.8.8.8 belong to?"

8.8.8.8  →  dns.google

DNS uses UDP port 53 (and TCP 53 for larger replies / zone transfers).

The DNS hierarchy

  • DNS is a distributed, tree-shaped database. No single server knows everything.
  • Root servers — 13 logical clusters, "." — they know who runs each TLD.
  • TLD servers — Top-Level Domains: .com, .org, .net, .uk, … — they know who runs each domain inside their TLD.
  • Authoritative servers — own the actual records for a specific domain like example.com.
Root . .com .org .uk google example www, mail…

Walk-through: resolving www.example.com

  1. Your laptop asks its local resolver (often your router or your ISP's DNS) for www.example.com.
  2. Resolver checks its cache. If it's there and still fresh — done.
  3. Otherwise, the resolver asks a root server: "Who handles .com?" → root replies with the IP of a .com TLD server.
  4. Resolver asks the .com TLD server: "Who handles example.com?" → TLD replies with the authoritative server for example.com.
  5. Resolver asks the authoritative server: "What's the A record for www.example.com?" → it replies with the IP.
  6. Resolver caches the answer (with a TTL) and hands the IP back to your laptop.
  7. Your laptop opens a TCP connection to that IP. Done!

All of that usually happens in well under 100 ms.

Interactive: DNS Resolution Visualizer

📱 You
🌐 Resolver
⬆ Root / TLD
🏠 Authoritative
Type a hostname and click Resolve. Try the same name twice to see caching!

Common DNS record types

TypeWhat it mapsExample use
Aname → IPv4 addressBrowse to example.com
AAAAname → IPv6 addressSame, but over IPv6
CNAMEname → another name (alias)www.example.com → example.com
MXdomain → mail server nameRouting email to @example.com
NSdomain → authoritative name serversDelegation
PTRIP → name (reverse lookup)Mail logs, traceroute
TXTarbitrary textSPF, DKIM, domain verification
SOA"Start of Authority" — zone metadataOne per zone

A and AAAA records

  • A record — maps a hostname to one IPv4 address.
  • AAAA record — same idea, but for IPv6.
  • A name can have multiple A records → simple load balancing (DNS round-robin).

Sample zone file entries:

www.example.com.   IN  A     93.184.216.34
www.example.com.   IN  AAAA  2606:2800:220:1:248:1893:25c8:1946
api.example.com.   IN  A     203.0.113.10
api.example.com.   IN  A     203.0.113.11

The bottom two together = round-robin between two API servers.

www.example.com name A 93.184.216.34 AAAA 2606:2800:220:1: 248:1893:25c8:1946

CNAME records

  • Canonical NAME: an alias from one name to another name.
  • Resolver follows the chain until it lands on an A or AAAA record.
  • Useful when you want www.example.com and example.com to resolve to the same place — change the IP once, both follow.
  • Also common with hosting providers: myshop.com → myshop.shopify.com.
  • Rule: a name with a CNAME can't have any other records (except DNSSEC).
www.example.com.   IN  CNAME  example.com.
example.com.       IN  A      93.184.216.34
www.example.com example.com 93.184.216.34 CNAME A

MX records (mail)

  • MX = Mail eXchanger — names the mail server(s) for a domain.
  • Multiple MX records can coexist, each with a priority (lower number = tried first).
  • The MX value is always a hostname, never a bare IP.
RecordPriorityMail server
example.com IN MX10mail1.example.com (primary)
example.com IN MX20mail2.example.com (backup)

Sending server tries priority 10 first; falls back to 20 if it's unavailable.

Practice: Match the scenario to the record type

For each scenario, pick the DNS record type that does the job.

ScenarioYour answer
Map www.gameshop.com to the IPv4 address of its web server.
Tell senders which servers handle email for @gameshop.com.
Make shop.gameshop.com an alias for gameshop.myshopify.com.
Map a hostname to an IPv6 address.
Look up which name belongs to the IP 203.0.113.10.
Publish an SPF policy to help fight email spoofing.

Quiz #3 — DNS Mixed Bag

1) Which port does DNS primarily use?
2) A user can reach the company web server by IP but not by name. Which service is most likely broken?
3) What does TTL on a DNS record control?
4) Which record type points one name to another name?
5) Reading mail.eng.example.co.uk from right to left, which is the TLD?

Key takeaways

IP Assignment

  • Static for infrastructure, dynamic for clients.
  • DHCP delivers IP + mask + gateway + DNS in one go.
  • Remember DORA: Discover, Offer, Request, Ack.
  • 169.254.x.x = APIPA = "DHCP didn't answer."
  • Lease renews at 50% (T1), rebinds at 87.5% (T2).

DNS

  • Names ↔ IPs. Phone book of the internet.
  • Hierarchy: Root → TLD → Authoritative.
  • Your device does recursive; resolver does iterative.
  • Caching with TTLs makes DNS fast.
  • Records: A / AAAA / CNAME / MX / NS / PTR / TXT / SOA.

What's next?

Hands-on Lab 9

Put DHCP and FTP into practice in Cisco Packet Tracer across three sessions: build your own DHCP-served LAN, connect with classmates via Multiuser, and exchange files over FTP.

Up next in the course: Switches, Routers, and Network Segmentation.