How to Configure DNS and DHCP Server on Linux Operating Systems?

What is DNS?

DNS (Domain Name System) An IP address is provided to go to every web address on the Internet. It is quite difficult and troublesome to keep the IP addresses of these web addresses one by one in our minds.
DNS comes into play here. It gives a name corresponding to the IP of each web address, so the names that are easier to replace than IP addresses are the name of the system that helps us keep in mind. For example techsoftcenter.com (IP value: 172.104.31.121)

What is DHCP?

DHCP (Dynamic Host Configuration Protocol) is simply the service used to give IP addresses to the computers in the system and additional parameters. The main purpose of DHCP is to enable the installer to automatically distribute IP addresses with DHCP the server instead of giving IP to individual devices. In addition, another convenience provided by the DHCP server is the NTP Server. Default Gateway etc. can also assign parameters.

We will use the “Oracle Enterprise Linux” operating system for installation. This article also applies to other operating systems. Compatible with (Red Hat, CentOS, Kali, Ubuntu and so on).

We will examine our setup processes under two headings, “DNS Server Configuration” and “DHCP Server Configuration“.

We disable our “Firewall” and “SELinux” services on our server. If our “Firewall” and “SELinux” services will be active, we will need to allow the ports that our services will use, so we need to disable them.

DNS Server Configuration (BIND DNS)

1. We install “BIND DNS” packages that we use in our operating system.

2. On our server, we edit our DNS Server address in your DNS configuration file “/etc/named.conf” and our DNS addresses that it will direct when it cannot resolve the name.

3. In our server, we make the necessary editing operations in the file “/var/named/localdomain.zone” in order to make your “Forward” DNS records.

4. In order to make our Reverse DNS records on our server, we organize it by making the necessary operations in the file “/var/named/0.168.192.in-addr.arpa”.

5. After finishing the operations on our server, we activate your service and we take the necessary actions to open it automatically when our server starts.

6. We have finished the procedures for DNS configuration on our server. Now we enter the address of this server, which we have configured to “/etc/resolv.conf” on our servers or computers that will resolve the web names.

7. We check the configurations we have made and make sure that they are working.

Our DNS Server configuration is complete. Now we will do the “DHCP Server” configuration.

DHCP Server Configuration

1. We are installing our “DHCP Server” package that we will use in our operating system.

2. We organize it according to the IP range that we will distribute in the “/etc/dhcp/dhcpd.conf” file that we will use for configuring “DHCP Server” in our server, as in the example below.

3. We start the “DHCP Server” service on our server with the settings we make, and when our server is rebooted, we do the necessary operations for automatic operation.

Your DHCP Server configuration is complete. Now, our computers in the network environment can automatically obtain IP addresses and other options from our server that we configure.

I hope it was a useful article.