4.3 Explain what DHCP and DNS do for hosts

CCNA 200-301 v1.1 · 4.0 IP Services

DHCP gives a host its address, mask, default gateway and DNS servers. DNS turns names such as www.cisco.com into addresses. Without the first, hosts cannot join the network; without the second, users cannot find anything on it. For the CCNA you explain both exchanges, the record types and how to check them on a host and a router.

What you must know

DHCP

A host without an address broadcasts a Discover. A server answers with an Offer, the host broadcasts a Request for it, and the server confirms with an Acknowledge. The lease holds the address, mask, default gateway, DNS servers, domain name and lease time. The host renews at half the lease. Because the Discover is a broadcast, a router must relay it (ip helper-address) when the server is on another subnet.

First PC1 leases its settings (1); only then can it query the DNS server it was given (2).

DNS

A host's resolver sends a query to its configured DNS server, usually over UDP 53 (TCP 53 for large answers and zone transfers). That recursive server answers from its cache or asks the root, then the top-level domain servers, then the domain's authoritative server, and caches the answer for its TTL.

RecordMaps
AName → IPv4 address
AAAAName → IPv6 address
CNAMEAlias → canonical name
MXDomain → mail server
PTRAddress → name (reverse lookup)
NSDomain → its name servers
ip domain-lookup
ip name-server 10.0.50.53
ip domain-name example.local
!
! or, in a lab, stop typos becoming lookups:
no ip domain-lookup

Commands

ipconfig /all (Windows)Address, mask, gateway, DHCP server, lease times and DNS servers.
nslookup www.cisco.comAsks the configured DNS server and shows the answer and which server gave it.
ipconfig /displaydns, ipconfig /flushdnsShow or clear the Windows DNS cache.
show ip dhcp bindingOn an IOS DHCP server: the leases given.
show hostsOn IOS: the name server and cached names.

Exam traps

Check yourself

Users can ping 8.8.8.8 but cannot open websites by name. What do you check?
The DNS server in the host's settings (ipconfig /all) and whether it answers (nslookup).
Which DNS record gives a name's IPv6 address?
AAAA.
Why does a DHCP server on another subnet need a relay?
The Discover is a broadcast and routers do not forward broadcasts; ip helper-address turns it into a unicast to the server.

More topics in 4.0 IP Services