November 22, 2024, 04:38:49 AM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: DNS  (Read 6106 times)

Offline sanjaysingh115

  • New Member
  • Posts: 1
DNS
« on: June 09, 2009, 07:42:14 AM »
please give me step dns configuration in redhat enterprise 5

Offline aktiwari4u

  • LST CareTaker
  • Crescent
  • *****
  • Posts: 161
    • http://aktiwari4u.tk/
Re: DNS
« Reply #1 on: June 11, 2009, 06:19:11 AM »
Small Procedure ..............


Install and configure Bind DNS Caching Server on Red Hat (CentOS) Distributions

    This will assume you already have Red Hat or one of it's variants install and configured.

Install Bind

    yum install bind - or up2date -i bind on Red Hat

Configure Bind on system startup

    chkconfig --level 2345 named on

Open ports on firewall

    vi /etc/sysconfig/iptables

        add the line -A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 53 -j ACCEPT

Start Bind (and restart iptables)

        * /etc/init.d/iptables restart
        * /etc/init.d/named restart


Offline aktiwari4u

  • LST CareTaker
  • Crescent
  • *****
  • Posts: 161
    • http://aktiwari4u.tk/
Re: DNS
« Reply #2 on: June 11, 2009, 06:20:17 AM »
Long Procedure...........................( Though this is copied but its good .........link not given :) batter to promote our forum..........)

The first thing we will need to do is determine if BIND is already installed on your system. The method I use is to check through the RPM Package Manager. This will not work if you downloaded the BIND source code and compiled it.

Type the following at the command prompt:
rpm -qa | grep -i bind
rpm -qa | grep -i caching

If BIND is installed you should get something similar to this (ignore ypbind...it is unrelated to BIND) and you will want to skip to part 2 of this tutorial.

If BIND is not installed you will get something similar to the below image and you should keep reading.

We need to install BIND and have a few options here. We can download the source code and compile it, but we won't take that route. We will want to install the RPM's to keep things simple. There are a couple sources we can get the RPM's from: download them or use the RedHat 9 CD's. If you don't have the RedHat 9 CD's then you will need to download the BIND RPM's. If you do have the CD's then you can mount and install.

If you are not root, type su - and press enter and type in the root password (stay logged in as root for the remainder of this tutorial). Next switch to a directory where you can store the RPM's. A good place is in your home directory under a folder called RPM. You can accomplish this by issuing the following commands.

cd ~
mkdir RPM
cd RPM

Choose your install method:

Install from CD
Download and Install the BIND RPM's

Install from CD

The BIND RPM's are located on the first CD and the caching name server and BIND development RPM's are located on the second CD. What we will do is mount the first CD, copy of BIND RPM's to the RPM folder we created, and unmount the CD. Then mount the next CD and copy the caching name server and BIND development RPM's to the RPM folder and unmount that CD. Then we will proceed to the install section.

Put the RedHat 9 CD 1 in your CD-ROM drive and issue the following command.

mount -t iso9660 /dev/cdrom /mnt/cdrom

If your drive mounted then you should see something similar to the following.

Next copy the BIND RPM's to your RPM folder.

cp /mnt/cdrom/RedHat/RPMS/bind-*.rpm .

We are now done with CD 1, so we can unmount it.

umount /mnt/cdrom

Put the RedHat 9 CD 2 in your CD-ROM drive and issue the following command.

mount -t iso9660 /dev/cdrom /mnt/cdrom

Next copy the caching name server and BIND development RPM's to your RPM folder.

cp /mnt/cdrom/RedHat/RPMS/bind-devel-9.2.1-16.i386.rpm .
cp /mnt/cdrom/RedHat/RPMS/caching-nameserver-7.2-7.noarch.rpm .

Now unmount the CD-ROM with umount /mnt/cdrom and take the CD out of the drive.

When you are done, do a directory list (ls) and you should have all four files.

Now that you have the RPM's it is time to actually install them. Go to the installation part.

Download and Install the BIND RPM's

I offer you two ways of downloading the RPM's. Using wget or using a FTP client. In my opinion using wget is far easier then using the basic FTP client that comes with RedHat. With wget you just supply the URL and it fetches the file for you. With the basic FTP client you have to issue more commands than I'm sure you'd like to. First thing you should do is check if you have wget on your system. Type wget and press enter. If you don't get a command not found error then it is installed and you should proceed to the wget section. If you do get the command not found error, you have no choice but to use the FTP client. In either case you will need to know where to download the RPM's from.

RedHat provides a list of mirror sites at http://www.redhat.com/download/mirror.html where you can choose where to download the RPM's (or ISO images) from. The server we will use is mirror.mcs.anl.gov and the full path to the RPM's is ftp://mirror.mcs.anl.gov/pub/redhat/redhat/linux/9/en/os/i386/RedHat/RPMS/.

We want to download the following files:
bind-9.2.1-16.i386.rpm
bind-devel-9.2.1-16.i386.rpm
bind-utils-9.2.1-16.i386.rpm
caching-nameserver-7.2-7.noarch.rpm

Download by wget
Download by FTP Client

Download by wget

Issue these commands one at a time.

wget ftp://mirror.mcs.anl.gov/pub/redhat/redhat/linux/9/en/os/i386/RedHat/RPMS/bind-9.2.1-16.i386.rpm
wget ftp://mirror.mcs.anl.gov/pub/redhat/redhat/linux/9/en/os/i386/RedHat/RPMS/bind-devel-9.2.1-16.i386.rpm
wget ftp://mirror.mcs.anl.gov/pub/redhat/redhat/linux/9/en/os/i386/RedHat/RPMS/bind-utils-9.2.1-16.i386.rpm
wget ftp://mirror.mcs.anl.gov/pub/redhat/redhat/linux/9/en/os/i386/RedHat/RPMS/caching-nameserver-7.2-7.noarch.rpm

You should get something similar to the following for each file you download.

When you are done, do a directory list (ls) and you should have all four files.

Now that you have the RPM's it is time to actually install them. Go to the installation part.

Download by FTP Client

I guess you don't have wget. No problem! FTP isn't that bad, there is just more typing involved. Type the following commands to download the RPM's.

ftp mirror.mcs.anl.gov

It then asks for a username, type anonymous and press enter. Then it will ask for your email address as a password. Type in your email address and press enter.

Once you are logged in, issue these commands one at a time.

bin
hash
cd /pub/redhat/redhat/linux/9/en/os/i386/RedHat/RPMS/
get bind-9.2.1-16.i386.rpm
get bind-devel-9.2.1-16.i386.rpm
get bind-utils-9.2.1-16.i386.rpm
get caching-nameserver-7.2-7.noarch.rpm

During each file download you will see a bunch of # symbols scroll by. This is just a text based progress bar. I find it helpful to let me know if a download has stalled. If you don't want to use the hash marks, type hash off and press enter.

You should receive screens similar to the following.

After you have retreived all four files, type quit and press enter. Do a directory list (ls) and you should have all four files.

Now that you have the RPM's it is time to actually install them.

Installing the BIND RPM's

Whichever path you chose, whether downloading the RPM's or installing from CD, you should be in the same directory where they are located. To install the RPM's you issue the following command.

rpm -ivh bind-*.rpm caching-nameserver-7.2-7.noarch.rpm

You should get something a screen similar to the following.

To verify the RPM's installed successfully, issue the following commands.

rpm -qa | grep -i bind
rpm -qa | grep -i caching

BIND should now be installed and you should get a screen similar to the following.

Now we need to make sure the BIND service starts upon boot-up. To do this we will use chkconfig and tell the OS to start named (BIND) to start on runlevels 3 and 5. For more information about runlevels and the Linux boot process visit this site http://www.siliconvalleyccie.com/linux-hn/runlevels.htm.

Issue the following commands to chkconfig to turn named (BIND) on for runlevels 3 and 5. Then we will verify they have been turned on.

chkconfig --levels 35 named on
chkconfig --list | grep -i named

I should also mention instead of using chkconfig you could have used the RedHat Text Mode Setup Utility. From the command line type setup and press enter. Scroll down to System Services and press enter. Scroll down to named and press the spacebar to put a check on it. Press tab, enter, tab, tab, enter. You should be back to the prompt. Verify that named will boot-up. Note: If you didn't install X Windows, runlevel 5 may not be turned on. This is ok because runlevel 5 is Multi-User GUI mode.

Everything looks good. Now we will start BIND and verify it is running.

/etc/init.d/named start
ps aux | grep -i named

That's all for part 1. In part 2 I will cover setting up BIND as a primary name server for a single zone.
« Last Edit: June 11, 2009, 06:22:59 AM by aktiwari4u »

Offline aktiwari4u

  • LST CareTaker
  • Crescent
  • *****
  • Posts: 161
    • http://aktiwari4u.tk/
Re: DNS
« Reply #3 on: June 11, 2009, 06:24:22 AM »
links are as below..........

Code: [Select]
http://www.xenocafe.com/tutorials/dns_linux/redhat/dns_linux_redhat-part1.php

Code: [Select]
http://www.xenocafe.com/tutorials/dns_linux/redhat/dns_linux_redhat-part2.php