4.2 DHCP and DNS

Key Takeaways

  • DHCP automatically assigns IP addresses, subnet masks, default gateways, and DNS servers to clients.
  • The DHCP process is DORA: Discover, Offer, Request, Acknowledge (all broadcast-based).
  • A DHCP relay agent forwards DHCP broadcasts to a server on a different subnet.
  • DNS resolves hostnames to IP addresses — forward lookup maps name to IP, reverse lookup maps IP to name.
  • Cisco routers can act as DHCP servers or relay agents.
Last updated: March 2026

DHCP and DNS

DHCP (Dynamic Host Configuration Protocol)

DHCP automatically assigns IP configuration to client devices, eliminating the need for manual IP address assignment.

What DHCP Provides

ParameterDescription
IP addressUnique address for the client
Subnet maskDefines the network boundary
Default gatewayRouter address for traffic leaving the subnet
DNS server(s)Name resolution server addresses
Lease timeHow long the client can use the address
Domain nameThe network's domain (e.g., example.com)

The DORA Process

DHCP uses a four-step process (all using broadcast/multicast at the beginning):

D — Discover (Client → Broadcast)

Client sends DHCPDISCOVER to 255.255.255.255 (broadcast)
Source IP: 0.0.0.0 (client has no IP yet)
Destination: 255.255.255.255
Protocol: UDP 67 (server) / 68 (client)

O — Offer (Server → Client)

Server responds with DHCPOFFER containing an available IP address
The offer includes: IP address, subnet mask, gateway, DNS, lease time

R — Request (Client → Broadcast)

Client broadcasts DHCPREQUEST accepting the offered IP
Broadcast because there may be multiple DHCP servers — this informs ALL servers

A — Acknowledge (Server → Client)

Server sends DHCPACK confirming the lease
Client can now use the IP address

On the Exam: Memorize DORA (Discover, Offer, Request, Acknowledge). Know that DHCP uses UDP ports 67 (server) and 68 (client). The Discover and Request are broadcasts from the client.

Cisco Router as DHCP Server

Router(config)# ip dhcp pool LAN-POOL
Router(dhcp-config)# network 192.168.10.0 255.255.255.0
Router(dhcp-config)# default-router 192.168.10.1
Router(dhcp-config)# dns-server 8.8.8.8 8.8.4.4
Router(dhcp-config)# lease 7                                ! 7-day lease
Router(dhcp-config)# exit

Router(config)# ip dhcp excluded-address 192.168.10.1 192.168.10.10  ! Reserve first 10

DHCP Relay Agent

DHCP uses broadcast, but broadcasts don't cross routers. If the DHCP server is on a different subnet, the router must act as a relay agent to forward DHCP broadcasts as unicasts to the server.

Router(config)# interface GigabitEthernet0/1           ! Interface facing the clients
Router(config-if)# ip helper-address 10.0.0.50          ! DHCP server's IP address

The ip helper-address command converts the broadcast DHCPDISCOVER to a unicast and forwards it to the specified server. The server responds directly to the relay agent, which forwards the response to the client.

DHCP Verification

Router# show ip dhcp binding              ! View current leases
Router# show ip dhcp pool                 ! View pool configuration and usage
Router# show ip dhcp server statistics    ! DHCP server statistics

DNS (Domain Name System)

DNS resolves human-readable hostnames (www.example.com) to IP addresses (93.184.216.34).

How DNS Works

  1. User types www.example.com in a browser
  2. PC checks its local DNS cache first
  3. If not cached, PC sends a DNS query to its configured DNS server
  4. DNS server performs recursive lookup if needed:
    • Root servers (.com) → TLD servers (example.com) → Authoritative server (www.example.com)
  5. DNS server returns the IP address to the PC
  6. PC connects to the IP address

DNS Record Types

RecordPurposeExample
AMaps hostname to IPv4 addresswww.example.com → 93.184.216.34
AAAAMaps hostname to IPv6 addresswww.example.com → 2001:DB8::1
CNAMEAlias pointing to another hostnameblog.example.com → www.example.com
MXMail server for the domainexample.com → mail.example.com
NSAuthoritative nameserver for the domainexample.com → ns1.example.com
PTRReverse lookup (IP to hostname)93.184.216.34 → www.example.com

DNS on Cisco Devices

Router(config)# ip name-server 8.8.8.8 8.8.4.4     ! Configure DNS servers
Router(config)# ip domain-lookup                      ! Enable DNS lookups (default)
Router(config)# no ip domain-lookup                   ! Disable DNS lookups (prevents slow lookups for typos)

On the Exam: DNS uses UDP port 53 for standard queries and TCP port 53 for zone transfers and large responses. Know the DHCP DORA process and that ip helper-address is used for DHCP relay.

Test Your Knowledge

What are the four steps of the DHCP process in the correct order?

A
B
C
D
Test Your Knowledge

Which command configures a Cisco router to forward DHCP broadcasts to a server on another subnet?

A
B
C
D
Test Your Knowledge

What DNS record type maps a hostname to an IPv4 address?

A
B
C
D