My sincere gratitude goes to Mr. Anuradha Jayakody and Mr. Rajitha Tennekoon of Sri Lanka Institute of Information Technology for teaching me these valuable concepts. Most of the below configurations are taken from the lab sheets written by them.

Go to "System" -> "Server Settings" -> "Domain Name System"
Click ok for the Warning Massage (No Bind configuration was found)
Delete the existing components without the DNS Security Key [rndc key] and
DNS server entry
You will be not able to delete the "Internet forward zone [.]" due to administrative
restrictions. So you can delete it via the WebMin tool.
File -> Save Click Yes
If it does not load...........
open your web browser
go to "https://localhost:10000/"
Add an exception for the certificate issue and proceed
login using your root credentials
Go to "Servers" -> "BIND DNS Server"
Delete all the existing DNS Zones there
Now try to open your "BIND configuration GUI" via "System" -> "Server
Settings" -> "Domain Name System"
Now you should be able to load the GUI
You should only see the rndc key and the DNS Server entry now.
Verify that all the entries are gone.

Adding “IPV4 Reverse” Zone

Right click on "DNS Server" -> "Add" -> "Zone"
Now we are going to add our first zone.
We are going to add "IN Internet" Zone. So click the "OK" Button under the "IN
Internet" drop-down menu.
Change the Origin Type to "IPV4 Reverse" -> click "OK"
Click on the "+ Add" Button twice.
Then Fill in your IP Address scheme in there. 10.0.1
Keep it as "Master" and click on "OK"
All the details in the next screen will depend on your network configuration and
requirements. Ex. What is the refresh levels and the Expiration times.
We will keep the default settings and only we are considering is the "Zone File
Path".
Change the "Zone File Path" into;
1.0.10.in-addr.arpa.zone -> Reverse of your IP Schema . Dirrection-
Addr.arpa.zone
".zone" is a must and it is really important.
Then click "OK" and it will refresh the "BIND configuration GUI" and will not
update anything.
After clicking "OK" then click "Cancel".
In "BIND configuration GUI" Goto File -> click "Save" -> Select "Yes"
Close it and Open it again so it will refresh and you will be able to see the zone
that you added previously.
Now configure your Forward zone.
Right click on "DNS Server" -> "Add" -> "Zone"
We are going to add "IN Internet Forward" Zone. So click the "OK" Button under
the "IN Internet" dropdown menu.
Change the Origin Type to "Forward" -> click "OK"
Give a name to the Forward zone "matara.sliit.lk."
Make sure to put a "." at the end of the name.
Here also change only the name of the "Zone File Path" as "matara.sliit.lk.zone"
Click "OK" and the Save the config as previously.

RNDC Entry

A Security key that uses to pass information securely between the DNS and DHCP server.
Whenever you feel that the key is been compromised, Double click on the rndckey entry and
click on the new button to generate a new key.

Editing the configuration file

Go to webmin and verify whether the created two entries(zones) are mapped
or not.
Now it is the time to configure the configuration file on DNS server and make
the DNS service run.
Click on the "Edit config File" in the webmin GUI.
Paste the following function after the first four comment lines

Observe the changes in the above functions that you have made and search
and understand why you need to do such changes.
Click on the "SAVE" button to save the changes to the config file.

Editing the “resolv.conf” file

In a terminal edit the resolv.conf file which resides on the etc folder.

gedit /etc/resolv.conf

Give your search domain and your nameserver IP in the config file.

search matara.sliit.lk
nameserver 10.0.1.2 //your server ip

Save the file.
Find out the usage of “resolv.conf” file and about why we have insert the
above two entries.

Making the Slave Zone copies

Browse the folder "/var/named/chroot/var/named" and then delete all the
unnecessary zones there if they exist.

DO NOT DELETE THE TWO ZONES THAT YOU HAVE CREATED BEFORE.

Copy the two zone files that you have created inside this folder to the
"slaves" folder which resides at the same directory.
So you will be having working copies at "/var/named/chroot/var/named"
and the slave copies at "/var/named/chroot/var/named/slaves"
If something goes wrong, you will be able to back-up the zones using the
original zones.

Setting permissions to those files

Open up a terminal and move in to the slaves directory

cd /var/named/chroot/var/named/slaves

Check the permissions of the files and folders on that directory.
Now give the write permissions to the group for the files inside the directory.

chgrp named *
chmod g+w *

Addressing Forward and Transfer zones

Go back to webmin.
Go to Servers -> BIND DNS Server -> click on "Forwarding and
Transfers"
What is a Forward zone?
It will get you out through the Internet
If you don't have an IP Address of a valid Name Server (Provided by ISP) to
route through the internet, give your router interface IP.
Type it under the IP address of "Servers to forward queries to"
Then Click on "Save" button.
Why are you giving your router interface address if you haven’t got a valid
Name server?

Starting the DNS server

Before starting the BIND server, make sure to check the “BIND.conf” file.
You can do this via the "Check BIND Config" Item in the webmin GUI under
Servers -> BIND DNS Server.
Or else you can use the terminal to check the config file.named-checkconf
If you come across any errors, it is the time to correct the syntaxes in
BIND.conf file. Do the corrections until you succeed.
Before proceed let’s check what happen if we have any errors.
Insert any letter in a blank space in your configuration file using webmin.
Save the file and check the config file via the “Check BIND Config” option
in webmin.
Then correct the error.
Click on the link "Start BIND" in the Upper right corner of the Webmin
Interface to start the BIND service.
Or start the service via the terminal.

service named start

Checking and Verifying whether the DNS server is working

You can use the “nslookup” tool to check the DNS service.
Open a terminal type nslookup.
Then type the name you need to resolve.Hint : type “matara.sliit.lk” and observe the output.
Then check the both name-to-IP and IP-to-name conversions are working
properly or not.
Also use the “dig” and “host -l” tools to check whether the DNS is working
properly.

dig matara.sliit.lk
dig 1.0.10.in-addr.arpa
host -l matara.sliit.lk

Observe the out puts from the tools and search about the usage of the tools.

My sincere gratitude goes to Mr. Anuradha Jayakody and Mr. Rajitha Tennekoon of Sri Lanka Institute of Information Technology for teaching me these valuable concepts. Most of the below configurations are taken from the lab sheets written by them.

Prerequisites

Centos 5.5 installed in VMWare.
Stop the LDAP service.
Set VMware network settings to NAT and make your server IP settings to obtain IP address automatically.
Restart the network service on CentOS.

Warning: If you do not configure the network settings to VMNET2 this installation will mess-up and harm entire company network.

Check the server’s IP is configured to 10.0.1.2 ( Specially you have to make sure, your server has been configured to static IP address)

What is the command you have used to check the IP settings?

ifconfig

Type following command to copy the sample DHCP file given by the installation. Importantly, you have to remember that, this is the file we are going to configure as the DHCP server. Any misconfiguration of this file will effect to the smooth functionality of the DHCP server.

cp -f /usr/share/doc/dhcp*/dhcpd.conf.sample /etc/dhcpd.conf

If it asks to over write the file, over write it.
Understand and write down what is the backup file here? And what is the configuration file we will be using here?

Back up file - dhcpd.conf.sample
Configuration file - dhcpd.conf

Type following command to edit the dhcpd.conf file

gedit /etc/dhcpd.conf

If you don’t have following 3 lines in your DHCPD.conf file add them. And google for them and find what are meanings of those lines.

The DHCP server has the ability to dynamically update the Domain Name System.Within
the configuration files, you can define how you want the Domain Name System to be updated. These updates are RFC 2136 compliant so any DNS server supporting RFC 2136 should be able to accept updates from the DHCP server.

Two DNS update schemes are currently implemented, and another is planned. The two that are currently available are the ad-hoc DNS update mode and the interim DHCP-DNS interaction draft updatemode. If and when the DHCP-DNS interaction draft and the DHCID draft make it through the IETF standards process, there will be a third mode, which will be the standard DNS update method. The DHCPserver must be configured to use one of the two currently-supported methods, or not to do dns updates. This can be done with the ddns-update-style configuration parameter.

THE INTERIM DNS UPDATE SCHEME

The interim DNS update scheme operates mostly according to several drafts that are being considered by the IETF and are expected to become standards, but are not yet standards, and may not be standardized exactly as currently proposed.

Because our implementation is slightly different than the standard, we will briefly document the operation of this update style here.

The first point to understand about this style of DNS update is that
unlike the ad-hoc style, the DHCP server does not necessarily always
update both the A and the PTR records. The FQDN option includes a flag which, when sent by the client, indicates that the client wishes to update its own A record. In that case, the server can be configured either to honor the client's intentions or ignore them. This is done with the statement allow client-updates;or the statement ignore client updates; By default, client updates are allowed.

ddns-update-style interim : Now we have our information, so let's configure the server by creating a text file named /etc/dhcpd.conf. The first line in the file must be the DNS update scheme. There are 2 choices, but only one that works reliably ... so we will use that one.That is ddns-update-style interim

ignore client-updates : allow the DHCP to update client info to a Dynamic DNS server. In our example, we are not going to try and update a Dynamic DNS via our DHCP server, so we will not allow client updates.

Dynamic DNS service

Dynamic DNS is provided by companies to allow users with Dynamic IP addresses to obtain a Domain Name that will always by linked to their changing IP address. The IP address is updated by either client software running on a computer or by a router that supports Dynamic DNS, whenever the IP address changes.

Carefully change following areas and understand each and every line and make a note that why exactly those lines are?

BOOTP, short for Bootstrap Protocol, is a protocol used to allow an Ethernet network device to obtain an IP Address over the network.

A device that wants to obtain an IP address broadcasts a BootP request that identifies the device by its MAC address, an identifying six octet number ( ex: 00:A0:45:08:CD:8D) that is uniquely assigned to a device by its manufacturer. A BootP server on the network, sees the request and sends a BootP reply containing a desired IP address (ex: 192.168.1.10) to the device, thereby making it now become accessible to higher level network communications using that IP address.

Save the file.

Edit the following file and give the IP address that client need to contact and the Ethernet interfaceclients need to contact to obtain IP address from the server.

gedit /etc/sysconfig/dhcrelay

INTERFACES="eth0" DHCPSERVERS="10.0.1.1"

dhcrelay agent

DESCRIPTION

The Internet Systems Consortium DHCP Relay Agent, dhcrelay, provides a means for relaying DHCP and BOOTP requests from a subnet to which no DHCP server is directly connected to one or more DHCP servers on other subnets.

OPERATION

The DHCP Relay Agent listens for DHCP and BOOTP queries and responses. When a query is received from a client, dhcrelay forwards it to the list of DHCP servers specified on the command line. When a reply is received from a server, it is broadcast or unicast (according to the relay agent’s ability or the client’s request) on the network from which the original request came.

Save the file and restart the DHCP service using

service dhcpd restart

Configure your client centos machines to obtain IP address form the DHPC service and verify that client has obtained an IP address from the given range of the IP addresses.