Install and configure BIND DNS Server on Centos 6.3 or Redhat RHEL

Howto install and configure BIND DNS Server on Centos 6.3 or Redhat RHEL

1. Install BIND DNS Server on Centos

[root@localhost ~]# yum install bind
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirror-fpt-telecom.fpt.net
* epel: ftp.tsukuba.wide.ad.jp
* extras: mirror-fpt-telecom.fpt.net
* rpmforge: mirror-fpt-telecom.fpt.net
* updates: mirror-fpt-telecom.fpt.net
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package bind.x86_64 32:9.8.2-0.10.rc1.el6_3.6 will be installed
–> Processing Dependency: bind-libs = 32:9.8.2-0.10.rc1.el6_3.6 for package: 32:bind-9.8.2-0.10.rc1.el6_3.6.x86_64
–> Running transaction check
—> Package bind-libs.x86_64 32:9.8.2-0.10.rc1.el6 will be updated
–> Processing Dependency: bind-libs = 32:9.8.2-0.10.rc1.el6 for package: 32:bind-utils-9.8.2-0.10.rc1.el6.x86_64
—> Package bind-libs.x86_64 32:9.8.2-0.10.rc1.el6_3.6 will be an update
–> Running transaction check
—> Package bind-utils.x86_64 32:9.8.2-0.10.rc1.el6 will be updated
—> Package bind-utils.x86_64 32:9.8.2-0.10.rc1.el6_3.6 will be an update
–> Finished Dependency ResolutionDependencies Resolved=====================================================================================================================================================================================================
Package Arch Version Repository Size
=====================================================================================================================================================================================================
Installing:
bind x86_64 32:9.8.2-0.10.rc1.el6_3.6 updates 4.0 M
Updating for dependencies:
bind-libs x86_64 32:9.8.2-0.10.rc1.el6_3.6 updates 871 k
bind-utils x86_64 32:9.8.2-0.10.rc1.el6_3.6 updates 182 kTransaction Summary
=====================================================================================================================================================================================================
Install 1 Package(s)
Upgrade 2 Package(s)Total download size: 5.0 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): bind-9.8.2-0.10.rc1.el6_3.6.x86_64.rpm | 4.0 MB 00:17
(2/3): bind-libs-9.8.2-0.10.rc1.el6_3.6.x86_64.rpm | 871 kB 00:03
(3/3): bind-utils-9.8.2-0.10.rc1.el6_3.6.x86_64.rpm | 182 kB 00:00
—————————————————————————————————————————————————————————————————–
Total 230 kB/s | 5.0 MB 00:22
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : 32:bind-libs-9.8.2-0.10.rc1.el6_3.6.x86_64 1/5
Installing : 32:bind-9.8.2-0.10.rc1.el6_3.6.x86_64 2/5
Updating : 32:bind-utils-9.8.2-0.10.rc1.el6_3.6.x86_64 3/5
Cleanup : 32:bind-utils-9.8.2-0.10.rc1.el6.x86_64 4/5
Cleanup : 32:bind-libs-9.8.2-0.10.rc1.el6.x86_64 5/5
Verifying : 32:bind-9.8.2-0.10.rc1.el6_3.6.x86_64 1/5
Verifying : 32:bind-libs-9.8.2-0.10.rc1.el6_3.6.x86_64 2/5
Verifying : 32:bind-utils-9.8.2-0.10.rc1.el6_3.6.x86_64 3/5
Verifying : 32:bind-utils-9.8.2-0.10.rc1.el6.x86_64 4/5
Verifying : 32:bind-libs-9.8.2-0.10.rc1.el6.x86_64 5/5Installed:
bind.x86_64 32:9.8.2-0.10.rc1.el6_3.6

Dependency Updated:
bind-libs.x86_64 32:9.8.2-0.10.rc1.el6_3.6 bind-utils.x86_64 32:9.8.2-0.10.rc1.el6_3.6

Complete!
[root@localhost ~]#

2. Configure your domain in /var/named

[root@localhost ~]# vi /var/named/ithelpblog.local
; Addresses and other host information.
;
@ IN SOA ithelpblog.local. hostmaster.ithelpblog.local. (
2012080701 ; Serial
43200 ; Refresh
3600 ; Retry
3600000 ; Expire
2592000 ) ; Minimum
; Define the nameservers and the mail servers
IN NS ns.ithelpblog.local.
IN A 192.168.0.108
IN MX 10 mail.ithelpblog.local.mail IN A 192.168.0.103
ns IN A 192.168.0.108
www IN A 192.168.0.108
[root@localhost ~]#

3. Add our domain to named configuration file

[root@localhost ~]# vi /etc/named.conf
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//options {
listen-on port 53 { 127.0.0.1;192.168.0.108; };
listen-on-v6 port 53 { ::1; };
directory “/var/named”;
dump-file “/var/named/data/cache_dump.db”;
statistics-file “/var/named/data/named_stats.txt”;
memstatistics-file “/var/named/data/named_mem_stats.txt”;
allow-query { localhost; };
recursion yes;dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;/* Path to ISC DLV key */
bindkeys-file “/etc/named.iscdlv.key”;managed-keys-directory “/var/named/dynamic”;
};

logging {
channel default_debug {
file “data/named.run”;
severity dynamic;
};
};

zone “.” IN {
type hint;
file “named.ca”;
};

include “/etc/named.rfc1912.zones”;
include “/etc/named.root.key”;

zone “ithelpblog.local” {
type master;
file “/var/named/ithelpblog.local”;
};
[root@localhost ~]#

4. Start Bind Service on Centos

[root@localhost ~]# /etc/init.d/named start
Generating /etc/rndc.key: [ OK ]
Starting named: [ OK ]
[root@localhost ~]# /etc/init.d/named status
version: 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6_3.6
CPUs found: 1
worker threads: 1
number of zones: 20
debug level: 0
xfers running: 0
xfers deferred: 0
soa queries in progress: 0
query logging is OFF
recursive clients: 0/0/1000
tcp clients: 0/100
server is up and running
named (pid 4189) is running…

5. Modify DNS Server on your server as our DNS Server IP Address

[root@localhost ~]# cat /etc/resolv.conf
nameserver 192.168.0.108
[root@localhost ~]#

6. Test our DNS Server

[root@localhost ~]# host -t mx ithelpblog.local
ithelpblog.local mail is handled by 10 mail.ithelpblog.local.
[root@localhost ~]#

That’s all. Thanks for using IThelpblog.com.

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>