Link to home
Start Free TrialLog in
Avatar of FalconQ
FalconQ

asked on

Configure DNS on Red Hat Linux

Hello,

can someone please explain me something about DNS-Bind server on Red Hat Linux.
When I did a research on the google, I found a lot of sites which explains how to configure DNS server on Red Hat, but all of those sites says that we need to configure the named.conf file which is located at the following location: /etc/named.conf but I could not find this file in the etc folder.

Than I did a search using "find" command and I found this file on the locations as showed below:

usr/share/doc/bind-9.3.6/sample/etc/named.conf
/etc/dbus-1/system.d/named.conf

So the question is do I need to copy one of these 2 files on to /etc and configure it than start the DNS Bind service OR use one of these 2 which I found.

I am little confused.... I could not find one web site which describes this issue....

I hope someone can help me.......

Thank You
Best regards
Avatar of linuxgfx
linuxgfx
Flag of Italy image

Are you sure you have BIND package installed?
What is the output of the command: rpm -qa | grep bind   ?
I don't understand why they didn't just call it bind.conf

If you have a folder /etc/bind or /etc/bind9 the .conf file should be in there.
if not, just copy the sample file to its config folder. if you dont have either of the folders above, create one in /etc/named.conf

How to copy the sample config file to /etc/named.conf:
cp /usr/share/doc/bind-9.3.6/sample/etc/named.conf /etc/named.conf

Here is a nice help file : http://linuxgravity.com/configuring-bind9-domain-name-server-on-centos-or-red-hat

N'Joy
did u check
/var/named/chroot/etc
Avatar of FalconQ
FalconQ

ASKER

hello folks,

thank you all for answering.
---------------------------------------
Answer to linuxgfx:
Here is the output

rpm -qa | grep -i bind
bind-9.3.6-4.P1.el5_4.2
bind-libs-9.3.6-4.P1.el5_4.2
bind-chroot-9.3.6-4.P1.el5_4.2

So dns bind is installed......
---------------------------------------
Answer to BitFreeze:
I don`t have those folders you named /etc/bind or /etc/bind9....
they don`t exist.. at all

the link you gave me is very good explanation, but still as You can see this link as
all other links says the same about the named.conf:
Edit named.conf (nano /etc/named.conf )

but the named.conf is not in the /etc folder !
---------------------------------------
Answer to nabeelmoidu:
I have checked and here is what I can see in the folder /var/named/chroot/etc
it`s only:  localtime  rndc.key

I am very confused about this file, why can`t red hat keep it in the /etc foldre........

Thank You all for answers...
Best regards
Avatar of FalconQ

ASKER

PS:

here is what I get when I try to find the file named.conf:

[root@redhat-server etc]# find / -name named.conf
/usr/share/doc/bind-9.3.6/sample/etc/named.conf
/etc/dbus-1/system.d/named.conf

Avatar of FalconQ

ASKER

And this is fresh-clean Red Hat installation (5.4) 64 bit........
Under the installations steps I have choosed to install:

Web server
DNS server
mysql server
mail server

that`s all I have installed.....
There is something wring with your bind intallation.
Try reinstall the package bind and search for the named.conf file.
You probably want to remove the package bind-chroot
Just copy the sample file to /etc

that is why they provided you with a sample.
cp /usr/share/doc/bind-9.3.6/sample/etc/named.conf /etc/named.conf

what is the output of
/etc/init.d/bind9 start
?
Avatar of FalconQ

ASKER

Answer to linuxgfx:
Hmm are you sure ? because this is a fresh installation.
That`s the first and the second this is not the first time
I have met the same issue... I had these problems before on CentOS...
which I never fixed.... and now I got same problems on Red Hat

Answer to BitFreeze:
Here is the output
[root@redhat-server ~]# /etc/init.d/bind9 start
-bash: /etc/init.d/bind9: No such file or directory
Avatar of FalconQ

ASKER

Message to BitFreeze:
I have no problems to copy that file to /etc folder, but does it fix this problem ?

SOLUTION
Avatar of linuxgfx
linuxgfx
Flag of Italy image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of FalconQ

ASKER

Message to BitFreeze:
PS:
In the folder /etc/init.d I don`t have the "bind9" but only "named"


ok, do

/etc/init.d/named start

and paste the output.
Avatar of FalconQ

ASKER

Answer to linuxgfx:
here is what I got when I tried to start it as you told me

[root@redhat-server ~]# service named restart
Stopping named: [  OK  ]
Locating /var/named/chroot//etc/named.conf failed:
[FAILED]
[root@redhat-server ~]#
---------------------------------------------------------------------
Answer to BitFreeze:
Here is the output

[root@redhat-server ~]# /etc/init.d/named start
Locating /var/named/chroot//etc/named.conf failed:
[FAILED]
[root@redhat-server ~]#
Avatar of FalconQ

ASKER

The file named.conf does not exist in the folder:
/var/named/chroot//etc/
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of FalconQ

ASKER

Thank you BitFreeze, I`ll check this link and try it...
Comming back with update...

Best regards
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of FalconQ

ASKER

Message to BitFreeze:
Ok, now I did as it was described on the link you sent me.
Now I was able to start the DNS Bind server service.

Since there was a lot of posts on the link you sent me I will describe exact what I did so other users can do the same if they met the same issue.
Here is woah I did on my fresh installed Red Hat:

1. copy following files
    named.conf
    named.rfc1912.zones
    named.root.hits
    FROM: /usr/share/doc/bind-9.3.3/sample/etc/
    TO: /var/named/chroot/etc

2. Edit the named.conf file
    nano /var/named/chroot/etc/named.conf

3. Remove the "view "localhost_resolver"
    and EVERYTHING below it all the way to the bottom.
    view "localhost_resolver"
    {
    /* This view sets up named to be a localhost resolver ( caching only nameserver ).
    * If all you want is a caching-only nameserver, then you need only define this view:

4. start the DNS server service:
    which I already did after these steps above:

    [root@redhat-server ~]# /etc/init.d/named start
    Starting named: [  OK  ]
    [root@redhat-server ~]#

Now use one of these links below to configure DNS server:

http://linuxgravity.com/configuring-bind9-domain-name-server-on-centos-or-red-hat

or:

http://www.xenocafe.com/tutorials/dns_linux/redhat/dns_linux_redhat-part2.php

Thank you very much all for helping !!!!!
Best regards
Avatar of FalconQ

ASKER

Thank You very much !! well job done !!