Configuring DHCP and DNS

·

2 min read

Configuring DHCP and DNS

DHCP

<What>

Dynamic Host Configuration Protocol (DHCP) is a networking protocol that operates on UDP ports 67 and 68. DHCP allows hosts to automatically receive assigned IP addresses from a DHCP server instead of needing to configure them manually. This is efficient and scalable, especially for networks with hundreds of devices. In a large network with 500+ hosts, DHCP can assign IP addresses dynamically, eliminating errors and saving time compared to manually assigning IP addresses one at a time.

<How>

In larger networks, you may have different Virtual LANs (VLANs), with the DHCP server only available on one of them. This is where a DHCP relay agent becomes necessary. For example, let’s say VLAN B needs a pool of IP addresses, but the DHCP server is located on another VLAN. The DHCP relay agent forwards the request from VLAN B to the DHCP server. The DHCP server responds to the relay agent, which then assigns IP addresses to the devices in VLAN B.

The steps involved in DHCP communication are as follows:

  1. DHCP Discover: The client sends this message to locate a DHCP server or relay agent.

  2. DHCP Offer: The DHCP server or relay agent responds with a list of settings, including available IP addresses.

  3. DHCP Request: The client accepts one of the offered IP addresses.

  4. DHCP Acknowledgement: The server confirms the chosen configuration and assigns the IP address.

DNS

<What>

Domain Name System (DNS) is a networking protocol as well that uses both TCP and UDP port 53. DNS is used to translate domain names to IP addresses. To get a better grasp of what DNS is at a deeper level than this, check my DNS post here.

<How>

Again, to fully understand DNS at a higher level than what I will explain in this post please refer to my DNS post on how it works. But to get a brief grasp on DNS understand that DNS translates domain names to IP addresses. This gives the user a better user experience because instead of having to remember IP addresses like 8.8.8.8 or 142.250.64.110, google.com is much easier to remember than numbers separated by periods.

Demonstration Video