DNS vs DHCP: Naming the Network vs Configuring It
Overview DHCP and DNS are both foundational network services, but they solve different problems in a device’s journey onto the network. DHCP automatically assigns a device its IP address and network configuration when it joins a subnet, while DNS translates human-readable domain names into the IP addresses needed to actually reach other hosts. Comparison Diagram DHCP DNS Client (no IP) DHCP Server DHCPDISCOVER leased IP + gateway local subnet, broadcast Client (has IP) DNS Resolver example.com? 93.184.216.34 global, hierarchical gives device an address gives a name an address Comparison Table Aspect DHCP DNS Primary purpose Assigns an IP address and network configuration to a device Translates a domain name into an IP address Triggered by A device connecting or booting onto the network An application needing to resolve a hostname Transport protocol UDP, ports 67 (server) and 68 (client) UDP or TCP, port 53 Discovery mechanism Client broadcasts DHCPDISCOVER on the local subnet Client sends a unicast query to a configured resolver address Data returned IP address, subnet mask, default gateway, DNS server list IP address (A/AAAA record) or other record types like MX, CNAME, TXT State and validity Lease with an expiration time that must be renewed Record with a TTL, cached locally then re-queried after expiry Scope Local network segment or subnet Global, hierarchical, distributed across the internet Key Differences DHCP assigns IP addresses to devices; DNS resolves domain names to those addresses. DHCP requests use broadcast discovery on the local subnet; DNS clients send unicast queries to a configured resolver. DHCP assignments are leases that expire and renew; DNS answers are cached per record TTL. DHCP typically hands out the DNS server addresses a client should use, linking the two protocols at boot time. When to Use Each DHCP ...