DHCP and DNS are two essential services in IT networks. While a DHCP server sends out information that clients need to communicate with other machines and services, DNS ensures that servers, clients, and services can be found by their names.
What is DHCP?
The Dynamic Host Configuration Protocol dynamically assigns IP addresses and other configuration options to devices in a network. This way, it’s very easy to add new computers, tablets, or smartphones – administrators no longer have to configure every device manually, since the DHCP server does the job. This is why DHCP is great for larger networks with constantly changing clients, e.g. schools, companies, etc.
The DHCP server either distributes free IP addresses from a specific pool, or it assigns static addresses to the clients and identifies them via their MAC address (Media Access Control, unique identifier assigned to a network interface controller). In the first scenario, the clients can get different IPs, which can be convenient if the server hands out addresses from a small pool to a large number of devices (that are not active at the same time). If the DHCP server distributes static addresses, all clients always receive the same IP – ideal for network services or certain machines that have to be accessible around the clock.
The DHCP server also determines how long an IP address is valid. If the so-called lease time expires while a client is still active, it tries to automatically renew the lease time. Users don’t normally notice this exchange between the server and the client.
As I mentioned, the DHCP server can also transfer other information to the clients, such as subnet mask, name server, domain name, and gateway – even details for network booting (PXE boot, Preboot eXecution Environment), NTP (Network Time Protocol), or proxy configuration via WPAD (Web Proxy Auto-Discovery Protocol).
A unique feature of IPv6 is the stateless address configuration (SLAAC): Clients can pick their own addresses (based on the prefix being advertised on the connected network interface). A DHCP server can still be useful in IPv6 networks, as it can hand out information about the time server, domain names, DNS servers, etc. to clients.
What is DNS?
Thanks to DNS nobody has to remember IP addresses – the Domain Name System is a hierarchical and decentralized naming system for computers, services, etc. connected to the internet or a private network. DNS works a bit like a telephone book: It assigns domain names like www.univention.de to numerical IP addresses (126.96.36.199) and vice versa. DNS consists of thousands of servers working together. If one server cannot resolve a name or IP, it can contact another server that can then ask the next one, and so on.
A DNS server in a private network is also responsible for the name resolution. It knows all IP addresses and names of the devices. For external queries, i.e. to the internet, the local name server can contact one or more external DNS servers.