Domain Name System (DNS) supports advanced mail routing through the use of Mail and Mail Exchanger (MX) records.
Mail and MX records are used by mail routing programs, such as Simple Mail Transfer Protocol (SMTP). The lookup table in DNS resource records contains the types of mail records that i5/OS® DNS supports.
DNS includes information for sending electronic mail by using mail exchanger information. If the network is using DNS, an SMTP application does not deliver mail addressed to host TEST.IBM.COM by opening a TCP connection to TEST.IBM.COM. SMTP first queries the DNS server to find out which host servers can be used to deliver the message.
DNS servers use resource records that are known as mail exchanger (MX) records. MX records map a domain or host name to a preference value and host name. MX records are generally used to designate that one host is used to process mail for another host. The records are also used to designate another host to deliver mail to, if the first host cannot be reached. In other words, they allow mail that is addressed to one host to be delivered to a different host.
Multiple MX resource records might exist for the same domain or host name. When multiple MX records exist for the same domain or host, the preference (or priority) value of each record determines the order in which they are tried. The lowest preference value corresponds to the most preferred record, which is tried first. When the most preferred host cannot be reached, the sending mail application tries to contact the next, less preferred MX host. The domain administrator, or the creator of the MX record, sets the preference value.
A DNS server can respond with an empty list of MX resource records when the name is in the DNS server's authority but has no MX assigned to it. When this occurs, the sending mail application might try to establish a connection with the destination host directly.
Using a wild card (example: *.mycompany.com) in MX records for a domain is not suggested.
In the following example, the system, by preference, delivers mail for fsc5.test.ibm.com to the host itself. If the host cannot be reached, the system might deliver the mail to psfred.test.ibm.com or to mvs.test.ibm.com (if psfred.test.ibm.com also cannot be reached). This is an example of what these MX records will look like:
fsc5.test.ibm.com IN MX 0 fsc5.test.ibm.com IN MX 2 psfred.test.ibm.com IN MX 4 mvs.test.ibm.com