The 20 Minute E-mail Solution!

Setting Up Mail Server Records in the DNS

To set up your mail server in the DNS, you must create the records that other mail servers use to find and connect to your mail server. Making these entries requires that you first have:

Your Local Network's DNS server

Before your mail server can communicate with other mail hosts, you must configure the DNS server to recognize your mail server. Without a functional and correctly set DNS, IMail Server cannot deliver mail, except to domains that are within IMail Server.

For each mail host on your network, you must make the following entries in your DNS:

Note that mail hosts (virtual hosts) that do not have an IP address require only an MX record.

Since there are DNS servers from many vendors available, we cannot describe how to create the records for your specific DNS server. Instead, we show an example using a basic configuration for a single mail host.

Example of a Basic Configuration

In this example, we use a DNS lookup tool to query the DNS server and show the responses. You can use the Windows NT command line program, NSLOOKUP, to query a DNS server. If you are not familiar with this tool, we suggest the Ipswitch WS_Ping ProPack application, which provides a graphical interface for querying a DNS server. Use the Lookup tool in WS_Ping ProPack.

To describe the DNS entries for a mail server, we use examples from a typical small network and start with the following assumptions:

You must set up the following records for the computer:

E-mail for the users on this mail host is addressed to

First, we do an MX lookup (just as a sending mail server would do) to find the mail host for the network. To simulate this, in the WS_Ping ProPack's Lookup tool, we enter in the Name/Address box and MX as the Query Type, which returns the following: 

This shows that and are both mail hosts for the network. The host is a backup mail server. The number indicates the priority of the mail host - it tells the sending mail server which mail host to try first. The lower the number, the higher the priority. In our case, is the one we want other mail servers to use first; is used only if is down.

For information about how a backup mail server works, see "Setting Up IMail Server as a Backup Mail Spooler" in the IMail Server User's Guide.

Only a host name is returned in response to an MX query. The sending mail server needs the IP address of this host name so it can connect to the mail host. The sending mail server performs another DNS lookup to get the IP address (defined in the A record) of highest priority mail host. To simulate this, in the Lookup tool, we enter in the Name/Address box and A as the Query Type, which returns the following: 

If we query the A record for, we get: 

With the IP address for the host, the sending mail server can now connect to that host and deliver the mail. If the attempt is successful, there is no need to go any further. However, if the host is down, the connection attempt fails and the sending mail server will have to try the next highest priority MX record, in this case,

Sample DNS Records

If we use a DNS lookup tool to query the DNS server for the network in our example (for all information, in verbose mode), you would see entries like the following:  IN MX   50  
IN MX 10  IN A   IN A,type = PTR 
 host =,type = PTR 
 host = 

Other Configurations

If you have multiple mail hosts on your IMail Server, you will need an MX, A, and PTR record for each host. The "Configuration" chapter in the IMail Server User's Guide describes some advanced configuration topics and describes the DNS entries you must make for these advanced configurations.

Ipswitch, Inc.
©Ipswitch 2004