Вы находитесь на странице: 1из 3

Bind DNS Server Installation

Before you install the BIND Package Do the necessary pre-requisites as follows:

1. Set the static IP Address


2. Set the proper hostname on the machine and /etc/hosts file should be properly configured
3. Checked the file /etc/nsnswitch.conf check the hosts settings currently it is pointed to the files
4. Configured the Firewall settings and open the port or add the service
5. SELINUX Feature should be disabled for the installation and configuration purpose.

1. Method with the help of yum Repository:

BIND stands for Berkeley Internet Name Domain, a software which provides an ability to perform name to IP
conversion.

# yum -y install bind bind-utils

2. Installation of BIND DNS with the help of the source code:

Pre-Requisites packages need to install on the machine before you start the installation process.

 The gcc compiler (yum -y install gcc)


 The file utility (yum -y install file)
 OpenSSL header files (yum -y install openssl-devel)

Download the BIND software with the help of following command.


# wget https://ftp.isc.org/isc/bind9/9.11.4-P2/bind-9.11.4-P2.tar.gz

Extract the source tarball and enter the source directory.

# tar -xvzf bind-9.11.4-P2.tar.gz


# cd bind-9.11.4-P2

The generic BIND distribution doesn't follow CentOS 7 path conventions, so you don't want to run a
bare./configure command. The following example sets the system paths to sane values for CentOS 7, and
ensures that the most commonly used DNS features are turned on.
./configure --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc
--localstatedir=/var --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec
-- sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-libtool

Compiling and installing BIND

Run make install to compile and install the software.

# make install

INSTALLATION OF BIND SERVER | Mangesh Abnave


First, add a user and a group for BIND. Because the name server daemon is called named, we'll go with that;
later on, the init script we create will tell BIND to run as this unprivileged user. On some CentOS 7 installations,
you may get a warning that a user called named already exists; that's fine and you can disregard the warning.

[root@host ~]# adduser -r -s /sbin/nologin named


[root@host ~]# groupmems -a named -g named

Now create the filesystem structures where BIND will store its data. Zone files, temporary keys, and ephemeral
data will live in /var/named, log files will be written to /var/log/named, and the pidfile will go
to /var/run/named.

[root@host ~]# mkdir -p /var/named/{dynamic,data,slaves}


[root@host ~]# wget -O /var/named/named.ca ftp://ftp.internic.net/domain/named.cache
[root@host ~]# chown -R root:named /var/named
[root@host ~]# chmod 770 /var/named
[root@host ~]# chmod -R 770 /var/named/{data,dynamic,slaves}
[root@host ~]# mkdir /var/log/named
[root@host ~]# chown named:named /var/log/named
[root@host ~]# chmod 740 /var/log/named
[root@host ~]# mkdir /var/run/named
[root@host ~]# chown named:named /var/run/named
[root@host ~]# chmod 755 /var/run/named

Next, create a file at /etc/sysconfig/named to supply runtime options to the named service. If your server is
IPv6-capable, you can just create an empty file. If you're in an IPv4-only environment, use the command below
to create a file that (mostly) disables IPv6 features in BIND:

[root@host ~]# cat <<EOF > /etc/sysconfig/named


# Don't try doing IPv6 lookups
OPTIONS="-4"
EOF

Now, add an init script to manage the named service:

[root@host ~]# touch /etc/rc.d/init.d/named


[root@host ~]# chmod 755 /etc/rc.d/init.d/named

 Copy the contents of this file into /etc/rc.d/init.d/named

INSTALLATION OF BIND SERVER | Mangesh Abnave


etc-rc.d-init.d-named.txt

Configuring bind with the named.conf file

The BIND DNS server is configured through a file called named.conf. Installing BIND manually, as we did, doesn't


install this file; it's up to you to create a copy:

[root@host ~]# touch /etc/named.conf


[root@host ~]# chgrp named /etc/named.conf
[root@host ~]# chmod 640 /etc/named.conf

Technically, BIND will run even if this file is empty, but the bare minimum defaults probably won't meet your
needs. You need to open named.conf in an editor and set some configuration options.

named.conf.txt

At this point you should be ready to run BIND by starting the named service:

[root@host ~]# service named start


Starting named: [ OK ]

INSTALLATION OF BIND SERVER | Mangesh Abnave

Вам также может понравиться