To provide mail service on your network, you must set up DNS so that incoming mail is sent to the correct mail host on your network.
When you set up mail service, you define a series of hosts, known as mail exchangers or MX hosts, each of which has a defined priority level. The host with the highest priority gets the mail first. If that host is unavailable, the host with the next highest priority
gets the mail, and so on.
Suppose the mail server’s host name is reliable in the example.com domain. Without an MX record, users mail addresses would include the name of your mail server computer,
like this: [email protected].
To change the mail server or redirect mail, you must notify potential senders of a new address for your users, or you can create an MX record for each domain you want handled by your mail server and direct the mail to the correct computer.
When you set up an MX record, include a list of potential computers that can receive mail for a domain. That way, if the server is busy or down, mail is sent to another computer.
Each computer on the list is assigned a precedence number (its priority). The one with
the lowest number is tried first. If that computer isn’t available, the computer with the next lowest number is tried, and so on.
When a computer receives the mail, it holds the mail and sends it to the main mail server when the main server becomes available, and then the main mail server delivers the mail.
Following is an example of an MX record that includes three computers that can receive mail for the example.com domain:
example.com
10 reliable.example.com 20 our-backup.example.com 30 last-resort.example.com
MX records are used for outgoing mail too. When your mail server sends mail, it looks at the MX records to see whether the destination is local or somewhere else on the Internet, then the process above happens in reverse.
If the main server at the destination is not available, your mail server tries every
available computer on that destination’s MX record list until it finds one that accepts
the mail.
Configuring DNS for mail service involves creating MX records in DNS for your mail
servers. If your ISP provides DNS service, contact the ISP so they can enable your MX records. Follow these steps only if you provide your own DNS service.
You might want to set up multiple servers for redundancy. If so, create an MX record
for each auxiliary server.
To enable MX records for your mail server:
1 Open Server Admin and connect to the server.
2 Click the triangle at the left of the server. The list of services appears.
3 From the expanded Servers list, select DNS.
4 Click Zones.
5 Select the zone this record is to be added to.
6 Click the triangle at the left of the zone. The list of records appear.
7 Click Add Record, then choose Add Machine (A). This adds a machine record to the zone.
8 In the Machine Name field, enter the hostname of the computer.
If you want to use the fully qualified name of the computer, select the Fully Qualified checkbox and enter the fully qualified domain name of the computer.
9 Click the Add (+) button and enter the IP addresses for the computer.
10 In the relevant text boxes, enter information about the hardware and software of the
computer.
11 In the Comment text box, enter comments about the computer. This field is the basis for the TXT record of the computer.
You can store up to 255 ASCII characters in the comments text box. You can include the physical location of the computer (for example, Upstairs server closet B), the computer’s owner (for example, John’s Computer), or any other information about the
computer.
12 Click Save.
13 To add other names that you want this computer to have, click Add Record and choose Add Alias (CNAME).
Add as many aliases as you want for your server.
14 In the Alias Name field, enter the alternate name for your computer.
If you want to use the fully qualified name for the Alias, select the Fully Qualified checkbox and enter the fully qualified domain name.
This field is the basis for the CNAME records of the computer. Reverse lookup pointer
records are created for the computer.
15 In the Destination field, enter the computer name you are creating the alias for. If you want to use the fully qualified name for the Destination, select the Fully Qualified checkbox and enter the fully qualified domain name.
16 Click Save.
17 From the expanded Servers list, select Mail.
18 Click Settings, then click Advanced.
19 Click Hosting.
20 Click the Add (+) button next to the Local Host Aliases Field.
21 In the Local Host Alias field, enter the alias name you created earlier.
22 Click OK, then click Save.
23 Repeat Steps 7 through 22 for each mail server.