TodayTools

Compare protocols

DNS vs DHCP: names vs addresses, and how they work together

Donate
What brings you here?

The difference at a glance

DNS

Domain Name System

Best for: Turning names into addresses

Asks for a name and gets back its address.
  1. example.com?, from You
  2. 203.0.113.10, from DNS server

DHCP

Dynamic Host Configuration Protocol

Best for: Giving devices an address

Hands a joining device its address, router and DNS server.
  1. Discover, from New phone
  2. Offer, from Router
  3. Request, from New phone
  4. Ack, from Router

The short answer

DHCP gives your device its own network settings when it joins: an IP address, the router to use and which DNS server to ask. DNS then turns names like www.example.com into IP addresses whenever you open a site. DHCP runs once per join on UDP ports 67 and 68. DNS runs for every new name on port 53. Your home router usually does both.

Which one fits you?

Tick everything that is true for you.

What do you need?

Your pick shows here

Tick one or more lines and we weigh them for you.

DNS and DHCP side by side

DNS vs DHCP: differences row by row
What differsDNSDHCP
Question it answersWhat is the IP address of this name?What address and settings should I use on this network?
When it runsEvery time a new name is neededWhen a device joins, then to renew the lease
Ports53 (UDP, TCP for large answers)67 (server) and 68 (client), UDP
MessagesQuery and responseDiscover, Offer, Request, Ack (DORA)
ScopeWorldwide, a tree of serversOnly your local network
Without itYou must type IP addressesYou must set the IP, gateway and DNS by hand
StandardRFC 1034, RFC 1035RFC 2131

Watch each one work

Each page plays the real packets on a map, step by step, with every header explained.

Test yourself

Each line describes one of the two. Which one?

Question 1 of 7

Question it answers

What is the IP address of this name?

Questions people ask

Does DHCP use DNS?

DHCP tells your device which DNS servers to use. Some routers also add each DHCP device's name into local DNS, so you can reach it by name.

Can one server do both DNS and DHCP?

Yes. Home routers usually run a DHCP server and a small DNS forwarder together. Offices often run them on separate servers.

What happens if DHCP fails?

The device gets no address, or picks a self-assigned one in 169.254.0.0/16 that cannot reach the internet.

What happens if DNS fails?

You stay connected, and sites still work by IP address, but names stop loading. Browsers show errors like the server could not be found.

More comparisons

Donate