MX Records
Completed
First: there is a separate article which focuses on the relatively new "NULL MX Record", which you can read at:
https://dns.ultraproducts.support/hc/en-us/community/posts/26150271295003-NULL-MX-Records
There is also an overview to mail related DNS records which focuses on several newer mail related records (DKIM, DMARC, as well as brief mentions of SPF and MX) you can see at:
This article deals specifically with MX (Mail eXchanger) records, which are a DNS record type that allows specifying where to send mail for a domain. As an example, mail to me, Mike.Vevea@vercara.com obviously should be sent to the mail servers that handle Vercara's mail. Historically mail was sent to the A record associated with the domain name (in this case, to the A record for vercara.com.) which used to be what was normal. Now, it's very common to send mail to some other servers (e.g. to Google's servers, or to Microsoft's Outlook servers, or to a server named something like mail.mydomain.com). MX records allow telling where to send the mail; they also support load balancing between multiple servers, and allow establishing a backup hierarchy in case the main server(s) fails.
The "rdata" (Record DATA) for an MX record has two parts; for example, the MX record for vercara.com looks like:
vercara.com. 3600 IN MX 0 vercara-com.mail.protection.outlook.com.
This MX record says that it's an MX record that describes how to send mail addressed to user@vercara.com. The actual rdata part is 2 fields, a preference (0) and the hostname of the server to which the mail should be sent. It is possible to have multiple MX records for a given domain; in that case, the preference is used to select the server. Numerically lower preferences are "better". If two or more MX records have the same priority, the sending system selects one to use, which effectively load balances by sending some mail to each of the servers. If all servers at a given preference fail, but there are other less desirable servers (preference is a higher value), the mail will be sent to the next most preferable server(s) in the RRSET ("Resource Record SET, which is the name for a group of records with the same name and type).
In some cases, such as vercara.com, it's also possible to achieve load balancing and backup by having more than one IP for the host to send mail to. In the case of vercara.com, there's only one MX record, but if you look up the host name, it is an RRSET with 7 IPs, which effectively load balances across those servers, and achieves backup by supplyng a number of other servers if the first fails.
One final note on the preferance values; the actual numbers don't actually matter; all that matters is which is the numerically lowest preference of available servers. But there are reasons not to use a preference of 0…mainly that if you have an emergency and have to add a “more preferable” server for a while, having some wiggle room in the preference hierarchy…you can just add a 0 preference MX record temporarily, without needing to renumber an existing MX record that has preference of 0.
There is a special type of MX record which is called a "NULL MX Record"; it says "never send email to this domain". If present, it MUST be the only MX record for the domain. There's a separate article about NULL MX records, which you can see at:
https://dns.ultraproducts.support/hc/en-us/community/posts/26150271295003-NULL-MX-Records
If there are no MX records for a domain (including "no NULL MX records"), the mail servers trying to send mail to the domain will fall back to the behavior from before MX records were used; that is, they look up the A record for the domain, and attempt to send mail to it. NOTE: if it isn't configured to handle mail, this can lead to many retries (and can cause a LOT of attempts to look for DNS records...I just helped debug a configuration which was causing literally millions of queries a day for essentially this reason!)
It is almost always best practice to configure an MX record for every domain. Many security audits now downgrade your rating if you don't have MX records (and other mail related records) for every domain you "own". They also often expect NULL MX records for domains which should never receive mail.