Making Zimbra & BIND Work Together

Configuring BIND and Zimbra
on the same machine is a hot topic over in the forums. Zimbra checks to make sure that you have the correct MX an A records. In this Administrator’s PowerTip, we’ll discuss how to install and setup BIND and Zimbra on the same machine.

Administrator’s PowerTip
#3: June 20, 2007
Zimbra Forums Zimbra wikiZimbra


Because we will be dealing with MX and A records, performing this tutorial will result in downtime for
your server.

This tutorial has been tested on CentOS 4 using Zimbra Collaboration Suite 4.5.5 on i386 architecture. Although the installation of BIND may very from system to system, the basic configuration remains the same across platforms.

Due to the nature of DNS, it is highly recommended that you test before implementing. If you have difficulty, please feel free to stop by the Zimbra forums:

Part 1 : Installing BIND

You’ll need the following packages to have a nicely running DNS Server:

Let’s see if everything we need is already installed:

rpm -qa | grep -i bind
rpm -qa | grep -i caching

As you can see, not all of the needed packages are installed. I need “bind-devel”
and “caching-nameserver”.

yum install bind-devel*

yum install caching-nameserver*

Now, let’s turn it on on for runlevels 3 and 5 at startup:

chkconfig –levels 25 named on
Chkconfig –list | grep –I named

Time to start BIND, and make sure it’s running:

Part 2 : Configuring BIND

In this tutorial, the domain we’ll be creating is You can replace this with your own domain name.
We’ll also be using vim as our editor. It really doesn’t matter which editor you use, as long as it uses UNIX carriage returns.

Now we will configure BIND to be a primary name server for a single zone. (Don’t know what a Zone is?) We will add the hostnames www and mail. We will also have BIND respond if no hostname is specified in a query (i.e.

BIND stores its configuration data in named.conf which is located in the /etc directory. The zone data files are stored by default at /var/named (unless you have chroot. See below).

vim /etc/named.conf

Scroll through the file and take a look at the contents. Locate the localhost zone:

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

Move the cursor on the blank like below the }; and press the i key. The i key puts vim in insert mode (you should see — INSERT — at the bottom of vim). Press the enter key once then type in the following. Note: the spacing in front of type, file, and allow-update are tabs, so press the tab key on each of those lines.

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

We have told BIND that we handle the domain and the zone data is in the file located at /var/named. Now we have to create the file.

Switch over to /var/named and make a copy of the file and save it as This will give us a template to work with so we don’t have to type as much. It also saves us from changing the file’s owner, group, and permissions.

We’re going to use as our template:

cd /var/named

Make sure that is owned by named, not root.

This is the point where a lot of administrators run into trouble. How you configure this is 100% up to you; however, there are some caveats.
Most administrators have an internal DNS server that serves their clients inside their network only. This means that your DNS server only has authority for your LOCAL zone. You cannot alter internet zones such as

If you intend on changing your hosts file/ip address, I highly recommend that you run in terminal only mode. The x server does not like it when you change them while x is running. The x server may become unresponsive. Because DNS servers are queried by IP address, and not hostname, it is recommended that you have a static IP address.

You’ll need to adapt this tutorial for your own network. If your DNS server is internal, you will need to modify your outside DNS server adding Host A and MX records. However, because the Zimbra server will resolve locally, the system will not warn you that you cannot receive mail from the outside world. As far as Zimbra is concerned, it cannot tell the difference between an internet DNS server, and a local DNS server.

Put vim in insert mode and alter the zone file so it looks like the data below. Use tabs between items. Where I use you should replace with your public IP address (or private NATted address if your running internal only).

**NOTE: and IP Addresses are NOT routable beyond your gateway. If this is a public DNS Server, you cannot have one of those IP addresses in your DNS Setup.

If you have installed bind-chroot
(COMMAND: rpm –qa | grep bind*), then you will be creating your domain zone file in /var/named/chroot/var/named/ directory, and then you will make a symlink to the /var/named/ directory, but if you didn’t install this chroot package, then you are going to create the zone file directly in the /var/named/ directory.

Now the following command works fine, if you have bind-chroot:

vim /var/named/chroot/var/named/

OR (if bind-chroot is not installed)

vim /var/named/

vim /var/named/

"" is the name server responsible for It is also going to be our mail server. When you register a domain name the registrar asks you for the name servers names and IP’s. We have given our name server the name ns1 (i.e. name server 1 and or mail). So if we were to register, we would use for the name and the IP address of the machine we have designated as our DNS server.

With "IN MX 10" we are declaring a mail exchange (or mail server) with a priority of 10. Since we only use one mail server the priority has no effect.

The "IN A" means we are declaring a host (with no hostname, so it means and its IP is Any queries on just will resolve to This is is useful when you configure your web server to work on or If we had a different machine holding our website, we would enter the corresponding host a record and IP address.

The rest of the entries mean we are declaring hosts mail and www (,

The server does not update as you change the zone file(s). You’ll need to restart the server by running:

service named reload

Part 3 : Other Configurations

Now that bind is all set up, we need to set it up to point to itself.

vim /etc/resolv.conf

This should be a big red flag. You can see by my resolv.conf, I have DHCP turned
on. I later turned it off, as it caused lots of trouble. :) is the IP address of our nameserver (

We also have to give the computer the correct hostname


And set up our hosts file:

vim /etc/hosts

This ensures that if the system needs to reach, it will find it on

Part 4 : Resolving Your Domain

To find out if our nameserver is resolving correctly, let’s run a dig on our server:

dig mx

dig a

Part 5 : Installing Zimbra Collaboration Suite

This part is pretty straightforward. If you server is operating correctly, the installation process will show you that it queried for dns records, and was successful:

In this case, I got an error. That’s because the Zimbra server will query for the MX record of its hostname. I did not create an mx record for I created an MX record for Why? Because my e-mail addresses will be “” not “”.

The installer asked if I wanted to change my domain name, I said yes, and changed it to The installer went flawlessly, and I could send and receive mail.

Troubleshooting Tips

If you can’t resolve your domain, you may want to check the following:

Are you using DHCP? If so, try making your address static

Do you have your named.conf pointing to your correct zone/host file? Are the locations correct?

Do you have chroot installed?

Are the permissions correct?
They cannot be owned by root. They should be owned by named.

Is your own server pointing to itself as a resovler? Check /etc/resolv.conf

Try restarting named
and/or checking the status (service named status)

More Help

Zimbra Wikipeida – DNS

Zimbra Forums – DNS
In a Nutshell

Administrator’s PowerTip
#3 – Handout

4 Responses to Making Zimbra & BIND Work Together

  1. tawich November 27, 2010 at 10:14 AM #

    howto install bind on Ubuntu



  1. Instalation confirmation - Zimbra - Forums - January 15, 2010

    […] […]

  2. Please help : Installation confirmation - Zimbra - Forums - January 15, 2010

    […] […]

  3. My Notes for Installing Zimbra OSE on Ubuntu Server 10.04 LTS - Zimbra :: Forums - April 27, 2012

    […] Making Zimbra and BIND Work Together […]

Copyright © 2022 Zimbra, Inc. All rights reserved.

All information contained in this blog is intended for informational purposes only. Synacor, Inc. is not responsible or liable in any manner for the use or misuse of any technical content provided herein. No specific or implied warranty is provided in association with the information or application of the information provided herein, including, but not limited to, use, misuse or distribution of such information by any user. The user assumes any and all risk pertaining to the use or distribution in any form of any subject matter contained in this blog.

Legal Information | Privacy Policy | Do Not Sell My Personal Information | CCPA Disclosures