cara setting dns zimbra CentOS 5.x

by Wednesday, April 11, 2012 0 comments

Berikut cara installasi DNS untuk zimbra





1. install paket-paket yang dibutuhkan oleh DNS.

yum install bind bind-chroot bind-utils caching-nameserver

2. matikan sendmail dan iptables.

/etc/init.d/sendmail stop
chkconfig sendmail stop
chkconfig iptables stop

3. disabled selinux.

system-config-securitylevel

4. atur DNS (IP sendiri) dan hostname.

system-config-network

5. atur isi dari /etc/hosts .

vim /etc/hosts



tambahkan IP, FQDN, dan hostname. contoh :

192.168.1.76 zimbra1.domain4.com zimbra1

6. untuk mudahnya pindah ke direktori chroot

cd /var/named/chroot/

7. edit file named.rfc1912.zones di direktori etc/ .

vim etc/named.rfc1912.zones

ubah seperti berikut.

// named.rfc1912.zones:
//
// Provided by Red Hat caching-nameserver package
//
// ISC BIND named zone configuration for zones recommended by
// RFC 1912 section 4.1 : localhost TLDs and address zones
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
zone "." IN {
type hint;
file "named.ca";
};

zone "localdomain" IN {
type master;
file "localdomain.zone";
allow-update { none; };
};

zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};

zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {
        type master;
file "named.ip6.local";
allow-update { none; };
};

zone "255.in-addr.arpa" IN {
type master;
file "named.broadcast";
allow-update { none; };
};

zone "0.in-addr.arpa" IN {
type master;
file "named.zero";
allow-update { none; };
};

zone "namadomain" IN {
type master;
file "namadomain.zone";
allow-update { none; };
};

8. buatlah file named.conf di direktori  /var/named/chroot/etc/ .

vim named.conf

isikan seperti berikut.

//
// named.caching-nameserver.conf
//
// Provided by Red Hat caching-nameserver 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.
//
// DO NOT EDIT THIS FILE - use system-config-bind or an editor
// to create named.conf - edits to this file will be lost on
// caching-nameserver package upgrade.
//
options {
listen-on port 53 { any; };
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";

// Those options should be used carefully because they disable port
// randomization
// query-source    port 53;
// query-source-v6 port 53;

allow-query     { any; };
allow-query-cache { any; };
};
logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};
view localhost_resolver {
match-clients   { localhost; };
match-destinations { localhost; };
recursion yes;
include "/etc/named.rfc1912.zones";
};



9. buatlah file namadomain.zone di direktori var/named/ .

vim var/named/namadomain.zone


isikan seperti berikut.


contoh sebagai berikut.

$TTL 86400
@ IN SOA zimbra1.domain4.com.       root.domain4.com. (
                                                                 42 ; serial (d. adams)
        3H ; refresh
                                                             15M ; retry
                                                             1W ; expiry
                                                      1D ) ; minimum

                          IN NS       domain4.com.
IN MX 10   zimbra1.domain4.com.
domain4.com. IN  A 192.168.1.76
zimbra1              IN  A         192.168.1.76

11. nyalakan servis named dengan cara :

/etc/init.d/named start


12.coba periksa status DNS, bila benar akan seperti berikut.

nslookup namadomain --> nslookup domain3.com

Server: 192.168.1.76
Address: 192.168.1.76#53

Name:    domain4.com
Address: 192.168.1.76

atau

host -t mx namadomain --> host -t mx domain4.com

domain3.com mail is handled by 10 zimbra1.domain4.com.

atau

dig FQDN --> dig zimbra1.domain4.com

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-20.P1.el5 <<>> zimbra1.domain3.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39033
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;zimbra1.domain4.com. IN A

;; ANSWER SECTION:
zimbra1.domain4.com. 86400 IN A 192.168.1.76

;; AUTHORITY SECTION:
domain4.com. 86400 IN NS domain4.com.

;; ADDITIONAL SECTION:
domain4.com. 86400 IN A 192.168.1.76

;; Query time: 30 msec
;; SERVER: 192.168.1.76#53(192.168.1.76)
;; WHEN: Wed Mar 21 09:55:20 2012
;; MSG SIZE  rcvd: 83

semoga bisa membantu.... :D
tinggalkan jejak  dengan berkomentar  jika artikel ini membantu :D

M. Anwar

Founder of madeinanwar.blogspot.com

Terimakasih telah berkunjung kesini. semoga bermanfaat.

0 comments:

Post a Comment

komentar anda sangat berguna bagi saya..