Tuesday 28 January 2014

BIND DNS in CentOS 6.4

BIND is open source software that implements the Domain Name System (DNS) protocols for the Internet.
It is a reference implementation of those protocols, but it is also production-grade software,
suitable for use in high-volume and high-reliability applications.

BIND is by far the most widely used DNS software on the Internet,
providing a robust and stable platform on top of which organizations
can build distributed computing systems with the knowledge that those
systems are fully compliant with published DNS standards.


BIND is an implementation of the Domain Name System (DNS) protocols.
The name BIND stands for “Berkeley Internet Name Domain”,
because the software originated in the early 1980s at the University of California at Berkeley.
In recent years, the word BIND has become, like “radar” and “laser”, more word than acronym.

The DNS protocols are part of the core Internet standards.
They specify the process by which one computer can find another computer on the basis of its name.
‘An implementation of DNS protocols’ means our software distribution contains all of the software
necessary for asking and answering name service questions.







Install Compile BIND DNS Server in CentOS 6.4 with Source

Note : I compiled bind with source file & in /opt .
 


-------------------------------------------------------------------------
1. Install Dependencies
-------------------------------------------------------------------------
# yum install gcc
# yum install openssl
# yum install openssl-devel

----------------------------------------------------------------------------------------------------------------------
2. Download and Install BIND
----------------------------------------------------------------------------------------------------------------------
#mkdir /softwares

#cd /softwares

#wget https://www.isc.org/downloads/file/bind-9-9-4-p1-tar-gz/?version=tar.gz

# tar -zxvf bind-9.9.4.tar.gz
# cd bind-9.9.4
# ./configure  --prefix=/opt/dns
# make
# make install
# rm -rf /softwares/bind-9.9.4


----------------------------------------------------------------------------------------------------------------------
3. Configure BIND main configuration file i.e named.conf
----------------------------------------------------------------------------------------------------------------------

# cd /opt/dns
# vi etc/named.conf

options{
        directory "/opt/dns/var/named";
        };

zone "yourdomain.com" in {
                        type master;
                        file "db.yourdomain.com";
                };

zone "your-another-domain.com" in {
                        type master;
                        file "db.your-another-domain.com";
                };
 




----------------------------------------------------------------------------------------------------------------------
4. Configure BIND Zone configuration files 
----------------------------------------------------------------------------------------------------------------------
# mkdir -p /opt/dns/var/named

Note: ::    Now  create zone configuration  file  as mentioned   in named.conf.
        Here we create for 2 domain, you have to create as per your requirement.

db.yourdomain.com
db.your-another-domain.com
 


# vi /opt/dns/var/named/db.yourdomain.com

$TTL 3H
yourdomain.com.    IN      SOA     yourdomain.com.    root.yourdomain.com.       (
                                1       ;serial
                                3h      ;refresh after 3 hours
                                1h      ;retry
                                1w      ;expire
                                1h)     ;-ve ttl

;nameserver
yourdomain.com.            IN      NS      ns.yourdomain.com.
yourdomain.com.            IN      A       192.168.1.100
;address record
ns                      IN      A       192.168.1.110
symantec                IN      A       192.168.1.101
mtest                   IN      A       192.168.1.124



----------------------------------------------------------------------------------------------------------------------
5. Open 53 dns udp port in iptables
----------------------------------------------------------------------------------------------------------------------
# vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m udp -p udp --dport 53 -j ACCEPT

# /etc/init.d/iptables restart
# /etc/init.d/iptables save




----------------------------------------------------------------------------------------------------------------------
6. Start named service
----------------------------------------------------------------------------------------------------------------------

# /opt/dns/sbin/named

---------------------------------------------------------------------------------------------------------------------- 
7. Check  named service is Started or Not
----------------------------------------------------------------------------------------------------------------------


ps -aef |grep bind



---------------------------------------------------------------------------------------------------------------------- 
8. Add  DNS entry in resolve.conf file
----------------------------------------------------------------------------------------------------------------------

Note: 192.168.1.2 is your DNS server IP

# vi /etc/resolv.conf
nameserver 192.168.1.2

---------------------------------------------------------------------------------------------------------------------- 
9. Verify DNS is working and resolving domains properly
----------------------------------------------------------------------------------------------------------------------

# nslookup mail.yourdomain.com
# nslookup google.com


---------------------------------------------------------------------------------------------------------------------- 
10. Re-Start named service (When you change any record you need to restart) ----------------------------------------------------------------------------------------------------------------------

# /opt/dns/sbin/named


---------------------------------------------------------------------------------------------------------------------- 
11. Check  named service is Started or Not
----------------------------------------------------------------------------------------------------------------------
ps -aef |grep bind




--------------------------------------------------   FINISH    ---------------------------------------------------

No comments:

Post a Comment