Domain Name Knowledge Base | Cheap Domain Name Registration

How DNS Zone File Works

Page 10: DNS MX Resource Record

A MX (Mail Exchange) Resource Record uses to specify the mail server responsible for a domain name. If your domain do not has mail server or do not need email service, this MX Resource Record can be omitted.

The following is a typical example of using MX Resource Record. The domain (YourDomain.com) uses two mail servers (mail.YourDomain.com and mail2.YourDomain.com) to handle emails.

; MX Record
YourDomain.com. IN MX 0 mail1.YourDomain.com
YourDomain.com. IN MX 10 mail2.YourDomain.com

A domain can have many MX Records. The conditions are:

  • If one mail server is used, one MX Resource Record is required.
  • If two mail servers are used, two MX Resource Records are required.
  • If five mail servers are used, five MX Resource Records are required.

Please noted that there is a number after the MX Resource Record. This number is called Preference Number. You can use any integer, for example, 0, 5, 10, 20, 100…. etc, for the Preference Number.

What is the purpose of Preference Number for a MX Record? The Preference Numbers determine the order (lower numbers first) the mail servers should be used, with the smallest number has the highest priority. Usually no same Preference Numbers should be used for the MX Records of a same domain.

Suppose you are going to send an email to xxxx@YourDomain.com. The following are simplified procedures:

  1. Your ISP SMTP mail server send an request for the MX Records of YourDomain.com.
  2. Your ISP SMTP mail server get the address of mail server of Your Domain.com.
  3. Your ISP SMTP mail server contact the mail server with the highest priority. In the above example, mail1.YourDomain.com will be contacted.
  4. If the first mail server cannot be contacted successfully, the mail server with the second priority will be contacted, for example, mail2.YourDomain.com.

We will use a typical, simple and practical example of a DNS Zone File to conclude this series of tutorial in next chapter.

domain name knowledge base