What will I learn?
MX is an abbreviation for 'Mail Exchanger'. An MX record is configured in the DNS (Domain Name System). It signals where an email should be routed on the Internet.
An MX record points to a mail server which accepts incoming emails for a domain. It is a resource record in the DNS that indicates where an email will be delivered in compliance with the Simple Mail Transfer Protocol (SMTP).
When an email is sent to email@example.com the following events take place:
- The sender's server looks for the receiver's Authoritative Nameservers.
- The sender's server runs a query on company.com's nameservers to find its MX records.
- Then, a query is run on the MX records in the DNS. This locates the IP address for the mail exchanger to which the email will be delivered.
Multiple MX records can be added to a DNS for backup in case the primary server is not available for some reason. Different 'MX preference' values can be set for each record.
However, having multiple MX records does not mean that every MX will receive one copy of the email. The email will be delivered to the MX server that holds the lowest preference. The lowest preference value holds the highest priority. If the server with the lowest preference is unable to accept emails at a particular time, then the email will be delivered to the server with the next highest priority.