Author Topic: install config bind on centos 5.5  (Read 8529 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
install config bind on centos 5.5
« on: กุมภาพันธ์ 22, 2011, 02:41:34 PM »
หลังจากเรา install centos เสร็จแล้วก็ทำการ download source ที่จำเป็นสำหรับการลง package แบบ yum มาได้เลยครับ

จะได้สะดวก สบาย นะ ของผมใช้เป็น 64bit นะครับ

# yum update
# rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm

#yum -y install bind
#yum -y install bind-utils

#mkdir -p /var/named/chroot/etc
#rndc-confgen -a -b 512 -c /var/named/chroot/etc/rndc.key
#cp /var/named/chroot/etc/rndc.key /etc/rcdc.key

เสร็จแล้วก็สร้าง config "named.conf" ใน /etc/named.conf ดังนี้

#####################Begin of "named.conf"##############################################
# Use with the following in named.conf, adjusting the allow list as needed:

##Config acl range.
acl customer-list{203.x.x.x/20; 102.x.x.5;};
acl internal-list{127.0.0.1;};

##Logging debug
        logging {
          channel config_log {
            file "log/config.log" versions 2 size 100K;
            print-severity yes; print-category yes;
          };
  channel query_log {
    file "log/queries.log" versions 1 size 250K;
    print-time yes; print-category yes;
  };
  channel default_log {
    file "log/default.log" versions 1 size 250K;
    print-time yes; print-category yes;
  };
  category config   { config_log; };
  category default  { default_log; };
  category notify   { default_log; };
  category security { default_log; };
  category queries  { query_log; };
};


options {
        pid-file "/var/run/named/named.pid";
        directory "/var/named/chroot/etc";
        dump-file "named_dump.db";
        allow-query     {customer-list;internal-list;};  #ให้ ACL ไหนบ้างที่ อนุญาติให้มา query
        allow-transfer {internal-list;customer-list;};   #ให้ ACL ไหนบ้างที่ อนุญาติให้มา transfer zone file
        allow-notify    { 102.x.x.3; 102.x.x.2; };   #ให้รับการ Notify การอัฟเดท่ zone file จาก ip ใดบ้าง
        recursion       yes;    # ให้ออกไป query ข้อมูล dns จากข้างนอกได้หรือไม่
        notify          yes;    # ให้มีการไป notify จากที่ allow-notify ได้หรือไม่

       
        listen-on       { any; };  #ให้ listen ทุก interface
        interface-interval 1;   
               
        };

########################## KEY For Transfer ###############################
include "/etc/rndc.key";
 controls {
       inet 127.0.0.1 port 953
               allow { 127.0.0.1; } keys { "rndckey"; };
 };
/////////////////////////////////////////////
/////// Master zone file
/////////////////////////////////////////////
/* zone "xxx.com" {
        type master;
        file "master/xxx.com.db";
};
*/
////////////////////////////////////////
///////////Reverse Zone
////////////////////////////////////////
/*
zone "96.17.10.in-addr.arpa" {
        type master;
        file "master/96.17.10.db";
};
*/
////////////////////////////////////////
//////////Forward Zone
////////////////////////////////////////
/*
zone "intra" {
        type forward;
        forwarders { 10.17.3.15; };
        forward only;
};
*/
//////////////////////////////////////////
//////////// Slave Zone //////////////////
//////////////////////////////////////////
/*
 zone "yyy.com" {
           type slave;
           masters { 192.104.247.19; }; 
           file "slave/db.yyy.com";
        };
*/

/////////////End of Slave Zone //////////
/////////////////////////////////////////
######################## End of "named.conf" ###########################################

ส่วน config ของ zone ถ้าเพิ่มเข้าไปแล้วก็เปิดใช้งานได้เลยนะครับ

ตัวอย่างข้างบนเป็นเพียง example ที่ปิดการทำงานไว้อยู่ เลยใช้งานไม่ได้ครับผม

"#cd /var/named
#chown -R named:named chroot"
#/etc/init.d/named restart