Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Find the answer to your Linux question:
Site Navigation
Linux Forums
Linux Articles
Product Showcase
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds
Free Publications

What is DNS server? DNS stands for 'Domain Name Server' or 'Domain Name System'.A DNS server is a software used for Name to IP resolution and IP to name resolution.The Domain name system distributes the responsibility of assigning domain name and mapping those name into IP address by designating authoritative name server for each domain.A 'Domain name' means that a name given to an IP address.Domain name is easy to remember rather than the IP address.

A DNS server plays an important role in retrieval of data from world wide web pool.  DNS server act as a phone book for the  internet by
allowing human friendly hostname to the corresponding IP address in much a same way like a phone book where we find Phone numbers to the corresponding names.

DNS Server performs two main tasks:

1.Name to IP resolution

2.IP to Name resolution

In Name to IP resolution we write the name(domain name) in the address bar of the web browser and request is send to the server from
the client end.A DNS server resolve this name to IP address and further after resolution request is send at the server end.In return when Server fulfilling the request made by the client a IP to name resolution is done (.IP to Name resolution) and at client end web page get appeared on its browser.

For configuring DNS we need to know following important points:

1.Port no. 53

2.Package used Bind and Caching

3.Document root : /var/named/chroot

4.Configuration file : named.caching-named.conf

4.File for Name to IP resolution is f.zone

5.File for IP to Name resolution is r.zone

DNS is the only service in redhat linux whose configuration file is not present in etc directory.


1.First step is to install the package for DNS bind using yum.Yum install all the dependencies required for configuring DNS.


2. Next step is to install the package Caching for the configuration file,the main configuration file do not present in the Bind package.


3.After the Caching package installation being done, check the configuration file in /var/named/chroot/etc directory.

4.Now copy the content of configuration file 'named.caching-named.conf' to 'named.conf' using copy command.

using the list command(ls) we can check whether copy of configuration being created or not.The reason for doing this is not to made changes to original configuration file and made changes to copy file,so that if we by mistake made changes incorrectly to the file we can correct it on the later stages by referring to the original file.

5.Next step is to made some changes in the 'named.conf' file.

the first change is made in line number 15 by writing the IP address of the system in place of loopback ip; this change is made due to configure DNS on which it is setup.The second change is made in line number 27 by writing in the allow-query {'any'};this will allow any query made by other system working in a computer network .Last change is made by deleting all the lines from 29 onwards till to the end.

6.Now copying some lines from named.rcf912.zone to named.conf.This is the file named.rcf912.zone as seen below

11 lines are copied from this file to named.conf.Lines to be copied from line number 21 to 31 and paste it in the named.conf file.This
procedure is shown below,here the :edit command is used to made changes in named.conf file directly.

when named.conf file get open press 'p' for pasting all the lines that you have copied.you can see your pasted lines as shown in image

Now making further changes to the file.In line number 29 in place of "localhost.com" write "com" after that in line 31 write "f.zone" ;this
change is made for Name to IP resolution,where 'f ' signifies forward  and in line number 35 write " 0.168.192" replacing "0.0.127" and also in line number 37 write "r.zone";this change is made for IP to Name virtualization.By the term 'virtualization' means IP to Name mapping being done.


7.Now next step is to copy the content of 'localhost.zone' to 'f.zone' and 'named.zero' to 'r.zone' because we don't prefer to make
changes in the original file so that's why a copy is made of both.


8. Now we make some changes in forward zone file(f.zone) and reverse zone file(r.zone).The line 1 represents the ID of DNS,the DNS ID depends on top level domain means whether it is a .com,.edu,.in,.org,.au etc.  In line 2 SOA is Server of Authority and we made change by  writing 'com' for which DNS is setup.Next change is made in line 9 replacing @ for com. or com .In line 10 we made change like shown  in the image below.

this is the original file localhost.zone:

after changes made in f.zone file:

Now we make changes to r.zone(reverse) file.First in line 2 we write com. and next in line 8 again we write com. after that in line 9 we
write host id on which website is created and the FQDN(Fully Qualified Domain Name).All these changes you can see in the image below.

original file named.zero:

after changes made r.zone file:


9.Now we make entry in 'resolv.conf' file.The resolv.conf file present in the /etc directory.In this file we write nameserver preceded
by IP address of system on which website is created.



10.Final step is to restart the DNS service i.e service named restart.  If you see a failure after restarting the service it means you
have done some mistakes in zones file or otherwise you will be told where  you have done wrong changes and if you see like in the image below it means we have configured DNS successfully.

For More Articles Click Here

Rate This Article: poor excellent
Comments about this article

Comment title: * please do not put your response text here