Skip to content
Help Center

What is an MX record and how does it affect email?

MX Record: what it is, what it's for, and how it relates to domains and DNS within a hosting service.

Quick summary

  • What it is: An MX Record (Mail Exchange) is a type of record in the Domain Name System (DNS) that specifies a mail server authorized to receive email.
  • What it's for: it helps connect the domain with the website, email and other associated services.
  • When to check it: when changing DNS servers, connecting a domain, configuring email or reviewing propagation.

An MX Record (Mail Exchange) is a type of record in the Domain Name System (DNS) that specifies a mail server authorized to receive email on behalf of a domain. This record is fundamental for directing the flow of emails to and from a domain, ensuring that email messages reach their correct destination.

Characteristics and function of the MX Record:

  • Email traffic direction: MX records direct incoming mail to the mail servers specified for a domain. When an email is sent, the sending server queries the DNS to obtain the MX records for the recipient's domain and then sends the message to the server specified in the record.
  • Prioritization: A domain can have multiple MX records, each with a specific priority. These priority values determine the order in which mail servers should be contacted. The server with the lowest priority value is tried first. If that server is unavailable, the next server with the next lowest value is tried, and so on.
  • MX record format: An MX record includes a priority (an integer) and the hostname of the mail server. It does not include IP addresses directly; instead, the specified hostname must have A or AAAA records that resolve to an IP address.

Example of how to configure an MX Record:

Suppose you want to configure email for the domain "example.com". You could set up the following MX records in your DNS:

example.com. 3600 IN MX 10 mail1.example.com.
example.com. 3600 IN MX 20 mail2.example.com.

In this example:

  • "3600" is the TTL (Time to Live), which indicates how many seconds caching servers can store information about this record.
  • "IN" indicates it is an Internet record.
  • "MX" indicates it is a mail exchange record.
  • "10" and "20" are the priority values for the mail servers. "mail1.example.com" has the highest priority (10) and will be the first server tried. "mail2.example.com" serves as a backup with a lower priority (20).

Importance of MX records:

  1. Email routing: MX records are crucial to ensuring that all emails sent to addresses under a specific domain reach their proper destination.
  2. Resilience and redundancy: By allowing multiple MX records with different priorities, a domain can have redundant mail server configurations, increasing the reliability and availability of the email service.
  3. Mail management flexibility: MX records allow email to be handled by servers separate from those handling web traffic, which offers flexibility in how internet services are managed for a domain.

MX records are essential for email management in any domain and must be configured carefully to ensure efficient and reliable mail delivery.

Why it matters in hosting

Understanding this concept will help you make better decisions when managing your service. In practice, it relates to the connection between the domain, the website, email and other associated services. If it appears in a guide, the control panel or a support response, review the context before making changes.

Related articles

  • Domain
  • DNS
  • Nameservers
  • A Record
  • CNAME Record