NetworkingCCNANetwork+

DHCP and DNS Explained for CCNA and Network+

Two protocols make modern networks usable without any configuration from end users. DHCP automatically assigns IP addresses, subnet masks, default gateways, and DNS server information the moment a device connects. DNS translates the human-readable names we type into the IP addresses computers actually need. Break either one and you break the internet experience for everyone on the network, even if the physical connections are working perfectly. CCNA and Network+ both test DHCP scope configuration, the DORA handshake, DNS record types, and what happens when these services fail.

7 min
3 sections · 5 exam key points
5 practice questions

DHCP: how automatic IP assignment works

DHCP works through a four-step process abbreviated as DORA: Discover, Offer, Request, Acknowledge. A new device broadcasts a DHCP Discover, announcing that it needs an IP address. The DHCP server responds with a unicast Offer containing an available IP address and configuration parameters. The device broadcasts a Request to formally ask for the offered address. The server sends an Acknowledge confirming the lease.

A DHCP lease has a duration after which the client must renew. Renewal begins at 50 percent of the lease time by sending a unicast renewal request to the server. If the server does not respond, the client tries again at 87.5 percent. If still no response, the client broadcasts another DORA sequence at expiry to find any available server.

The DHCP server must be configured with a scope: the range of addresses available for assignment, the subnet mask, the default gateway, the DNS server addresses, and the lease duration. Excluded addresses within the scope are reserved for static assignment to servers and printers. If a client receives an APIPA address (169.254.x.x), it means DHCP failed and the client self-assigned a link-local address.

DHCP relay and DNS fundamentals

DHCP Discover messages are broadcasts, and routers do not forward broadcasts between subnets. In a network with multiple subnets and a single DHCP server, routers must be configured as DHCP relay agents (ip helper-address on Cisco). The relay agent converts the broadcast Discover into a unicast and forwards it to the DHCP server. The server knows which scope to use because the relay includes the subnet information in the forwarded packet.

DNS translates domain names to IP addresses. When you type example.com in a browser, your device sends a DNS query to its configured DNS server (the recursive resolver). If the resolver does not have the answer cached, it follows a hierarchy: first querying a root DNS server, then the authoritative server for the top-level domain (.com), then the authoritative server for example.com. The final answer is returned, cached for the duration of the TTL, and used to make the connection.

DNS records store different types of information. A records map a hostname to an IPv4 address. AAAA records map a hostname to an IPv6 address. CNAME records create an alias from one hostname to another. MX records identify mail servers for a domain. PTR records support reverse DNS lookups, mapping an IP address back to a hostname.

How to choose the correct answer

DORA steps: Discover (client broadcast, no IP yet), Offer (server unicast), Request (client broadcast), Acknowledge (server unicast). Both Discover and Request are broadcasts because the client has no IP yet when it sends Discover and wants all servers to know which offer it accepted.

APIPA address (169.254.x.x): DHCP failed. Client could not reach any DHCP server.

DHCP relay: needed when DHCP server and clients are on different subnets. Configured on the router with ip helper-address pointing to the DHCP server.

DNS record types: A = IPv4. AAAA = IPv6. CNAME = alias/redirect. MX = mail server. PTR = reverse lookup. SOA = start of authority for the zone. NS = name server for the zone.

DNS TTL: how long a resolver caches the answer. Lowering TTL before a planned DNS change ensures clients pick up the new record faster after the change.

DNS record types

Record typePurposeExample
AHostname to IPv4 addresswww.example.com -> 93.184.216.34
AAAAHostname to IPv6 addresswww.example.com -> 2606:2800:220:1:248:1893:25c8:1946
CNAMEAlias from one name to anothermail.example.com -> example.com
MXMail server for the domainexample.com mail handled by mail.example.com
PTRIP address to hostname (reverse)93.184.216.34 -> www.example.com
NSAuthoritative name server for zoneexample.com NS ns1.example.com

Key exam facts — CCNA / Network+

  • DORA: Discover (broadcast), Offer (server unicast), Request (broadcast), Acknowledge (unicast).
  • APIPA 169.254.x.x: DHCP failed, client self-assigned link-local address.
  • DHCP relay (ip helper-address): required when server and clients are on different subnets.
  • DNS hierarchy: recursive resolver, root server, TLD server, authoritative server.
  • A record: hostname to IPv4. AAAA: hostname to IPv6. CNAME: alias. MX: mail. PTR: reverse.

Common exam traps

The DHCP Request step is a unicast directly to the server that made the offer.

The DHCP Request is broadcast, not unicast, even though the client received a specific offer. Broadcasting allows all DHCP servers to see which offer was accepted so they can release any competing offers. Only the Acknowledge from the winning server is unicast back to the client.

DNS resolution always goes to the same server every time.

Your device sends queries to the configured recursive resolver (usually your ISP or corporate DNS server). That resolver contacts root servers, TLD servers, and authoritative servers as needed, caching answers to serve future queries faster. Multiple servers are involved in a full resolution.

A CNAME record can have the same name as the zone apex (root domain).

A CNAME record cannot be created at the zone apex because DNS requires SOA and NS records at the apex, which cannot coexist with a CNAME for the same name. This is why services use A records or ALIAS/ANAME records at the root domain, not CNAME.

Practice questions — DHCP & DNS

These questions are representative of what you will see on CCNA, Network+ exams. The correct answer and explanation are shown immediately below each question.

Q1.A workstation receives the IP address 169.254.15.30. What does this indicate?

A.The workstation was assigned this address by the DHCP server
B.DHCP failed and the workstation assigned itself an APIPA address
C.The workstation is configured with a static IP in the 169.254.0.0/16 range
D.The workstation's DNS is not configured correctly

Explanation: 169.254.x.x is the APIPA (Automatic Private IP Addressing) range. When a device cannot reach a DHCP server, it self-assigns an address in this range. APIPA addresses are link-local only — the device can communicate with other APIPA devices on the same segment but cannot reach the internet or other subnets. The root cause is typically a DHCP server issue, network connectivity problem, or ip helper-address misconfiguration.

Q2.In the DHCP DORA process, why is the DHCP Request message sent as a broadcast rather than a unicast to the offering server?

A.DHCP clients don't know the server's MAC address until after the handshake
B.Broadcasting allows all DHCP servers on the segment to see which offer was accepted, so competing servers can reclaim their reserved addresses
C.Broadcasts are required for all DHCP traffic by RFC specification
D.The client's IP isn't known yet so unicast is impossible

Explanation: When multiple DHCP servers respond to a Discover with Offers, the client broadcasts its Request to notify ALL servers about its selection. Servers that were not chosen receive this broadcast and release their tentatively reserved addresses back to their pools. If the Request were unicast, only the selected server would know, and other servers would waste addresses until they time out.

Q3.A client on subnet 10.1.1.0/24 cannot get a DHCP address. The DHCP server is on subnet 10.2.2.0/24. The router between the subnets has no special configuration. What is the problem and solution?

A.The DHCP server must be on the same subnet as the clients; move it
B.The router needs 'ip helper-address 10.2.2.100' on the client-facing interface to forward DHCP broadcasts
C.The client needs a static default gateway to reach the DHCP server
D.The router needs DHCP relay disabled to allow broadcasts to pass

Explanation: DHCP Discover messages are broadcasts. Routers do not forward broadcasts between subnets by default. The solution is 'ip helper-address [DHCP-server-IP]' configured on the router's interface facing the client subnet. This converts the DHCP broadcast to a unicast forwarded to the DHCP server. The DHCP server uses the relay agent's information to determine which scope to use.

Q4.A company wants to create an alias so that 'mail.company.com' resolves to 'company.com'. Which DNS record type should be used?

A.A record
B.PTR record
C.CNAME record
D.MX record

Explanation: A CNAME (Canonical Name) record creates an alias from one hostname to another. 'mail.company.com CNAME company.com' means requests for mail.company.com resolve through company.com's A record. A records map directly to IP addresses. PTR records are for reverse DNS. MX records identify mail servers for a domain (different from an alias for mail access).

Q5.Which DNS record type is used to identify the mail server responsible for accepting email for a domain?

A.A record
B.CNAME record
C.MX record
D.PTR record

Explanation: MX (Mail Exchange) records specify the mail servers responsible for accepting email messages for a domain. When an email server wants to deliver mail to user@example.com, it queries DNS for the MX record of example.com to find where to send the message. MX records also have priority values — lower numbers indicate higher priority mail servers.

Frequently asked questions — DHCP & DNS

What does the DORA acronym stand for in DHCP?

DORA represents the four steps of DHCP address assignment: Discover (client broadcasts to find DHCP servers), Offer (server responds with an available IP address and configuration), Request (client broadcasts to accept the specific offer), Acknowledge (server confirms the lease). Both Discover and Request are broadcasts; Offer and Acknowledge are typically unicast from the server.

What is an APIPA address and what does it mean?

APIPA (Automatic Private IP Addressing) is the Windows feature that assigns a 169.254.0.0/16 address when DHCP fails. It allows basic communication with other APIPA hosts on the same segment but cannot reach other subnets, internet resources, or DNS. Seeing a 169.254.x.x address means DHCP is not reachable — check DHCP server status, network connectivity, and ip helper-address configuration.

What is a DHCP relay and why is it needed?

DHCP clients broadcast DORA messages, and routers don't forward broadcasts between subnets. When a DHCP server is on a different subnet than its clients, a DHCP relay agent is required. On Cisco routers, 'ip helper-address [server-IP]' configured on the client-facing interface converts DHCP broadcasts to unicast and forwards them to the DHCP server. The DHCP server uses relay information to identify the correct scope.

What is the difference between DNS A and AAAA records?

A records map a hostname to an IPv4 address (32-bit). AAAA records (pronounced 'quad-A') map a hostname to an IPv6 address (128-bit). On a dual-stack network, a hostname like www.example.com might have both an A record (for IPv4 clients) and an AAAA record (for IPv6 clients). The client's DNS resolver returns the appropriate record based on what the client supports.

How are DHCP and DNS tested on CCNA and Network+?

CCNA tests the DORA process (which steps are broadcast vs unicast), DHCP scope configuration, APIPA addressing, ip helper-address for relay, DNS record types (A, AAAA, CNAME, MX, PTR, NS), and DNS resolution hierarchy. Network+ covers similar concepts with more emphasis on troubleshooting: identifying DHCP failures (APIPA), DNS resolution issues (wrong record type, incorrect server), and configuring basic DHCP/DNS in a small network.

Practice this topic

Test yourself on DHCP & DNS

JT Exams routes you to questions in your exact weak areas — automatically, after every session.

No credit card · Cancel anytime

Related certification topics