You are on page 1of 5

CentOS Linux Server Guide

CentOS Mail Server


Installing Zimbra Collaboration Server on CentOS
(Part 3: Configuring CentOS Split DNS behind firewall )

Zimbra Collaboration Server(ZCS) setup is very sensitive to hostname and DNS, many of the people facing
difficulties when setting up the ZCS is mainly due to DNS setting.
You might need to pay attention for the following
Step1: Change the host file
First, we need to add in our internal IP in host file.
# vi /etc/hosts
The host file shall look like the following screen capture. The format of the configuration file shall look like
this.
internal ipaddress yourhostname.yourdomain.com yourhostname
Note: We are Not discussing NAT in this topic. However, in this scenario, we assume that the ZCS
server resides behind a firewall, the IP address is the internal IP address (IP that is used behind the
firewall).
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.142.7 mail.1a-centosserver.local mail
Step2: Configure the DNS Bind Server
A split DNS needs to be set up so that when Zimbra tries to perform a nslookup for the server, the Split
DNS which is behind-the-firewall IP address replied back to Zimbra.
We are now configuring our DNS Bind Server as Split DNS server to server the ZCS.
First, we need to start the DNS server services
#chkconfig named on

Step3 : Edit named.conf file


Configure the named.conf . This is the main configuration files for our Split DNS.
# vi /etc/named.conf
Here is my name.conf file setup, take note on listening port. We also enable our DNS to perform forward
DNS query to google.
//
// 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 { 192.168.142.7; };
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 { any; };
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";
forwarders {8.8.8.8; 8.8.4.4; };
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "1a-centosserver.local" in {
type master;
file "1a-centosserver.local.ns";
allow-update { none; };
};
zone "142.168.192.in-addr.arpa" in {
type master;
file "142.168.192.in-addr.arpa.ns";
allow-update { none; };
};
zone "." IN {
type hint;
file "named.ca";
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

Next let us create the following our forward zone.

vi /var/named/1a-centosserver.local.ns
This is the forward zone file, you might amend it to your need. The following just focus on MX and Name
server (NS)
$ORIGIN 1a-centosserver.local.

$TTL 1d
@ IN SOA ns.1a-centosserver.local. support.1a-centosserver.local. (
2010031500 ; se = serial number
3h ; ref = refresh
15m ; ret = update retry
3w ; ex = expiry
3h ; min = minimum

)
IN A 192.168.142.7
IN NS ns
IN MX 10 mail.1a-centosserver.local.
ns IN A 192.168.142.7
mail IN A 192.168.142.7

Next, let us add the reverse zone.


vi /var/named/142.168.192.in-addr.arpa.ns
Add the following lines to the file.
$ORIGIN 142.168.192.in-addr.arpa.
$TTL 1d
@ IN SOA ns.1a-centosserver.local. support.1a-centosserver.local. (
2010031500 ; se = serial number
3h ; ref = refresh
15m ; ret = update retry
3w ; ex = expiry
3h ; min = minimum

)
IN NS ns.1a-centosserver.local.
7 IN PTR ns.1a-centosserver.local.
7 IN PTR mail.1a-centosserver.local.

Step3 : Start the DNS server


Let us start the DNS server.
service named start
chkconfig named on

Step4: Verify the DNS setting


Check the resolv.conf file for DNS server
cat /etc/resolv.conf
nameserver 192.168.142.7
nameserver 8.8.8.8
search 1a-centosserver.local

Let us perform the lookup internally. The following screen show the lookup is successfully performed via
ANSWER SECTION.

#dig 1a-centosserver.local
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6_3.1 <<>> 1a-centosserver.local
;; global options: +cmd

;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 37550
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
;; QUESTION SECTION:
;1a-centosserver.local. IN A
;; ANSWER SECTION:
1a-centosserver.local. 86400 IN A 192.168.142.7
;; AUTHORITY SECTION:
1a-centosserver.local. 86400 IN NS ns.1a-centosserver.local.
;; ADDITIONAL SECTION:
ns.1a-centosserver.local. 86400 IN A 192.168.142.7
;;
;;
;;
;;

Query time: 0 msec


SERVER: 192.168.142.7#53(192.168.142.7)
WHEN: Thu Jul 26 23:02:29 2012
MSG SIZE rcvd: 88

# dig mail.1a-centosserver.local
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6_3.1 <<>> mail.1a-centosserver.local
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 20735
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
;; QUESTION SECTION:
;mail.1a-centosserver.local. IN A
;; ANSWER SECTION:
mail.1a-centosserver.local. 86400 IN A 192.168.142.7
;; AUTHORITY SECTION:
1a-centosserver.local. 86400 IN NS ns.1a-centosserver.local.
;; ADDITIONAL SECTION:
ns.1a-centosserver.local. 86400 IN A 192.168.142.7
;;
;;
;;
;;

Query time: 1 msec


SERVER: 192.168.142.7#53(192.168.142.7)
WHEN: Thu Jul 26 23:10:15 2012
MSG SIZE rcvd: 93

Now, let us check the external dns lookup, we are trying to lookup vmware server to see if the lookup can
be forwarded successfully.
# dig vmware.com
; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6_3.1 <<>> vmware.com

;;
;;
;;
;;

global options: +cmd


Got answer:
->>HEADER<<- opcode: QUERY, status: NOERROR, id: 32878
flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;vmware.com. IN A
;; ANSWER SECTION:
vmware.com. 407 IN A 165.193.233.120
;;
;;
;;
;;

Query time: 18 msec


SERVER: 8.8.8.8#53(8.8.8.8)
WHEN: Thu Jul 26 23:06:46 2012
MSG SIZE rcvd: 44

Read More about Zimbra Collaboration Sever Setup at CentOS Linux Server

CentOS Server Guide by http://www.1a-centosserver.com is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0
Unported License. All trademarks are the property of their respective owners.
Contact Us | Privacy Policy

You might also like