Dns Server Configuration In Linux 6 Step By Step Pdf Free
The DNS (Domain Name System) is a distributed system, used for translate domain names to IP address and vice a versa.For example when we type domain name in browser url like “https://tecadmin.net”, Our computer sends a request to DNS and get an ip address of domain.
Let us see the step by step approach to configure DNS in windows server 2012 for SharePoint 2013. Configuring DNS involves adding DNS role in server 2012. Below steps walk us through the same: 1. Open server manager by start - Server Manager. Then click on Add roles and features. Then click on Next.
This article will help you to step by step setup dns server on CentOS and RedHat systems.
Network Scenario:
- DNS Server IP: 192.168.1.254
- DNS Server Name: ns1.tecadmin.net, ns2.tecadmin.net
- Domain Name: demotecadmin.net
- Domain IP to point: 192.168.1.100
Step 1 – Install Bind Packages
Bind packages are available under default yum repositories. To install packages simple execute below command.
Step 2 – Edit Main Configuration File
Default bind main configuration file is located under /etc directory. But using chroot environment this file is located at /var/named/chroot/etc directory. Now edit main configuration file and update content as below.
Content for the named.conf file
Step 3 – Create Zone File for Your Domain
After creating bind main configuration file, create a zone file for you domain as per configuration, for example demotecadmin.net.db in this article.
Content for the zone file
If you are having more domain, its required to create zone files for each domain individually.
Step 4 – Add More Domains
To add more domains in dns, create zone files individually for all domain as above. After that add any entry for all zones in named.conf like below. Change demotecadmin.net with your domain name.
Step 5 – Start Bind Service
Start named (bind) service using following command.
Enable auto start on system boot.
Step 6 – Test Your DNS Setup
Send query to your dns server directly using below command.
Syntax: nslookup <domainname> <dns server name/ip>
Above output is showing that dns server has successfully resolved domain demotecadmin.net.
STEP BY STEP LINUX DHCP SERVER CONFIGURATION IN REDHAT/CENTOS/FEDORA
Introduction
In this article we are going to discuss on a very intresting and important topic i.e. DHCP Server Configuration. Linux DHCP Server stands for Dynamic Host Configuration Protocol is used to provide IP Address to client Computers Dynamically OR Automatically. The Port Number of DHCP Server is 67 and The Port Number of DHCP Client is 68.
Where Should we use DHCP Server ?
Suppose we have a small office with three computers with a router. Ip Address of the Router is 192.168.1.1 and We have a task to assign IP Address to remaining three computers. In that case we can go and assign IP Address to each and every computer manually. But just Imagine You are working on a large setup with Thousands of Client Computers, Multiple Network Printers and so many other networking devices. In such kind of situating it’s just impossible to assign IP Addresses manually. In such situation we need Linux DHCP Server. DHCP Server will assign the IP Address to all systems and devices dynamically or automatically.
How DHCP Server Works ? OR What is DORA Process ?
- When a new system connected to Network, As a first step he searches for a DHCP Server in Network and when he unable to found the same as he is currently don’t have any IP Address, the system sends a DHCP Discover message to all devices which are connected to network. This process is called as Broadcasting.
- When DHCP Server receives the DHCP Discover message from the Client Computer, DHCP Server offers and broadcast’s a IP Address (Eg: 192.168.1.3) to all connected devices.
- Now when Client Computer receives the IP Address he broadcasts a request on network that he accepts the IP Address.
- Then DHCP Server Acknowledge the IP Address that Now Client Computer can use the IP Address. This is how Linux DHCP Server Works. This Whole process is called as DORA (Discover Offer Request Acknowledgement).
Like other Services Like BIND DNS Server, NFS Server, DHCP is also a Server & client type of Server. So Here also we need a Server and a Client to configure DHCP Server. DHCP Server & Client details are mentioned below :
DHCP Server Details :
Server Name : dhcpserver
IP Address : 192.168.0.100
MAC Address :
DHCP Client Details :
Hostname : Client1
MAC Address :
Important Parameters of Linux DHCP Server
- option domain-name : Mention Domain Name eg : elinuxbook.com
- option domain-name-servers : Mention DNS Servers eg: 192.168.0.100, 192.168.0.101 (Note : You can also mention the FQDN)
- default-lease-time : The Default time in Seconds till the time DHCP Server will assign a IP to Client Computer.
- max-lease-time : The Maximum time in Seconds till the time DHCP Server will assign a IP to Client Computer.
- subnet : Mention the Subnet IP Address eg : 192.168.0.0
- netmask : Mention the Subnet Mask eg : 255.255.255.0
- range : Mention the IP Range which will dynamically assigned by Linux DHCP Server to Client Computers. eg : 192.168.0.2 to 192.168.0.240
- option routers : Mention the Gateway IP Address eg : 192.168.0.1
- option broadcast-address : Mention your Broadcast Address eg : 192.168.0.255
- hardware ethernet : Mention your MAC Accress OR Physical Address eg : 00:0C:29:F7:BE:27
- option host-name : Your systems Hostname OR Computer Name eg : dhcpserver
Follow the Below Steps for Linux DHCP Server Configuration
Step : 1 Prepare your Server before DHCP Server Configuration
Before we start configuration of DHCP Server first we need to prepare our server for that.
First Assign a Static IP Address to your Server. Refer the command below.
Give a proper Hostname to your Server. Here my Server’s Hostname is dhcpserver.
Step : 2 Install Required Packages
Install required packages and dependencies for Linux DHCP Server.
You can confirm if packages are properly installed or not by using below command.
After installation let’s check what is the Installation directory of Linux DHCP Server and Path of all configuration files. We can do so using below command.
So the Installation directory of DHCP Server is /etc/dhcp and the main configuration file of Linux DHCP Server is dhcpd.conf. By default the dhcpd.conf file would look like as shown below. As you can see below there is a message for us that we can copy the sample dhcpd.conf file from /usr/share/doc/dhcp* directory.
Step : 3 Prepare the Configuration File
So let’s go ahead and copy the dhcpd.conf.sample file as dhcpd.conf. System will ask for Overwrite as we already have dhcpd.conf file at /etc/dhcp path. So just enter yes and Press enter to continue the Copy.
Also Read :
Step : 4 Configure the Linux DHCP Server
Now let’s go ahead and configure the Linux DHCP Server. Just edit the /etc/dhcp/dhcpd/conf file by using your preferred text editor.
Below shown configurations are global variables and will apply to all subnet’s we declare on dhcpd.conf file. So just edit the configuration file and make changes as per your scenario.
Then declare a Subnet as per you network Scenario. Here I am taking IP Address starting from 192.168.0 and Subnet as 255.255.255.0
Sample Output :
Where :
Range is for allowed IP Address Range i.e. 192.168.0.5 to 192.168.0.240. DHCP Server will assign IP Address to client computers within these range. And Other settings are common like Domain Name, Router Address i.e. Gateway Address, DNS Servers and so on which I already explained above.
After all required changes in dhcpd.conf configuration file start the Linux dhcp server service using below command.
Configure DHCP Service to start at system startup.
DHCP Client Side Configuration
Configure the Ethernet connection from client side to get IP from DHCP Server. To do so just edit the ifcfg-ethX file and set BOOTPROTO=dhcp (Highlighted in Red color). Refer the sample output below.
Note : Replace X with your Ethernet Connection Number
Then restart the Network service using below command.
Once you restart the Network Service system will get the IP Address from Linux DHCP Server. To confirm the same we can use ifconfig command to check the IP Address. Refer the command below.
Once client get IP Address from DHCP Server you can see all the client information like The assigned IP Address, MAC Address, Client Computer Name in /var/lib/dhcpd.leases Server.
Note : IP Address lease Informations are stored in /var/lib/dhcpd.leases file. By Default it comes with DHCP Server Package Installation but if it is not there then you have to create it manually otherwise you will unable to start the DHCP Service.
Advance Features in Linux DHCP Server
One more useful feature you can configure in Linux DHCP Server is you can Reserve IP Address for some user using his MAC Address (Physical Address). Normally DHCP Server lease IP Address to client for some particular time. When you restart the system it is possible that DHCP will assign you a different IP Address.
The benefit of IP Reservation is the IP Address will never change. Suppose you have a Nework printer which is configured in so many client systems in that case if your IP Address change frequently then users will unable to use printer. For avoid such situation you have to reserve a IP Address for that printer in Linux DHCP Server.
6 Step Stool
Here I reserved a IP Address for one of my client computer i.e. client1. Refer the Sample Output below.
After required changes just restart the dhcp service to changes take effect.
Then restart the Network Service from DHCP client side and you will get the Reserved IP Address. Refer the Sample Output below.
Here I mentioned my dhcpd.conf configured file for Your Reference.
Dns Server Configuration In Linux 6 Step By Step Pdf Free Full
If you found this article useful then Like Us, Share Us, Subscribe our Newsletter OR if you have something to say then feel free to comment on the comment box below.