DNS vs DHCP
DNS (Domain Name System) is the internet's phonebook: it turns names like example.com into IP addresses your computer can actually connect to. DHCP (Dynamic Host Configuration Protocol) is the way devices get an IP address (and other network settings) when they join a network. Both are essential, both run quietly in the background, and they answer different questions.
Last reviewed on 2026-04-27.
Quick Comparison
| Aspect | DNS | DHCP |
|---|---|---|
| Full name | Domain Name System | Dynamic Host Configuration Protocol |
| Job | Translate domain names to IP addresses | Assign IP addresses to devices on a network |
| When it runs | Every time you visit a hostname | When a device joins a network (and periodically to renew) |
| Typical client | Browsers, apps, the OS resolver | The OS networking stack |
| Where the server lives | On the internet (often your ISP's, sometimes Google or Cloudflare) | Usually on your home router; in offices, on a dedicated server |
| Lease/cache | Records cached for the TTL set by the domain | IPs leased for a configurable time, typically hours to days |
| Default port | 53 (UDP and TCP) | 67 (server) and 68 (client) over UDP |
Key Differences
1. Names versus addresses
DNS answers "what IP does this name belong to?" Your browser cannot connect to example.com directly — it has to resolve it to an IP first. DNS does that.
DHCP answers "what IP do I have?" When a device joins a network, it doesn't know its own address yet; DHCP gives it one, plus the gateway, the DNS servers, and other settings.
2. Different lifecycles
DNS queries happen constantly while you use the network. Every new domain triggers a lookup, with results cached for the TTL the domain owner sets.
DHCP happens at the start (when a device joins) and periodically to renew the lease. Once you have an IP, DHCP usually stays out of your way.
3. Where the servers are
DNS servers can be local (your router's built-in resolver) or remote (your ISP, Google's 8.8.8.8, Cloudflare's 1.1.1.1, Quad9's 9.9.9.9). DNS recursively walks a tree of authoritative servers to answer queries it doesn't already know.
DHCP servers are typically local. In a home, the router runs DHCP for the LAN; in an office, a dedicated server. They don't need to talk to the public internet to do their job.
4. Failure modes
When DNS fails, you can ping IPs but names don't resolve. Pages don't load even though the connection itself works. The classic "internet is down" that isn't actually down.
When DHCP fails, your device gets stuck without an IP — or falls back to a 169.254.x.x self-assigned address. You're not on the network at all.
5. Customisation
DNS can be changed on a device or router to a different provider for speed, privacy, or content filtering (e.g., point to 1.1.1.1 for privacy, 9.9.9.9 for malware blocking).
DHCP is rarely changed. Static IPs sometimes replace it (servers, printers, IoT devices that need a fixed address), but most of the time it just runs.
6. How they show up together
When you join Wi-Fi, DHCP hands you an IP and the address of the network's DNS server.
Then every site you visit kicks off a DNS lookup using that server. The two work in sequence; you can't really use a network with one and not the other.
When to Choose Each
Choose DNS if:
- Diagnosing "the website won't load but ping works" — check DNS.
- Switching DNS providers for privacy, filtering, or speed.
- Configuring custom domain → IP mappings (hosts file, internal DNS for local services).
Choose DHCP if:
- Joining a network for the first time — DHCP is what makes it possible.
- Tracking down "my device has no IP" issues.
- Managing the lease pool on a busy network (many guests, many devices).
Worked example
You join café Wi-Fi. DHCP hands your laptop an IP like 10.0.0.42, plus the address of a DNS server (the café's router). You type diffbetween.net into your browser; the OS sends a DNS query to that server, which returns the IP. Your browser opens a TCP connection to that IP and the page loads. DHCP fired once at the start; DNS fires every time you visit a new hostname.
Common Mistakes
- "DNS is just for browsers." Almost every networked app does DNS — email clients, chat, games, video calls, software updaters.
- "Switching DNS makes the internet faster." A bit, sometimes. The biggest gains are for servers your ISP's DNS resolves slowly. For most pages, your DNS speed isn't the bottleneck.
- "Static IPs are more secure than DHCP." Not really. DHCP doesn't make a network insecure; access control happens at other layers.