Setting up internal Bind DNS for Zimbra mail server on Amazon EC2 CentOS & RHEL Servers

Zimbra Collaboration server needs to resolve MX records of a domain while installing. Amazon EC2 instances are behind NAT so we need to have an working internal DNS server to do the MX resolution.

1. Install Bind

yum install bind9 -y

2. Add required changes on bind configuration file. Need to change forwarder and add zone for the domain.

vi /etc/named.conf

Find and replace the forwarders with the below (it is a google DNS servers we are using)

forwarders {; };

Add zone information in named.conf (replace with your domain)

zone "" in {
        type master;
        file "";

Save the file and exit from editor.

3. Creating the zone file. (replace with your email domain and with your servers internal IP)

vi /var/lib/named/

;       Addresses and other host information.
@       IN      SOA (
                               10118      ; Serial
                               43200      ; Refresh
                               3600       ; Retry
                               3600000    ; Expire
                               2592000 )  ; Minimum
;       Define the nameservers and the mail servers
        	     IN      NS         IN      MX      10    IN      A

Bind setup is done, just restart bind.

/etc/init.d/named restart

4. DNS setup is done, now we need to tell the server to use internal bind server for resolution. (replace with your email domain and with your servers internal IP)

vi /etc/resolv.conf

Replace it with the below


Save the file. Now proceed to zimbra installation. It should resolve MX record for your domain properly.

Leave a Reply

Your email address will not be published. Required fields are marked *