Apple Mail Server: DNS Configuration

This article explains the most common Domain Name Server (DNS) configurations used with a mail server.
This article has been archived and is no longer updated by Apple.
DNS Fundamentals
The following section will go over DNS fundamentals. A Domain Name Server's primary duty is to take IP addresses and return host names, and vice versa. For example, a computer's IP address of will be converted to '' by the DNS. There are several different types of records that are used with a DNS. The most important is the A-record, which returns an IP address for a host name. The A-record's inverse is the PTR record, which returns a host name for an IP address. The PTR record is a little strange because it is created by reversing the IP address and adding '' to the end. There is also a CNAME record which is a host name alias to another host, this allows multiple host names to resolve to one IP address. These three record types are illustrated below.

A-record   name -> IP address ->

PTR        IP address -> name  ->

CNAME      host name alias (A-record name) =

The next type of DNS record is only used by SMTP Mail Servers. It is called an MX record, or mail exchanger. An MX-list is used with a host to specify how mail for that host should be delivered. The MX-list contains all the possible mail exchanger hosts along with preference values indicating which host should be the final recipient of mail. A host with a lower number value has higher preference (a host with a value of 10 would be preferred over a host valued at 15). If two hosts have the same preference value, they do load-balancing between them. MX records are best explained by example.

MX-list record for

In this example a mail server attempting to deliver mail to '' will ask DNS for the MX-list shown here. The server will then try and deliver the mail to the host on the MX-list that has the lowest numerical preference value. In this case it would be ''. The server will then look up the IP address for '' and deliver the mail to that address. If that host is not available the mail server will attempt to connect to the next best host, ''. If '' is also not available the mail server will then try ''. Supposing '' was up it would accept the mail and then assume responsibility for forwarding it on to '' because that host is the preferred final destination for mail addressed to ''. If all three of these hosts are down the attempting mail server will wait for a while (usually around 5-20 minutes) and try all three again in preference order.

There is a lot more complexity to DNS than what has been described, but that is enough background information to get started. This next section will describe the ways in which the Apple Mail Server uses DNS to deliver mail.

How the Apple Mail Server uses DNS
The Apple Mail Server uses DNS to discover what host names should be considered "local" and to properly deliver mail to other mail servers. Without a DNS available the mail server will be essentially nonfunctional. Many mail delivery problems are the result of a misconfigured DNS server. The Apple Mail Server is designed to use the information returned by DNS to auto-configure itself so that it "knows" what names it can be called by.

Who am I?
One of the first things the mail server does when it starts up is determine what its own names are. It will use DNS to look up the PTR record for the server computer's IP address to discover the name or names that goes with it (Example server IP = ''). This name will be marked as a "local" host in the host list. The server will also mark any hosts that end up being local when resolved through DNS. If a mail comes in that is addressed to '' and this name maps to '' using a CNAME record, then it will be marked local as well. MX-list hosts can also become "local" hosts if they point to the same computer, ( MX-list; 5 10 '' will be "local". All mail addressed to "local" hosts will be delivered to users in the mail servers Users & Groups list. Any hosts which are not local will need to be contacted for message delivery.

Server IP address
PTR for ->
A-record for ->
CNAME for ->

MX-list for

Local Host Names:,,

Using MX-lists
MX-lists are usually used in two ways. (1) Providing an alternative/backup mail server for a host, and (2) mapping a domain wide address to a specific mail server. It is important to have a backup mail server available to handle mail for your domain when your primary mail server goes down. You should configure an MX-list for your host which indicates mail for your mail server '' should be delivered to '' unless it is down, in which case it should be delivered to your backup server, '', or your Internet Service Provider's mail server, ''.

MX-list for

The second use for the MX-list is to provide a "shortcut" email address for your mail users. An MX-list can be created for a host that doesn't have an A-record, this is called an MX-only record. It is used to simplify email addresses, instead of having an email address of '' you can simply use ''. To do this, create an MX-only record which indicates mail for '' should go to ''. You'll also want to include your mail server backups in this MX-list.

MX-only list for

The mail server will also use the MX-list for all outgoing mail. It will look up the MX-list for each host and determine which computer should be contacted to deliver the mail. If the mail server comes across a host that does not have an MX-list it will attempt to connect to the A-record address for that host. The server will also try the A-record address if all hosts on the MX-list are unreachable.
Last Modified: Feb 20, 2012

Additional Product Support Information